Skip to content

Commit 9b1d1db

Browse files
committed
add hint that adm updater does not need elevation
1 parent 8abaca5 commit 9b1d1db

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

AutoDarkModeSvc/AutoDarkModeSvc.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<TargetFramework>net9.0-windows10.0.22621.0</TargetFramework>
66
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
77
<UseWindowsForms>true</UseWindowsForms>
8-
<Version>11.1.0.19</Version>
8+
<Version>11.1.0.20</Version>
99
<AssemblyName>AutoDarkModeSvc</AssemblyName>
1010
<ApplicationIcon>..\adm_tray_new.ico</ApplicationIcon>
1111
<StartupObject>AutoDarkModeSvc.Program</StartupObject>

adm-updater-rs/build.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@ fn main() {
44
if cfg!(target_os = "windows") {
55
let mut res = winres::WindowsResource::new();
66
res.set_icon("adm_new.ico");
7+
// Embed an explicit asInvoker manifest. Without a requestedExecutionLevel,
8+
// Windows falls back to UAC Installer Detection, which heuristically flags
9+
// this binary as an installer (its name and version resources contain
10+
// "Updater"/"update") and prompts for elevation. PCA can also stamp a sticky
11+
// RUNASADMIN compat shim on a manifest-less exe. Declaring asInvoker disables
12+
// both: the updater simply runs with the token of whoever launched it.
13+
res.set_manifest(
14+
r#"<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
15+
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
16+
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
17+
<security>
18+
<requestedPrivileges>
19+
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
20+
</requestedPrivileges>
21+
</security>
22+
</trustInfo>
23+
</assembly>
24+
"#,
25+
);
726
res.compile().unwrap();
827
static_vcruntime::metabuild();
928
}

0 commit comments

Comments
 (0)