nabijaczleweli / cargo-update

A cargo subcommand for checking and applying updates to installed executables
MIT License
1.22k stars 42 forks source link

Embed manifest resource using MSVC toolchain, to avoid installer heuristics. #16

Closed liigo closed 7 years ago

liigo commented 7 years ago

I tested it on Windows 10 + MSVC 2015. The manifest resource was linked into .exe, which don't requires administrator privilege to be run anymore. (I didn't touch existing code for gnu toolchain, it will continue works, if it did works.)

See comments on #11 for more information. Fixes #11 Fixes #14

@nabijaczleweli r?

nabijaczleweli commented 7 years ago

Works on GNU too, nice work

mzji commented 7 years ago

By the document, the msvc linker will recognize the binary resource file, convert it to a COFF object file and link it to the final binary automatically.

nabijaczleweli commented 7 years ago

Another case of counter-intuitive specialcasing by M$, :goodjob:

mzji commented 7 years ago

Well, on Windows, it is a common practice that include the compiled resources inside the final PE binary, so I think what MSVC's link.exe did here makes sense. Yeah, it's a bit anti-intuitive for Unix people since the PE file could include icons (which is binary resource, IMO), but the ELF/Mach-O can't.

Reference: Comparison of executable file formats on Wikipedia, note the "Icon" part.

liigo commented 7 years ago

An useful feature, not counter-intuitive, IMHO.

nabijaczleweli commented 7 years ago

Useful: yes, counter-intuitive: slightly, since you get an object file you can link to/