From e49f7b0917ba827b19248d10ee4b7019c2c614cf Mon Sep 17 00:00:00 2001 From: zeromus Date: Thu, 15 Jun 2017 22:29:47 -0500 Subject: [PATCH] add some snippets which may throw warnings in unusual cases where broken systems report escalated privileges which are not actually true --- bizhawk_prereqs.nsi | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/bizhawk_prereqs.nsi b/bizhawk_prereqs.nsi index 848e31e..586dcea 100644 --- a/bizhawk_prereqs.nsi +++ b/bizhawk_prereqs.nsi @@ -1,15 +1,27 @@ +!include LogicLib.nsh !include "MUI2.nsh" !include "NsisDotNetChecker\DotNetChecker.nsh" +; Request application privileges for Windows Vista+ +RequestExecutionLevel admin + +Function .onInit +UserInfo::GetAccountType +pop $0 +${If} $0 != "admin" ;Require admin rights on NT4+ + MessageBox mb_iconstop "Administrator rights required!" + SetErrorLevel 740 ;ERROR_ELEVATION_REQUIRED + Quit +${EndIf} +FunctionEnd + + ; The name of the installer Name "BizHawk Prerequisites" ; The file to write OutFile "bizhawk_prereqs.exe" -; The default installation directory -InstallDir $DESKTOP\Example1 - ; Request application privileges for Windows Vista+ RequestExecutionLevel admin