summaryrefslogtreecommitdiff
path: root/Modules/NSIS.template.in
diff options
context:
space:
mode:
authorMattias Helsing <helsing72@gmail.com>2012-02-01 08:15:44 -0500
committerBrad King <brad.king@kitware.com>2012-02-01 08:18:49 -0500
commitc4a0bcea775981dea86d527f66161c98f5e05e95 (patch)
treeb2fc9c2e4b72a928b1db99bc605731383c6e5a8c /Modules/NSIS.template.in
parentba4a9f726d5de80c2668fd86e7e511890359ef8c (diff)
downloadcmake-c4a0bcea775981dea86d527f66161c98f5e05e95.tar.gz
CPack: Fix NSIS handling of privileged users (#12923)
When using the NSIS generator from CPack the file NSIS.template.in is used to generate a project.nsi file for NSIS to process. The file consists code in the NSIS scripting language. Among other functions there is an onInit function the initializes the installer. The function (tries to) recognise admin and power users but fails since NSIS scripting language relative includes the jump from the current command so +3 means "run the third command after this one", so a failed check for admin completely skips the check for a power user and goes directly to "done:". User permission lookup was added in initial NSIS support by commit a11b9a4c (Merge from CPack branch, 2006-01-01). Later commit b1b052fd (Several changes to for NSIS, 2006-03-01) added a line inside a block that should be skipped by a jump without updating the jump length. Update the jump length to correct the behavior.
Diffstat (limited to 'Modules/NSIS.template.in')
-rw-r--r--Modules/NSIS.template.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/NSIS.template.in b/Modules/NSIS.template.in
index 6259a5bdf9..819cc5cc0f 100644
--- a/Modules/NSIS.template.in
+++ b/Modules/NSIS.template.in
@@ -922,12 +922,12 @@ Function .onInit
Pop $0
UserInfo::GetAccountType
Pop $1
- StrCmp $1 "Admin" 0 +3
+ StrCmp $1 "Admin" 0 +4
SetShellVarContext all
;MessageBox MB_OK 'User "$0" is in the Admin group'
StrCpy $SV_ALLUSERS "AllUsers"
Goto done
- StrCmp $1 "Power" 0 +3
+ StrCmp $1 "Power" 0 +4
SetShellVarContext all
;MessageBox MB_OK 'User "$0" is in the Power Users group'
StrCpy $SV_ALLUSERS "AllUsers"