Skip to content
Snippets Groups Projects
Commit cfbe33d7 authored by Nat Goodspeed's avatar Nat Goodspeed
Browse files

SL-10396: Disable per-user installs: require Admin for all-users.

parent aabca008
No related branches found
No related tags found
No related merge requests found
...@@ -32,7 +32,7 @@ SetCompress auto # Compress if saves space ...@@ -32,7 +32,7 @@ SetCompress auto # Compress if saves space
SetCompressor /solid lzma # Compress whole installer as one block SetCompressor /solid lzma # Compress whole installer as one block
SetDatablockOptimize off # Only saves us 0.1%, not worth it SetDatablockOptimize off # Only saves us 0.1%, not worth it
XPStyle on # Add an XP manifest to the installer XPStyle on # Add an XP manifest to the installer
RequestExecutionLevel highest # match MULTIUSER_EXECUTIONLEVEL RequestExecutionLevel admin # For when we write to Program Files
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Project flags ;; Project flags
...@@ -106,11 +106,12 @@ AutoCloseWindow true # After all files install, close window ...@@ -106,11 +106,12 @@ AutoCloseWindow true # After all files install, close window
!define MSUNINSTALL_KEY "${MSCURRVER_KEY}\Uninstall\${INSTNAME}" !define MSUNINSTALL_KEY "${MSCURRVER_KEY}\Uninstall\${INSTNAME}"
# from http://nsis.sourceforge.net/Docs/MultiUser/Readme.html # from http://nsis.sourceforge.net/Docs/MultiUser/Readme.html
# Highest level permitted for user: Admin for Admin, Standard for Standard ### Highest level permitted for user: Admin for Admin, Standard for Standard
!define MULTIUSER_EXECUTIONLEVEL Highest ##!define MULTIUSER_EXECUTIONLEVEL Highest
!define MULTIUSER_EXECUTIONLEVEL Admin
!define MULTIUSER_MUI !define MULTIUSER_MUI
# Look for /AllUsers or /CurrentUser switches ### Look for /AllUsers or /CurrentUser switches
!define MULTIUSER_INSTALLMODE_COMMANDLINE ##!define MULTIUSER_INSTALLMODE_COMMANDLINE
# appended to $PROGRAMFILES, as affected by MULTIUSER_USE_PROGRAMFILES64 # appended to $PROGRAMFILES, as affected by MULTIUSER_USE_PROGRAMFILES64
!define MULTIUSER_INSTALLMODE_INSTDIR "${INSTNAME}" !define MULTIUSER_INSTALLMODE_INSTDIR "${INSTNAME}"
# expands to !define MULTIUSER_USE_PROGRAMFILES64 or nothing # expands to !define MULTIUSER_USE_PROGRAMFILES64 or nothing
...@@ -131,7 +132,7 @@ AutoCloseWindow true # After all files install, close window ...@@ -131,7 +132,7 @@ AutoCloseWindow true # After all files install, close window
UninstallText $(UninstallTextMsg) UninstallText $(UninstallTextMsg)
DirText $(DirectoryChooseTitle) $(DirectoryChooseSetup) DirText $(DirectoryChooseTitle) $(DirectoryChooseSetup)
!insertmacro MULTIUSER_PAGE_INSTALLMODE ##!insertmacro MULTIUSER_PAGE_INSTALLMODE
!define MUI_PAGE_CUSTOMFUNCTION_PRE dirPre !define MUI_PAGE_CUSTOMFUNCTION_PRE dirPre
!insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_INSTFILES
...@@ -326,6 +327,7 @@ StrCpy $INSTEXE "${INSTEXE}" ...@@ -326,6 +327,7 @@ StrCpy $INSTEXE "${INSTEXE}"
StrCpy $VIEWER_EXE "${VIEWER_EXE}" StrCpy $VIEWER_EXE "${VIEWER_EXE}"
StrCpy $INSTSHORTCUT "${SHORTCUT}" StrCpy $INSTSHORTCUT "${SHORTCUT}"
Call CheckIfAdministrator # Make sure the user can install/uninstall
Call CloseSecondLife # Make sure Second Life not currently running Call CloseSecondLife # Make sure Second Life not currently running
Call CheckWillUninstallV2 # Check if Second Life is already installed Call CheckWillUninstallV2 # Check if Second Life is already installed
...@@ -433,7 +435,7 @@ StrCpy $INSTSHORTCUT "${SHORTCUT}" ...@@ -433,7 +435,7 @@ StrCpy $INSTSHORTCUT "${SHORTCUT}"
# SetShellVarContext per the mode saved at install time in registry at # SetShellVarContext per the mode saved at install time in registry at
# MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY # MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY
# MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME # MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME
# Couln't get NSIS to expand $MultiUser.InstallMode into the function name at Call time # Couldn't get NSIS to expand $MultiUser.InstallMode into the function name at Call time
${If} $MultiUser.InstallMode == 'AllUsers' ${If} $MultiUser.InstallMode == 'AllUsers'
##MessageBox MB_OK "Uninstalling for all users" ##MessageBox MB_OK "Uninstalling for all users"
Call un.MultiUser.InstallMode.AllUsers Call un.MultiUser.InstallMode.AllUsers
...@@ -469,6 +471,36 @@ Call un.UserSettingsFiles ...@@ -469,6 +471,36 @@ Call un.UserSettingsFiles
SectionEnd SectionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Make sure the user can install
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function CheckIfAdministrator
DetailPrint $(CheckAdministratorInstDP)
UserInfo::GetAccountType
Pop $R0
StrCmp $R0 "Admin" lbl_is_admin
MessageBox MB_OK $(CheckAdministratorInstMB)
Quit
lbl_is_admin:
Return
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Make sure the user can uninstall
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function un.CheckIfAdministrator
DetailPrint $(CheckAdministratorUnInstDP)
UserInfo::GetAccountType
Pop $R0
StrCmp $R0 "Admin" lbl_is_admin
MessageBox MB_OK $(CheckAdministratorUnInstMB)
Quit
lbl_is_admin:
Return
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Function CheckWillUninstallV2 ;; Function CheckWillUninstallV2
;; ;;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment