From 0b8811f2370073ff0b59b8dbbb525c874849d10b Mon Sep 17 00:00:00 2001 From: joostverburg Date: Wed, 2 Jan 2008 01:48:34 +0000 Subject: [PATCH] Multi-User Header File: Installer configuration for multi-user Windows environments git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5471 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/Language files/English.nsh | 8 + Contrib/MultiUser/MultiUser.nsh | 406 +++++++++++++++++++++++++++++ Contrib/MultiUser/Readme.html | 374 ++++++++++++++++++++++++++ Contrib/MultiUser/SConscript | 14 + 4 files changed, 802 insertions(+) create mode 100644 Contrib/MultiUser/MultiUser.nsh create mode 100644 Contrib/MultiUser/Readme.html create mode 100644 Contrib/MultiUser/SConscript diff --git a/Contrib/Language files/English.nsh b/Contrib/Language files/English.nsh index 36285a1a..6fcc69fa 100644 --- a/Contrib/Language files/English.nsh +++ b/Contrib/Language files/English.nsh @@ -119,3 +119,11 @@ !ifdef MUI_UNABORTWARNING ${LangFileString} MUI_UNTEXT_ABORTWARNING "Are you sure you want to quit $(^Name) Uninstall?" !endif + +!ifdef MULTIUSER_INSTALLMODEPAGE + ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE "Choose Users" + ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE "Choose for which users you want to install $(^NameDA)." + ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP "Select whether you want to install $(^NameDA) for yourself only or for all users of this computer. $(^ClickNext)" + ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS "Install for anyone using this computer" + ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER "Install just for me" +!endif diff --git a/Contrib/MultiUser/MultiUser.nsh b/Contrib/MultiUser/MultiUser.nsh new file mode 100644 index 00000000..d6a9ecb7 --- /dev/null +++ b/Contrib/MultiUser/MultiUser.nsh @@ -0,0 +1,406 @@ +/* + +MultiUser.nsh + +Installer configuration for multi-user Windows environments + +Copyright © 2008 Joost Verburg + +*/ + +!ifndef MULTIUSER_INCLUDED +!define MULTIUSER_INCLUDED +!verbose push +!verbose 3 + +!ifdef MULTIUSER_MUI + !include MUI2.nsh +!endif +!include nsDialogs.nsh +!include LogicLib.nsh +!include WinVer.nsh +!include FileFunc.nsh + +Var MultiUser.Privileges +Var MultiUser.InstallMode + +!ifdef MULTIUSER_INSTALLMODE_COMMANDLINE + !insertmacro GetParameters + !ifndef MULTIUSER_NOUNINSTALLER + !insertmacro un.GetParameters + !endif + !include StrFunc.nsh + ${StrStr} + !ifndef MULTIUSER_NOUNINSTALLER + ${UnStrStr} + !endif + + Var MultiUser.Parameters + Var MultiUser.Result +!endif + +!ifdef MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY & MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME + Var MultiUser.InstDir +!endif + +!if "${MULTIUSER_EXECUTIONLEVEL}" == Admin + RequestExecutionLevel admin + !define MULTIUSER_EXECUTIONLEVEL_ALLUSERS +!else if "${MULTIUSER_EXECUTIONLEVEL}" == Power + RequestExecutionLevel admin + !define MULTIUSER_EXECUTIONLEVEL_ALLUSERS +!else if "${MULTIUSER_EXECUTIONLEVEL}" == Highest + RequestExecutionLevel highest + !define MULTIUSER_EXECUTIONLEVEL_ALLUSERS +!else + RequestExecutionLevel user +!endif + +/* + +Install modes + +*/ + +!macro MULTIUSER_INSTALLMODE_ALLUSERS UNINSTALLER_PREFIX UNINSTALLER_FUNCPREFIX + + ${ifnot} ${IsNT} + ${orif} $MultiUser.Privileges == "Admin" + ${orif} $MultiUser.Privileges == "Power" + + StrCpy $MultiUser.InstallMode AllUsers + + SetShellVarContext all + + !ifdef MULTIUSER_INSTALLMODE_INSTDIR + StrCpy $INSTDIR "$PROGRAMFILES\${MULTIUSER_INSTALLMODE_INSTDIR}" + !endif + + !ifdef MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY & MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME + + ReadRegStr $MultiUser.InstDir SHELL_CONTEXT "${MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY}" "${MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME}" + + ${if} $MultiUser.InstDir != "" + StrCpy $INSTDIR $MultiUser.InstDir + ${endif} + + !endif + + !ifdef MULTIUSER_INSTALLMODE_FUNCTION + Call "${MULTIUSER_INSTALLMODE_${UNINSTALLER_PREFIX}FUNCTION}" + !endif + + ${endif} + +!macroend + +!macro MULTIUSER_INSTALLMODE_CURRENTUSER UNINSTALLER_PREFIX UNINSTALLER_FUNCPREFIX + + ${if} ${IsNT} + + StrCpy $MultiUser.InstallMode CurrentUser + + SetShellVarContext current + + !ifdef MULTIUSER_INSTALLMODE_INSTDIR + ${if} ${AtLeastWin2000} + StrCpy $INSTDIR "$LOCALAPPDATA\${MULTIUSER_INSTALLMODE_INSTDIR}" + ${else} + StrCpy $INSTDIR "$PROGRAMFILES\${MULTIUSER_INSTALLMODE_INSTDIR}" + ${endif} + !endif + + !ifdef MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY & MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME + + ReadRegStr $MultiUser.InstDir SHELL_CONTEXT "${MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY}" "${MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME}" + + ${if} $MultiUser.InstDir != "" + StrCpy $INSTDIR $MultiUser.InstDir + ${endif} + + !endif + + !ifdef MULTIUSER_INSTALLMODE_FUNCTION + Call "${MULTIUSER_INSTALLMODE_${UNINSTALLER_PREFIX}FUNCTION}" + !endif + + ${endif} + +!macroend + +Function MultiUser.InstallMode.AllUsers + !insertmacro MULTIUSER_INSTALLMODE_ALLUSERS "" "" +FunctionEnd + +Function MultiUser.InstallMode.CurrentUser + !insertmacro MULTIUSER_INSTALLMODE_CURRENTUSER "" "" +FunctionEnd + +!ifndef MULTIUSER_NOUNINSTALL + +Function un.MultiUser.InstallMode.AllUsers + !insertmacro MULTIUSER_INSTALLMODE_ALLUSERS UN .un +FunctionEnd + +Function un.MultiUser.InstallMode.CurrentUser + !insertmacro MULTIUSER_INSTALLMODE_CURRENTUSER UN .un +FunctionEnd + +!endif + +/* + +Installer/uninstaller initialization + +*/ + +!macro MULTIUSER_INIT_QUIT + + !ifdef MULTIUSER_INIT_${UNINSTALLER_FUNCPREFIX}FUNCTIONQUIT + Call "${MULTIUSER_INIT_${UNINSTALLER_FUNCPREFIX}FUCTIONQUIT} + !else + Quit + !endif + +!macroend + +!macro MULTIUSER_INIT_TEXTS + + !ifndef MULTIUSER_INIT_TEXT_ADMINREQUIRED + !define MULTIUSER_INIT_TEXT_ADMINREQUIRED "$(^Caption) requires administrator priviledges." + !endif + + !ifndef MULTIUSER_INIT_TEXT_POWERREQUIRED + !define MULTIUSER_INIT_TEXT_POWERREQUIRED "$(^Caption) requires at least Power User priviledges." + !endif + + !ifndef MULTIUSER_INIT_TEXT_ALLUSERSNOTPOSSIBLE + !define MULTIUSER_INIT_TEXT_ALLUSERSNOTPOSSIBLE "Your user account does not have sufficient privileges to install $(^Name) for all users of this compuetr." + !endif + +!macroend + +!macro MULTIUSER_INIT_CHECKS UNINSTALLER_PREFIX UNINSTALLER_FUNCPREFIX + + !insertmacro MULTIUSER_INIT_TEXTS + + UserInfo::GetAccountType + Pop $MultiUser.Privileges + + ${if} ${IsNT} + + !if "${MULTIUSER_EXECUTIONLEVEL}" == Admin + + ${if} $MultiUser.Privileges != "Admin" + MessageBox MB_OK|MB_ICONSTOP "${MULTIUSER_INIT_TEXT_ADMINREQUIRED}" + !insertmacro MULTIUSER_INIT_QUIT ${UNINSTALLER_FUNCPREFIX} + ${endif} + + !else if "${MULTIUSER_EXECUTIONLEVEL}" == Power + + ${if} $MultiUser.Privileges != "Power" + ${andif} $MultiUser.Privileges != "Admin" + ${if} ${AtMostWinXP} + MessageBox MB_OK|MB_ICONSTOP "${MULTIUSER_INIT_TEXT_POWERREQUIRED}" + ${else} + MessageBox MB_OK|MB_ICONSTOP "${MULTIUSER_INIT_TEXT_ADMINREQUIRED}" + ${endif} + !insertmacro MULTIUSER_INIT_QUIT ${UNINSTALLER_FUNCPREFIX} + ${endif} + + !endif + + !ifdef MULTIUSER_EXECUTIONLEVEL_ALLUSERS + + ${if} $MultiUser.Privileges == "Admin" + ${orif} $MultiUser.Privileges == "Power" + !ifndef MULTIUSER_INSTALLMODE_DEFAULT_CURRENTUSER + Call ${UNINSTALLER_FUNCPREFIX}MultiUser.InstallMode.AllUsers + !else + Call ${UNINSTALLER_FUNCPREFIX}MultiUser.InstallMode.CurrentUser + !endif + ${else} + Call ${UNINSTALLER_FUNCPREFIX}MultiUser.InstallMode.CurrentUser + ${endif} + + !else + + Call ${UNINSTALLER_FUNCPREFIX}MultiUser.InstallMode.CurrentUser + + !endif + + !ifdef MULTIUSER_INSTALLMODE_COMMANDLINE + + ${${UNINSTALLER_FUNCPREFIX}GetParameters} $MultiUser.Parameters + + ${${UNINSTALLER_PREFIX}StrStr} $MultiUser.Result $MultiUser.Parameters "/CurrentUser" + + ${if} $MultiUser.Result != "" + Call ${UNINSTALLER_FUNCPREFIX}MultiUser.InstallMode.CurrentUser + ${endif} + + ${${UNINSTALLER_PREFIX}StrStr} $MultiUser.Result $MultiUser.Parameters "/AllUsers" + + ${if} $MultiUser.Result != "" + ${if} $MultiUser.Privileges == "Admin" + ${orif} $MultiUser.Privileges == "Power" + Call ${UNINSTALLER_FUNCPREFIX}MultiUser.InstallMode.AllUsers + ${else} + MessageBox MB_OK|MB_ICONSTOP "${MULTIUSER_INIT_TEXT_ALLUSERSNOTPOSSIBLE}" + ${endif} + ${endif} + + !endif + + ${else} + + Call ${UNINSTALLER_FUNCPREFIX}MultiUser.InstallMode.AllUsers + + ${endif} + +!macroend + +!macro MULTIUSER_INIT + !verbose push + !verbose 3 + + !insertmacro MULTIUSER_INIT_CHECKS "" "" + + !verbose pop +!macroend + +!ifndef MULTIUSER_NOUNINSTALL + +!macro MULTIUSER_UNINIT + !verbose push + !verbose 3 + + !insertmacro MULTIUSER_INIT_CHECKS Un un. + + !verbose pop +!macroend + +!endif + +/* + +Modern UI 2 page + +*/ + +!ifdef MULTIUSER_MUI + +!macro MULTIUSER_INSTALLMODEPAGE_INTERFACE + + !ifndef MULTIUSER_INSTALLMODEPAGE_INTERFACE + !define MULTIUSER_INSTALLMODEPAGE_INTERFACE + Var MultiUser.InstallModePage + + Var MultiUser.InstallModePage.Text + + Var MultiUser.InstallModePage.AllUsers + Var MultiUser.InstallModePage.CurrentUser + + Var MultiUser.InstallModePage.ReturnValue + !endif + +!macroend + +!macro MULTIUSER_PAGEDECLARATION_INSTALLMODE + + !insertmacro MUI_SET MULTIUSER_${MUI_PAGE_UNINSTALLER_PREFIX}INSTALLMODEPAGE "" + !insertmacro MULTIUSER_INSTALLMODEPAGE_INTERFACE + + !insertmacro MUI_DEFAULT MULTIUSER_INSTALLMODEPAGE_TEXT_TOP "$(MULTIUSER_INNERTEXT_INSTALLMODE_TOP)" + !insertmacro MUI_DEFAULT MULTIUSER_INSTALLMODEPAGE_TEXT_ALLUSERS "$(MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS)" + !insertmacro MUI_DEFAULT MULTIUSER_INSTALLMODEPAGE_TEXT_CURRENTUSER "$(MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER)" + + PageEx custom + + PageCallbacks MultiUser.InstallModePre_${MUI_UNIQUEID} MultiUser.InstallModeLeave_${MUI_UNIQUEID} + + Caption " " + + PageExEnd + + !insertmacro MULTIUSER_FUNCTION_INSTALLMODEPAGE MultiUser.InstallModePre_${MUI_UNIQUEID} MultiUser.InstallModeLeave_${MUI_UNIQUEID} + + !undef MULTIUSER_INSTALLMODEPAGE_TEXT_TOP + !undef MULTIUSER_INSTALLMODEPAGE_TEXT_ALLUSERS + !undef MULTIUSER_INSTALLMODEPAGE_TEXT_CURRENTUSER + +!macroend + +!macro MULTIUSER_PAGE_INSTALLMODE + + !verbose push + !verbose 3 + + !ifndef MULTIUSER_EXECUTIONLEVEL_ALLUSERS + !error "A mixed-mode installation requires MULTIUSER_EXECUTIONLEVEL to be set to Admin, Power or Highest." + !endif + + !insertmacro MUI_PAGE_INIT + !insertmacro MULTIUSER_PAGEDECLARATION_INSTALLMODE + + !verbose pop + +!macroend + +!macro MULTIUSER_FUNCTION_INSTALLMODEPAGE PRE LEAVE + + Function "${PRE}" + + ${ifnot} ${IsNT} + Abort + ${endif} + + ${if} $MultiUser.Privileges != "Power" + ${andif} $MultiUser.Privileges != "Admin" + Abort + ${endif} + + !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE + !insertmacro MUI_HEADER_TEXT_PAGE $(MULTIUSER_TEXT_INSTALLMODE_TITLE) $(MULTIUSER_TEXT_INSTALLMODE_SUBTITLE) + + nsDialogs::Create /NOUNLOAD 1018 + Pop $MultiUser.InstallModePage + + ${NSD_CreateLabel} 0u 0u 300u 20u "${MULTIUSER_INSTALLMODEPAGE_TEXT_TOP}" + Pop $MultiUser.InstallModePage.Text + + ${NSD_CreateRadioButton} 20u 50u 280u 10u "${MULTIUSER_INSTALLMODEPAGE_TEXT_ALLUSERS}" + Pop $MultiUser.InstallModePage.AllUsers + + ${NSD_CreateRadioButton} 20u 70u 280u 10u "${MULTIUSER_INSTALLMODEPAGE_TEXT_CURRENTUSER}" + Pop $MultiUser.InstallModePage.CurrentUser + + ${if} $MultiUser.InstallMode == "AllUsers" + SendMessage $MultiUser.InstallModePage.AllUsers ${BM_SETCHECK} ${BST_CHECKED} 0 + ${else} + SendMessage $MultiUser.InstallModePage.CurrentUser ${BM_SETCHECK} ${BST_CHECKED} 0 + ${endif} + + !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW + nsDialogs::Show + + FunctionEnd + + Function "${LEAVE}" + SendMessage $MultiUser.InstallModePage.AllUsers ${BM_GETCHECK} 0 0 $MultiUser.InstallModePage.ReturnValue + + ${if} $MultiUser.InstallModePage.ReturnValue = ${BST_CHECKED} + Call MultiUser.InstallMode.AllUsers + ${else} + Call MultiUser.InstallMode.CurrentUser + ${endif} + + !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE + FunctionEnd + +!macroend + +!endif + +!verbose pop +!endif diff --git a/Contrib/MultiUser/Readme.html b/Contrib/MultiUser/Readme.html new file mode 100644 index 00000000..16410740 --- /dev/null +++ b/Contrib/MultiUser/Readme.html @@ -0,0 +1,374 @@ + + + + Multi-User Header File (MultiUser.nsh) + + + + +

+ Multi-User Header File (MultiUser.nsh)

+

+ Installer configuration for multi-user Windows environments

+

+ Table of Contents

+ +

+ Introduction

+

+ Modern Windows versions support multiple users accounts on a single computer, each + with different privileges. For security reasons, the privileges of applications + can also be limited. For an installer, the execution level and installation + mode are important. The execution level determines the privileges of the + installer application. For example, to install hardware drivers, administrator privileges + are required. Applications can also be installed for a single user or for all users + on a computer, which is determined by the installation mode. Installation for all + users requires a higher execution level as compared with a single user setup. The + MultiUser.nsh header files provides the features to automatically handle all these + aspects related to user accounts and installer privileges.

+

+ Note that all settings need to be set before including the MultiUser.nsh header + file.

+

+ Initialization and Execution Level 

+

+ Before the MultiUser.nsh file is included, the MULTIUSER_EXECUTIONLEVEL define should + be set to one of the following values depending on the execution level that is required:

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Value + + Description + + Typical application +
+ Admin + + Administrator privileges are required + + Installation of drivers, hardware management +
+ Power + + Power User privileges are required
+ (Power Users no longer exist in Windows Vista. For Vista this is equivalent to Admin) +
+ Installation for all users (writing to "Program Files" or HKLM registry + keys) +
+ Highest + + Request the highest possible execution level for the current user + + Mixed-mode installer that can both be installed per-machine or per-user +
+ Standard + + No special rights required + + Installation for current user only +
+

+ 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.

+
+
!define MULTIUSER_EXECUTIONLEVEL Highest
+;!define MULTIUSER_NOUNINSTALL ;Uncomment if no uninstaller is created
+!include MultiUser.nsh
+
+...
+
+Function .onInit
+  !insertmacro MULTIUSER_INIT
+FunctionEnd
+
+Function un.onInit
+  !insertmacro MULTIUSER_UNINIT
+Function
+
+

+ Whether the required privileges can be obtained depends on the user that starts + the installer:

+ +

+ It is recommended to insert these initialization macros before macros that require + user intervention. For example, it does not make sense to ask a user for an installer + language if the installer will quit afterwards because the user account does not + have the required privileges. After the macros are inserted, the variable $MultiUser.Privileges + will contain the current execution level (Admin, Power, User or Guest).

+

+ The following additonal settings are available to customize the initialization:

+ + + + + + + + + + + + + + + + + + + + +
+ Setting + Description +
+ MULTIUSER_INIT_TEXT_ADMINREQUIRED + + Error message to be displayed when administrator rights are required but not available. +
+ MULTIUSER_INIT_TEXT_POWERREQUIRED + + Error message to be displayed when Power User rights are required but not available. +
+ MULTIUSER_INIT_TEXT_ALLUSERSNOTPOSSIBLE + + Error message to be displayed when administrator or Power User rights are required + because of an installation mode setting on the command line (see below) but are + not available. +
+ MULTIUSER_INIT_FUNCTIONQUIT
+ MULTIUSER_INIT_UNFUNCTIONQUIT +
+ A custom fuction to be called when the installer is closed due to insufficient privileges. +
+

+ Installation Mode

+

+ As mentioned before, applications can both be installed for a single users or for + all users on a computer. Applications for all users are typically installed in the + Program Files folder and appear in the Start Menu of every user. On the contrary, + applications for a single user are usually installed in the local Application Data + folder and only a appear in the Start Menu of the user who installed the application.

+

+ By default, MultiUser.nsh will set the installation mode for a per-machine installation + 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. If you prefer the default to be a per-user installation even + though the rights for a per-machine installation are available, define MULTIUSER_INSTALLMODE_DEFAULT_CURRENTUSER + before including User.nsh. On Windows 95/98/Me installation for a single user is + not possible.

+

+ After initialization, the variable $MultiUser.InstallMode will contain the current installation + mode (AllUsers or CurrentUser). +

+

+ Mixed-Mode Installation

+

+ For the Admin and Power levels, both a per-machine as well as a per-user installation + is possible. If the Highest level is set and the user is an Administrator or Power + User, both options are also available.

+

+ Usually it's a good thing to give the user to choice between these options. For + users of the Modern UI version 2, a page is provided that asks the user for the + installation mode. To use this page, define MULTIUSER_MUI before including User.nsh. + Then, the MULTIUSER_PAGE_INSTALLMODE macro can be used just like a normal Modern + UI page (this page will automatically be skipped when running Windows 95/98/Me):

+
!define MULTIUSER_EXECUTIONLEVEL Highes
+!define MULTIUSER_MUI
+!define MULTIUSER_INSTALLMODE_COMMANDLINE
+!include MultiUser.nsh
+!include MUI2.nsh
+
+!insertmacro MULTIUSER_PAGE_INSTALLMODE
+!insertmacro MUI_PAGE_DIRECTORY
+!insertmacro MUI_PAGE_INSTFILES 
+
+!insertmacro MUI_LANGUAGE English
+
+...
+
+Function .onInit
+  !insertmacro MULTIUSER_INIT
+FunctionEnd
+
+Function un.onInit
+  !insertmacro MULTIUSER_UNINIT
+FFunction
+
+

+ The MULTIUSER_INSTALLMODE_COMMANDLINE setting that also appears in this example + enables the installation mode to be set using the /AllUsers or /CurrentUser command + line parameters. This is especially useful for silent setup.

+

+ The following settings can be used to customize the texts on the page (in addition + to the general Modern UI page settings):

+ + + + + + + + + + + + + + + + + +
+ Setting + + Description +
+ MULTIUSER_INSTALLMODEPAGE_TEXT_TOP + + Text to display on the top of the page. +
+ MULTIUSER_INSTALLMODEPAGE_TEXT_ALLUSERS + + Text to display on the combo button for a per-machine installation. +
+ MULTIUSER_INSTALLMODEPAGE_TEXT_CURRENTUSER + + Text to display on the combo button for a per-user installation. +
+

+ Installation Mode Initalization

+

+ The SetShellVarContext flag (which determines the folders for e.g. shortcuts, like + $DESKTOP) is automatically set depending on the installation mode. In addition, + the following settings can be used to perform additional actions when the installation + mode is initialized:

+ + + + + + + + + + + + + + + + + +
+ Setting + + Description +
+ MULTIUSER_INSTALLMODE_INSTDIR + + Name of the folder in which to install the application, without a path. This folder + will be located in Program Files for a per-machine installation and in the local + Application Data folder for a per-user installation (if supported). +
+ MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME + + Registry key from which to obtain a previously stored installation folder. It will + be retrieved from HKCU for per-user and HKLM for per-machine. +
+ MULTIUSER_INSTALLMODE_FUNCTION
+ MULTIUSER_INSTALLMODE_UNFUNCTION +
+ A custom fuction to be called during the initialization of the installation mode + to set additional installer settings that depend on the mode +
+

+ To set the installation mode manually, call one of these four functions:

+ + + + + + + + + + + + + + + + + + +
+ Function name + + Installation mode +
+ MultiUser.InstallMode.AllUsers + + Installer: Per-machine installation +
+ MultiUser.InstallMode.CurrentUser + + Installer: Per-user installation +
+ un.MultiUser.InstallMode.AllUsers + Uninstaller: Per-machine installation +
+ un.MultiUser.InstallMode.CurrentUser + Uninstaller: Per-user installation +
+ + diff --git a/Contrib/MultiUser/SConscript b/Contrib/MultiUser/SConscript new file mode 100644 index 00000000..a040a6fe --- /dev/null +++ b/Contrib/MultiUser/SConscript @@ -0,0 +1,14 @@ +target = 'MultiUser' + +docs = Split(""" + Readme.html +""") + +includes = Split(""" + MultiUser.nsh +""") + +Import('defenv') + +defenv.DistribeDocs(docs, path=target) +defenv.DistributeInclude(includes)