pub fn build_cli_com_proxy(
exe_name: &str,
exe_dir: Option<PathBuf>,
) -> Result<()>Expand description
Compile a small console executable that proxies CLI requests to a full hybrid CLI and GUI executable.
The exe_name must be the name of the full executable, with lower case .exe extension.
The exe_dir is only required if the target dir is not $OUT_DIR/../../../.
The full executable must call attach_console at the beginning.
§How it Works
This will compile a foo.com executable beside the foo.exe, both must be deployed in the same dir.
When users call the foo command from command line the foo.com is selected, it simply proxies all requests to the
foo.exe and holds the console open. This is the same trick used by Visual Studio with devenv.com and devenv.exe.
§Code Signing
If you code sign the full executable or configure any other policy metadata on it you mut repeat the signing for the proxy executable too. Note that the generated .com executable is a normal PE file (.exe), it is just renamed to have higher priority.
§Panics
Panics if not called in a build script (build.rs). Returns an error in case of sporadic IO errors.