Call MULTIUSER_INIT_QUIT if command line is incompatible (Bug #1253)

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7263 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2021-02-16 15:57:28 +00:00
parent ee4c9b6e33
commit 11824508c7
2 changed files with 55 additions and 58 deletions

View file

@ -9,7 +9,7 @@ Copyright 2008-2021 Joost Verburg
*/
!ifndef MULTIUSER_INCLUDED
!define MULTIUSER_INCLUDED 20200319
!define MULTIUSER_INCLUDED 20210216
!verbose push 3
;Standard NSIS header files
@ -36,13 +36,9 @@ Var MultiUser.InstallMode
!ifdef MULTIUSER_INSTALLMODE_COMMANDLINE
!include StrFunc.nsh
!ifndef StrStr_INCLUDED
${StrStr}
!endif
${Using:StrFunc} StrStr
!ifndef MULTIUSER_NOUNINSTALL
!ifndef UnStrStr_INCLUDED
${UnStrStr}
!endif
${Using:StrFunc} UnStrStr
!endif
Var MultiUser.Parameters
@ -88,8 +84,8 @@ Install modes
;Install mode initialization - per-machine
${ifnot} ${IsNT}
${orif} $MultiUser.Privileges == "Admin"
${orif} $MultiUser.Privileges == "Power"
${orif} $MultiUser.Privileges == "Admin"
${orif} $MultiUser.Privileges == "Power"
StrCpy $MultiUser.InstallMode AllUsers
@ -247,7 +243,7 @@ Installer/uninstaller initialization
!else if "${MULTIUSER_EXECUTIONLEVEL}" == Power
${if} $MultiUser.Privileges != "Power"
${andif} $MultiUser.Privileges != "Admin"
${andif} $MultiUser.Privileges != "Admin"
${if} ${AtMostWinXP}
MessageBox MB_OK|MB_ICONSTOP "${MULTIUSER_INIT_TEXT_POWERREQUIRED}"
${else}
@ -263,7 +259,7 @@ Installer/uninstaller initialization
;Default to per-machine installation if possible
${if} $MultiUser.Privileges == "Admin"
${orif} $MultiUser.Privileges == "Power"
${orif} $MultiUser.Privileges == "Power"
!ifndef MULTIUSER_INSTALLMODE_DEFAULT_CURRENTUSER
Call ${UNINSTALLER_FUNCPREFIX}MultiUser.InstallMode.AllUsers
!else
@ -320,10 +316,11 @@ Installer/uninstaller initialization
${if} $MultiUser.Result != ""
${if} $MultiUser.Privileges == "Admin"
${orif} $MultiUser.Privileges == "Power"
${orif} $MultiUser.Privileges == "Power"
Call ${UNINSTALLER_FUNCPREFIX}MultiUser.InstallMode.AllUsers
${else}
MessageBox MB_OK|MB_ICONSTOP "${MULTIUSER_INIT_TEXT_ALLUSERSNOTPOSSIBLE}"
!insertmacro MULTIUSER_INIT_QUIT "${UNINSTALLER_FUNCPREFIX}"
${endif}
${endif}
@ -445,7 +442,7 @@ Mode selection page
!endif
${if} $MultiUser.Privileges != "Power"
${andif} $MultiUser.Privileges != "Admin"
${andif} $MultiUser.Privileges != "Admin"
Abort
${endif}

View file

@ -109,7 +109,7 @@
<p>
Insert the MULTIUSER_INIT and MULTIUSER_UNINT macros in the .onInit and un.onInit
function to verify these privileges. If no uninstaller is created in the script,
set MULTIUSER_NOUNINSTALL.</p>
define MULTIUSER_NOUNINSTALL.</p>
<code>
<pre>!define MULTIUSER_EXECUTIONLEVEL Highest
;!define MULTIUSER_NOUNINSTALL ;Uncomment if no uninstaller is created
@ -214,7 +214,7 @@ FunctionEnd</pre>
if Administrator or Power User rights are available (this is always the case if
the execution level is set to Admin or Power, if Highest is set it depends on the
user account). For the Standard execution level the installation will always be
for a single user. On Windows 95/98/Me installation for a single user is not possible.</p>
for a single user. On Windows 95/98/Me installation for a single user is not possible, a per-machine installation will be performed.</p>
<p>
The following settings are available to change the default installation mode:
<table>