Clean up the nsis installer script a litte.
parent
d3b44d18fd
commit
ab4a359685
|
@ -34,7 +34,6 @@ RequestExecutionLevel user
|
||||||
Var TmpVal
|
Var TmpVal
|
||||||
Var InstallType
|
Var InstallType
|
||||||
Var AddStartMenuSC
|
Var AddStartMenuSC
|
||||||
Var AddTaskbarSC
|
|
||||||
Var AddQuickLaunchSC
|
Var AddQuickLaunchSC
|
||||||
Var AddDesktopSC
|
Var AddDesktopSC
|
||||||
Var InstallMaintenanceService
|
Var InstallMaintenanceService
|
||||||
|
@ -93,7 +92,6 @@ VIAddVersionKey "OriginalFilename" "setup.exe"
|
||||||
!insertmacro InitHashAppModelId
|
!insertmacro InitHashAppModelId
|
||||||
!insertmacro IsHandlerForInstallDir
|
!insertmacro IsHandlerForInstallDir
|
||||||
!insertmacro IsPinnedToTaskBar
|
!insertmacro IsPinnedToTaskBar
|
||||||
!insertmacro IsUserAdmin
|
|
||||||
!insertmacro LogDesktopShortcut
|
!insertmacro LogDesktopShortcut
|
||||||
!insertmacro LogQuickLaunchShortcut
|
!insertmacro LogQuickLaunchShortcut
|
||||||
!insertmacro LogStartMenuShortcut
|
!insertmacro LogStartMenuShortcut
|
||||||
|
@ -401,12 +399,10 @@ Section "-Application" APP_IDX
|
||||||
|
|
||||||
; If we are writing to HKLM and create either the desktop or start menu
|
; If we are writing to HKLM and create either the desktop or start menu
|
||||||
; shortcuts set IconsVisible to 1 otherwise to 0.
|
; shortcuts set IconsVisible to 1 otherwise to 0.
|
||||||
; Taskbar shortcuts imply having a start menu shortcut.
|
|
||||||
${StrFilter} "${FileMainEXE}" "+" "" "" $R9
|
${StrFilter} "${FileMainEXE}" "+" "" "" $R9
|
||||||
StrCpy $0 "Software\Clients\StartMenuInternet\$R9\InstallInfo"
|
StrCpy $0 "Software\Clients\StartMenuInternet\$R9\InstallInfo"
|
||||||
${If} $AddDesktopSC == 1
|
${If} $AddDesktopSC == 1
|
||||||
${OrIf} $AddStartMenuSC == 1
|
${OrIf} $AddStartMenuSC == 1
|
||||||
${OrIf} $AddTaskbarSC == 1
|
|
||||||
WriteRegDWORD HKLM "$0" "IconsVisible" 1
|
WriteRegDWORD HKLM "$0" "IconsVisible" 1
|
||||||
${Else}
|
${Else}
|
||||||
WriteRegDWORD HKLM "$0" "IconsVisible" 0
|
WriteRegDWORD HKLM "$0" "IconsVisible" 0
|
||||||
|
@ -420,12 +416,10 @@ Section "-Application" APP_IDX
|
||||||
|
|
||||||
; If we create either the desktop or start menu shortcuts, then
|
; If we create either the desktop or start menu shortcuts, then
|
||||||
; set IconsVisible to 1 otherwise to 0.
|
; set IconsVisible to 1 otherwise to 0.
|
||||||
; Taskbar shortcuts imply having a start menu shortcut.
|
|
||||||
${StrFilter} "${FileMainEXE}" "+" "" "" $R9
|
${StrFilter} "${FileMainEXE}" "+" "" "" $R9
|
||||||
StrCpy $0 "Software\Clients\StartMenuInternet\$R9\InstallInfo"
|
StrCpy $0 "Software\Clients\StartMenuInternet\$R9\InstallInfo"
|
||||||
${If} $AddDesktopSC == 1
|
${If} $AddDesktopSC == 1
|
||||||
${OrIf} $AddStartMenuSC == 1
|
${OrIf} $AddStartMenuSC == 1
|
||||||
${OrIf} $AddTaskbarSC == 1
|
|
||||||
WriteRegDWORD HKCU "$0" "IconsVisible" 1
|
WriteRegDWORD HKCU "$0" "IconsVisible" 1
|
||||||
${Else}
|
${Else}
|
||||||
WriteRegDWORD HKCU "$0" "IconsVisible" 0
|
WriteRegDWORD HKCU "$0" "IconsVisible" 0
|
||||||
|
|
|
@ -842,24 +842,17 @@
|
||||||
ClearErrors
|
ClearErrors
|
||||||
WriteIniStr "$0" "TASKBAR" "Migrated" "true"
|
WriteIniStr "$0" "TASKBAR" "Migrated" "true"
|
||||||
${If} ${AtLeastWin7}
|
${If} ${AtLeastWin7}
|
||||||
; If we didn't run the stub installer, AddTaskbarSC will be empty.
|
; No need to check the default on Win8 and later
|
||||||
; We determine whether to pin based on whether we're the default
|
${If} ${AtMostWin2008R2}
|
||||||
; browser, or if we're on win8 or later, we always pin.
|
; Check if the Pale Moon is the http handler for this user
|
||||||
${If} $AddTaskbarSC == ""
|
SetShellVarContext current ; Set SHCTX to the current user
|
||||||
; No need to check the default on Win8 and later
|
${IsHandlerForInstallDir} "http" $R9
|
||||||
${If} ${AtMostWin2008R2}
|
${If} $TmpVal == "HKLM"
|
||||||
; Check if the PaleMoon is the http handler for this user
|
SetShellVarContext all ; Set SHCTX to all users
|
||||||
SetShellVarContext current ; Set SHCTX to the current user
|
|
||||||
${IsHandlerForInstallDir} "http" $R9
|
|
||||||
${If} $TmpVal == "HKLM"
|
|
||||||
SetShellVarContext all ; Set SHCTX to all users
|
|
||||||
${EndIf}
|
|
||||||
${EndIf}
|
${EndIf}
|
||||||
${If} "$R9" == "true"
|
${EndIf}
|
||||||
${OrIf} ${AtLeastWin8}
|
${If} "$R9" == "true"
|
||||||
${PinToTaskBar}
|
${OrIf} ${AtLeastWin8}
|
||||||
${EndIf}
|
|
||||||
${ElseIf} $AddTaskbarSC == "1"
|
|
||||||
${PinToTaskBar}
|
${PinToTaskBar}
|
||||||
${EndIf}
|
${EndIf}
|
||||||
${EndIf}
|
${EndIf}
|
||||||
|
|
|
@ -76,7 +76,6 @@ VIAddVersionKey "OriginalFilename" "helper.exe"
|
||||||
!insertmacro InitHashAppModelId
|
!insertmacro InitHashAppModelId
|
||||||
!insertmacro IsHandlerForInstallDir
|
!insertmacro IsHandlerForInstallDir
|
||||||
!insertmacro IsPinnedToTaskBar
|
!insertmacro IsPinnedToTaskBar
|
||||||
!insertmacro IsUserAdmin
|
|
||||||
!insertmacro LogDesktopShortcut
|
!insertmacro LogDesktopShortcut
|
||||||
!insertmacro LogQuickLaunchShortcut
|
!insertmacro LogQuickLaunchShortcut
|
||||||
!insertmacro LogStartMenuShortcut
|
!insertmacro LogStartMenuShortcut
|
||||||
|
@ -167,56 +166,6 @@ UninstPage custom un.preConfirm
|
||||||
; Use the default dialog for IDD_VERIFY for a simple Banner
|
; Use the default dialog for IDD_VERIFY for a simple Banner
|
||||||
ChangeUI IDD_VERIFY "${NSISDIR}\Contrib\UIs\default.exe"
|
ChangeUI IDD_VERIFY "${NSISDIR}\Contrib\UIs\default.exe"
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# Helper Functions
|
|
||||||
|
|
||||||
; This function is used to uninstall the maintenance service if the
|
|
||||||
; application currently being uninstalled is the last application to use the
|
|
||||||
; maintenance service.
|
|
||||||
Function un.UninstallServiceIfNotUsed
|
|
||||||
; $0 will store if a subkey exists
|
|
||||||
; $1 will store the first subkey if it exists or an empty string if it doesn't
|
|
||||||
; Backup the old values
|
|
||||||
Push $0
|
|
||||||
Push $1
|
|
||||||
|
|
||||||
; The maintenance service always uses the 64-bit registry on x64 systems
|
|
||||||
${If} ${RunningX64}
|
|
||||||
SetRegView 64
|
|
||||||
${EndIf}
|
|
||||||
|
|
||||||
; Figure out the number of subkeys
|
|
||||||
StrCpy $0 0
|
|
||||||
${Do}
|
|
||||||
EnumRegKey $1 HKLM "Software\Mozilla\MaintenanceService" $0
|
|
||||||
${If} "$1" == ""
|
|
||||||
${ExitDo}
|
|
||||||
${EndIf}
|
|
||||||
IntOp $0 $0 + 1
|
|
||||||
${Loop}
|
|
||||||
|
|
||||||
; Restore back the registry view
|
|
||||||
${If} ${RunningX64}
|
|
||||||
SetRegView lastUsed
|
|
||||||
${EndIf}
|
|
||||||
${If} $0 == 0
|
|
||||||
; Get the path of the maintenance service uninstaller
|
|
||||||
ReadRegStr $1 HKLM ${MaintUninstallKey} "UninstallString"
|
|
||||||
|
|
||||||
; If the uninstall string does not exist, skip executing it
|
|
||||||
StrCmp $1 "" doneUninstall
|
|
||||||
|
|
||||||
; $1 is already a quoted string pointing to the install path
|
|
||||||
; so we're already protected against paths with spaces
|
|
||||||
nsExec::Exec "$1 /S"
|
|
||||||
doneUninstall:
|
|
||||||
${EndIf}
|
|
||||||
|
|
||||||
; Restore the old value of $1 and $0
|
|
||||||
Pop $1
|
|
||||||
Pop $0
|
|
||||||
FunctionEnd
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Install Sections
|
# Install Sections
|
||||||
; Empty section required for the installer to compile as an uninstaller
|
; Empty section required for the installer to compile as an uninstaller
|
||||||
|
|
Loading…
Reference in New Issue