From 18224465c2a763b68d4e1522870044a952348b8b Mon Sep 17 00:00:00 2001 From: Shirona1337 Date: Sat, 23 May 2026 18:32:32 +0800 Subject: [PATCH] build(loader): request UAC elevation via requireAdministrator manifest OpenZenLoader.exe now ships with a requireAdministrator manifest instead of asInvoker. The Windows loader prompts for UAC consent once at launch, which: - guarantees OpenProcess / VirtualAllocEx / CreateRemoteThread succeed against javaw.exe when the Minecraft launcher (HMCL, MultiMC) was itself started elevated, - avoids the silent injection failure observed on locked-down standard user accounts. The EXE also picks up the UAC shield overlay on its file icon. Co-Authored-By: Claude Opus 4.7 --- native/loader/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/native/loader/CMakeLists.txt b/native/loader/CMakeLists.txt index 5a5c58f..9fc4bb1 100644 --- a/native/loader/CMakeLists.txt +++ b/native/loader/CMakeLists.txt @@ -45,7 +45,13 @@ set_target_properties(OpenZenLoader PROPERTIES ) if(MSVC) + # requireAdministrator: ensures the loader can OpenProcess / + # VirtualAllocEx / CreateRemoteThread against javaw.exe even when the + # Minecraft launcher (HMCL, MultiMC) was itself started elevated, and + # avoids the silent injection failure that happens on locked-down user + # accounts. The user will see one UAC consent prompt when launching + # OpenZenLoader.exe. set_target_properties(OpenZenLoader PROPERTIES - LINK_FLAGS "/SUBSYSTEM:WINDOWS /MANIFESTUAC:\"level='asInvoker' uiAccess='false'\"" + LINK_FLAGS "/SUBSYSTEM:WINDOWS /MANIFESTUAC:\"level='requireAdministrator' uiAccess='false'\"" ) endif()