From 2c370847e72d36d959b6d7f6733bf7c64af8e635 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sat, 13 Sep 2025 11:05:22 +1000 Subject: [PATCH] [idd] nsis: create a registry key the driver can write to --- idd/installer.nsi | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/idd/installer.nsi b/idd/installer.nsi index 64ea1e26..27724233 100644 --- a/idd/installer.nsi +++ b/idd/installer.nsi @@ -121,6 +121,32 @@ FunctionEnd ${EndIf} !macroend +!macro CreateDriverRegKey + + ${If} ${RunningX64} + SetRegView 64 + ${EndIf} + + ; Create just the key + WriteRegStr HKLM "Software\\LookingGlass\\IDD" "" "" + + ; Grant FullAccess to SYSTEM (SID S-1-5-18) + AccessControl::GrantOnRegKey HKLM "Software\\LookingGlass\\IDD" "(S-1-5-18)" "FullAccess" + Pop $R0 + +!macroend + +!macro RemoveDriverRegKey + + ${If} ${RunningX64} + SetRegView 64 + ${EndIf} + + ; Remove the entire key + DeleteRegKey HKLM "Software\\LookingGlass" + +!macroend + ;Install !ifdef IVSHMEM Section "IVSHMEM Driver" Section0 @@ -190,6 +216,7 @@ Section "!Indirect Display Driver (IDD)" Section1 !insertmacro StopLGIddHelper DetailPrint "Installing IDD" + !insertmacro CreateDriverRegKey nsExec::ExecToLog '"$INSTDIR\LGIddInstall.exe" install' Pop $0 @@ -206,6 +233,7 @@ Section "Uninstall" Section6 DetailPrint "Uninstalling IDD" nsExec::ExecToLog '"$INSTDIR\LGIddInstall.exe" uninstall' + !insertmacro RemoveDriverRegKey DetailPrint "Clean up helper service" nsExec::Exec 'sc.exe delete LGIddHelper'