-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Embed the manifest on Windows, so no elevation is performed
This would be much cleaner if the build scripts were actually fucking documented properly Gigantic thanks to @TheCatPlusPlus who saved the day once again (solution heavily based on https://github.com/TheCatPlusPlus/rust-manifest-test) Ref: #11 Closes #13
- Loading branch information
1 parent
143502e
commit ef4346c
Showing
8 changed files
with
47 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use std::process::Command; | ||
use std::path::Path; | ||
use std::env; | ||
|
||
fn main() { | ||
if cfg!(target_os = "windows") { | ||
let out_dir = env::var("OUT_DIR").unwrap(); | ||
|
||
Command::new("windres") | ||
.args(&["--input", "cargo-install-update-manifest.rc", "--output-format=coff", "--output"]) | ||
.arg(&format!("{}/cargo-install-update-manifest.res", out_dir)) | ||
.status() | ||
.unwrap(); | ||
|
||
Command::new("ar") | ||
.args(&["crs", "libcargo-install-update-manifest.a", "cargo-install-update-manifest.res"]) | ||
.current_dir(&Path::new(&out_dir)) | ||
.status() | ||
.unwrap(); | ||
|
||
println!("cargo:rustc-link-search=native={}", out_dir); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#include "winuser.h" | ||
1 RT_MANIFEST cargo-install-update.exe.manifest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> | ||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> | ||
<security> | ||
<requestedPrivileges> | ||
<requestedExecutionLevel level="asInvoker" uiAccess="false"/> | ||
</requestedPrivileges> | ||
</security> | ||
</trustInfo> | ||
</assembly> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters