Skip to content

Commit

Permalink
Changes that require changing the code:
Browse files Browse the repository at this point in the history
1. !insertmacro MULTIUSER_UNPAGE_INSTALLMODE as the first page in the uninstaller (needed for MUI_PAGE_CUSTOMFUNCTION_PRE/MUI_PAGE_CUSTOMFUNCTION_SHOW/MUI_PAGE_CUSTOMFUNCTION_LEAVE callbacks to work), compiler will throw error if you forget to
2. MULTIUSER_INSTALLMODE_ALLOW_ELEVATION and MULTIUSER_INSTALLMODE_DEFAULT_ALLUSERS now have possible values of 0/1 and default of 1 (100% compatible with current code if they were defined; if they were not defined, add !define MULTIUSER_INSTALLMODE_ALLOW_ELEVATION 0)

Changes/bugfixes that are 100% compatible:
1. If someone uninstalls a per-machine-installation by running directly uninstall.exe (not passing command-line parameters), it was not asking for elevation and therefore was not removing files
2. Hide Shield in installer when Back button on Install Options page is pressed and previous page is displayed
3. Preserve all users/current user selection when Back button on Install Options page is pressed and previous page (welcome/license) is displayed
4. Preserve installation directory value when goint back to Install Options page and mode doesn't change
5. Fixed wrong all users/current user selection when MULTIUSER_INSTALLMODE_ALLOW_ELEVATION is 0/undefined (per-machine was selected and inactive)
6. Allow for 64-bit installs via the new define MULTIUSER_INSTALLMODE_PROGRAMFILES (usage: !define MULTIUSER_INSTALLMODE_PROGRAMFILES "$PROGRAMFILES64")
7. Provided default values for most defines, now the only requred defines are PRODUCT_NAME, VERSION, PROGEXE, COMPANY_NAME; moved variable intialization inside a macro, so that now NsisMultiUser.nsh can be included at the top of the file before any defines
8. Moved MULTIUSER_INSTALLMODE_INSTALL_REGISTRY_KEY under "Microsoft\Windows\CurrentVersion\Uninstall\${MULTIUSER_INSTALLMODE_UNINSTALL_REGISTRY_KEY}" if not defined (to use a single registry key per installation)
9. New define MULTIUSER_INSTALLMODE_ALLOW_BOTH_INSTALLATIONS - whether user can install BOTH per-user and per-machine; this only affects the texts on the Install Options page, the actual uninstall of previous version has to be implemented by script
10. New MULTIUSER_INSTALLMODE_ALLOW_ELEVATION_IF_SILENT define
11. After elevation, on pressing Back button from the inner instance (installer/uninstaller), the outer instance is displayed again (new return code 666667)
12. Processed the 666666 return error code also in the uninstaller
13. Defined all error codes as constants, removed the hex notation (doesn't work with == operator and ${Switch})
14. Set error level in all cases of abnormal termination, also pass return code from inner instance. That is needed for silent installs, command-line processing, etc.
15. New $UninstallHideBackButton variable to hide the Back button on the first visible page of the uninstaller when necessary. Usage:
 Function un.PageComponentsPre
  ${if} $UninstallHideBackButton == 1
   GetDlgItem $0 $HWNDPARENT 3
   ShowWindow $0 ${SW_HIDE}
  ${endif}
 FunctionEnd
16. New $InstallHidePagesBeforeComponents to hide all pages before Components inside the installer when running as inner instance. Usage:
 Function PageWelcomeLicensePre
  ${if} $InstallHidePagesBeforeComponents == 1
   Abort
  ${endif}
 FunctionEnd
17. Extended the range of the MULTIUSER_INSTALLMODE_ALLOW_ELEVATION define:
 - proceseed also in the uninstaller
 - if set to 0 and elevation is required, (un)installer will set error code (and display error message if not silent)
18. Exit uninstaller if there's no installed version at all
19. More strict processing of /allusers and /currentuser parameters - if requested option is not available, exit with error code
20. Improved label texts on page, so that it's clear which version number is currently installed and which version number is going to be installed, new PerUserInstallationVersion and PerMachineInstallationVersion variables
21. Support for silent installs/uninstalls (/S switch) - moved all non-dialog logic in MultiUser.InitChecks function. Usage:
 - provide the /S parameter (case sensitive!)
 - provide one of the /currentuser /allusers parameter
 - optionally provide the /D (case-sensitive!) parameter (/D=%PROGRAMFILES%\My Program), must be the last parameter
 - optionally MULTIUSER_INSTALLMODE_ALLOW_ELEVATION and MULTIUSER_INSTALLMODE_ALLOW_ELEVATION_IF_SILENT (both are 1 by default)
 - check the return code
22. Renamed callback function MULTIUSER_INSTALLMODE_FUNCTION/MULTIUSER_INSTALLMODE_UNFUNCTION to MULTIUSER_INSTALLMODE_CHANGE_MODE_FUNCTION/MULTIUSER_INSTALLMODE_CHANGE_MODE_UNFUNCTION - called when per-user/per-machine mode changes (old functions still called)
23. Added support for /? parameter
24. Code refactoring:
 - removed ${MUI_UNIQUEID} constant (install/uninstall pages cannot be included more than once, added checks for that)
 - removed MULTIUSER_${MUI_PAGE_UNINSTALLER_PREFIX}INSTALLMODEPAGE define, used MULTIUSER_PAGE_INSTALLMODE and MULTIUSER_UNPAGE_INSTALLMODE
 - removed macro MULTIUSER_INIT_QUIT - not used
 - removed macro MULTIUSER_INIT_TEXTS - not used
 - simplified the MULTIUSER_FUNCTION_INSTALLMODEPAGE macro (now has 2 parameters instead of 4) and the functions inside it
 - renamed the function InstModeChange to InstallModeOptionClick
 - simplified the InstallModeOptionClick function - no custom data getting/setting needed
 - replaced all ShowWindow $HWNDPARENT ${SW_HIDE} calls with HideWindow
 - removed the MB_SETFOREGROUND from MessageBox-es (not good for multi-tasking), added /SD parameter for silent mode
  • Loading branch information
alexmitev81 committed Feb 10, 2017
1 parent 9701ecf commit f379e4b
Showing 1 changed file with 783 additions and 471 deletions.
Loading

0 comments on commit f379e4b

Please sign in to comment.