i want to use the build.rs to copy some files and use upx in the end of the batch process. But all Cargo Build Envs don't point directly to target/release folder and don't give me the correct FullPathname of the target/release/binary.exe.
Knows anybody how i can use envs for the target/release/binary.exe that i can use copy operations and upx in the build.rs?
Are you trying to use build.rs to run upx on the compiled binary of the same crate? Build scripts run before compilation so you can't really do that. You can try using something like cargo-xtask or a Makefile.
build.rs is not for this purpose. it is run before compiling the crate, and it is invoked per package, not per binary/library/example/etc, so it makes no sense to provide the path of the target artifact as input to the build script.