mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-19 23:07:33 +09:00
Issue #303 Part 1: Move basilisk files from /browser to /application/basilisk
This commit is contained in:
parent
a951f19dfd
commit
177b28a898
1938 changed files with 0 additions and 0 deletions
96
application/basilisk/installer/windows/nsis/defines.nsi.in
Normal file
96
application/basilisk/installer/windows/nsis/defines.nsi.in
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
#filter substitution
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
# Defining FunnelcakeVersion will append the value of StubURLVersionAppend to
|
||||
# StubURLVersion, append the value of URLManualDownloadAppend to
|
||||
# URLManualDownload, and append the value of URLStubDownloadAppend to
|
||||
# URLStubDownload. The value of FunnelcakeVersion should not be defined when it
|
||||
# is not used and when it is defined its value should never be empty.
|
||||
# !define FunnelcakeVersion "999"
|
||||
|
||||
!ifdef FunnelcakeVersion
|
||||
!define URLManualDownloadAppend "&f=${FunnelcakeVersion}"
|
||||
!define URLStubDownloadAppend "-f${FunnelcakeVersion}"
|
||||
!define StubURLVersionAppend "-${FunnelcakeVersion}"
|
||||
!else
|
||||
!define URLManualDownloadAppend ""
|
||||
!define URLStubDownloadAppend ""
|
||||
!define StubURLVersionAppend ""
|
||||
!endif
|
||||
|
||||
# These defines should match application.ini settings
|
||||
!define AppName "Basilisk"
|
||||
!define AppVersion "@APP_VERSION@"
|
||||
!define GREVersion @MOZILLA_VERSION@
|
||||
!define AB_CD "@AB_CD@"
|
||||
|
||||
!define FileMainEXE "@MOZ_APP_NAME@.exe"
|
||||
!define WindowClass "BasiliskMessageWindow"
|
||||
!define DDEApplication "Basilisk"
|
||||
!define AppRegName "Basilisk"
|
||||
|
||||
!ifndef DEV_EDITION
|
||||
!define BrandShortName "@MOZ_APP_DISPLAYNAME@"
|
||||
!endif
|
||||
!define BrandFullName "${BrandFullNameInternal}"
|
||||
|
||||
!define CERTIFICATE_NAME "Mozilla Corporation"
|
||||
!define CERTIFICATE_ISSUER "DigiCert SHA2 Assured ID Code Signing CA"
|
||||
; Changing the name or issuer requires us to have both the old and the new
|
||||
; in the registry at the same time, temporarily.
|
||||
!define CERTIFICATE_NAME_PREVIOUS "Mozilla Corporation"
|
||||
!define CERTIFICATE_ISSUER_PREVIOUS "DigiCert Assured ID Code Signing CA-1"
|
||||
|
||||
# LSP_CATEGORIES is the permitted LSP categories for the application. Each LSP
|
||||
# category value is ANDed together to set multiple permitted categories.
|
||||
# See http://msdn.microsoft.com/en-us/library/ms742253%28VS.85%29.aspx
|
||||
# The value below removes all LSP categories previously set.
|
||||
!define LSP_CATEGORIES "0x00000000"
|
||||
|
||||
!if "@MOZ_UPDATE_CHANNEL@" == ""
|
||||
!define UpdateChannel "Unknown"
|
||||
!else
|
||||
!define UpdateChannel "@MOZ_UPDATE_CHANNEL@"
|
||||
!endif
|
||||
|
||||
# ARCH is used when it is necessary to differentiate the x64 registry keys from
|
||||
# the x86 registry keys (e.g. the uninstall registry key).
|
||||
#ifdef HAVE_64BIT_BUILD
|
||||
!define HAVE_64BIT_BUILD
|
||||
!define ARCH "x64"
|
||||
!define MinSupportedVer "Microsoft Windows 7 x64"
|
||||
#else
|
||||
!define ARCH "x86"
|
||||
!define MinSupportedVer "Microsoft Windows XP SP2"
|
||||
#endif
|
||||
|
||||
!define MinSupportedCPU "SSE2"
|
||||
|
||||
#ifdef MOZ_MAINTENANCE_SERVICE
|
||||
!define MOZ_MAINTENANCE_SERVICE
|
||||
#endif
|
||||
|
||||
# File details shared by both the installer and uninstaller
|
||||
VIProductVersion "1.0.0.0"
|
||||
VIAddVersionKey "ProductName" "${BrandShortName}"
|
||||
VIAddVersionKey "CompanyName" "${CompanyName}"
|
||||
#ifdef MOZ_OFFICIAL_BRANDING
|
||||
VIAddVersionKey "LegalTrademarks" "${BrandShortName} is a Trademark of Moonchild Productions."
|
||||
#endif
|
||||
VIAddVersionKey "LegalCopyright" "${CompanyName}"
|
||||
VIAddVersionKey "FileVersion" "${AppVersion}"
|
||||
VIAddVersionKey "ProductVersion" "${AppVersion}"
|
||||
# Comments is not used but left below commented out for future reference
|
||||
# VIAddVersionKey "Comments" "Comments"
|
||||
|
||||
# Control positions in Dialog Units so they are placed correctly with
|
||||
# non-default DPI settings
|
||||
!define OPTIONS_ITEM_EDGE_DU 90u
|
||||
!define OPTIONS_ITEM_WIDTH_DU 356u
|
||||
!define OPTIONS_SUBITEM_EDGE_DU 119u
|
||||
!define OPTIONS_SUBITEM_WIDTH_DU 327u
|
||||
!define INSTALL_BLURB_TOP_DU 78u
|
||||
!define APPNAME_BMP_EDGE_DU 19u
|
||||
!define APPNAME_BMP_TOP_DU 12u
|
||||
1332
application/basilisk/installer/windows/nsis/installer.nsi
Normal file
1332
application/basilisk/installer/windows/nsis/installer.nsi
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,335 @@
|
|||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
; Set verbosity to 3 (e.g. no script) to lessen the noise in the build logs
|
||||
!verbose 3
|
||||
|
||||
; 7-Zip provides better compression than the lzma from NSIS so we add the files
|
||||
; uncompressed and use 7-Zip to create a SFX archive of it
|
||||
SetDatablockOptimize on
|
||||
SetCompress off
|
||||
CRCCheck on
|
||||
|
||||
RequestExecutionLevel admin
|
||||
|
||||
; The commands inside this ifdef require NSIS 3.0a2 or greater so the ifdef can
|
||||
; be removed after we require NSIS 3.0a2 or greater.
|
||||
!ifdef NSIS_PACKEDVERSION
|
||||
Unicode true
|
||||
ManifestSupportedOS all
|
||||
ManifestDPIAware true
|
||||
!endif
|
||||
|
||||
!addplugindir ./
|
||||
|
||||
; Variables
|
||||
Var TempMaintServiceName
|
||||
Var BrandFullNameDA
|
||||
Var BrandFullName
|
||||
|
||||
; Other included files may depend upon these includes!
|
||||
; The following includes are provided by NSIS.
|
||||
!include FileFunc.nsh
|
||||
!include LogicLib.nsh
|
||||
!include MUI.nsh
|
||||
!include WinMessages.nsh
|
||||
!include WinVer.nsh
|
||||
!include WordFunc.nsh
|
||||
|
||||
!insertmacro GetOptions
|
||||
!insertmacro GetParameters
|
||||
!insertmacro GetSize
|
||||
|
||||
; The test slaves use this fallback key to run tests.
|
||||
; And anyone that wants to run tests themselves should already have
|
||||
; this installed.
|
||||
!define FallbackKey \
|
||||
"SOFTWARE\Mozilla\MaintenanceService\3932ecacee736d366d6436db0f55bce4"
|
||||
|
||||
!define CompanyName "Mozilla Corporation"
|
||||
!define BrandFullNameInternal ""
|
||||
|
||||
; The following includes are custom.
|
||||
!include defines.nsi
|
||||
; We keep defines.nsi defined so that we get other things like
|
||||
; the version number, but we redefine BrandFullName
|
||||
!define MaintFullName "Mozilla Maintenance Service"
|
||||
!undef BrandFullName
|
||||
!define BrandFullName "${MaintFullName}"
|
||||
|
||||
!include common.nsh
|
||||
!include locales.nsi
|
||||
|
||||
VIAddVersionKey "FileDescription" "${MaintFullName} Installer"
|
||||
VIAddVersionKey "OriginalFilename" "maintenanceservice_installer.exe"
|
||||
|
||||
Name "${MaintFullName}"
|
||||
OutFile "maintenanceservice_installer.exe"
|
||||
|
||||
; Get installation folder from registry if available
|
||||
InstallDirRegKey HKLM "Software\Mozilla\MaintenanceService" ""
|
||||
|
||||
SetOverwrite on
|
||||
|
||||
; serviceinstall.cpp also uses this key, in case the path is changed, update
|
||||
; there too.
|
||||
!define MaintUninstallKey \
|
||||
"Software\Microsoft\Windows\CurrentVersion\Uninstall\MozillaMaintenanceService"
|
||||
|
||||
; Always install into the 32-bit location even if we have a 64-bit build.
|
||||
; This is because we use only 1 service for all Basilisk channels.
|
||||
; Allow either x86 and x64 builds to exist at this location, depending on
|
||||
; what is the latest build.
|
||||
InstallDir "$PROGRAMFILES32\${MaintFullName}\"
|
||||
ShowUnInstDetails nevershow
|
||||
|
||||
################################################################################
|
||||
# Modern User Interface - MUI
|
||||
|
||||
!define MUI_ICON setup.ico
|
||||
!define MUI_UNICON setup.ico
|
||||
!define MUI_WELCOMEPAGE_TITLE_3LINES
|
||||
!define MUI_UNWELCOMEFINISHPAGE_BITMAP wizWatermark.bmp
|
||||
|
||||
;Interface Settings
|
||||
!define MUI_ABORTWARNING
|
||||
|
||||
; Uninstaller Pages
|
||||
!insertmacro MUI_UNPAGE_CONFIRM
|
||||
!insertmacro MUI_UNPAGE_INSTFILES
|
||||
|
||||
################################################################################
|
||||
# Language
|
||||
|
||||
!insertmacro MOZ_MUI_LANGUAGE 'baseLocale'
|
||||
!verbose push
|
||||
!verbose 3
|
||||
!include "overrideLocale.nsh"
|
||||
!include "customLocale.nsh"
|
||||
!verbose pop
|
||||
|
||||
; Set this after the locale files to override it if it is in the locale
|
||||
; using " " for BrandingText will hide the "Nullsoft Install System..." branding
|
||||
BrandingText " "
|
||||
|
||||
Function .onInit
|
||||
; Remove the current exe directory from the search order.
|
||||
; This only effects LoadLibrary calls and not implicitly loaded DLLs.
|
||||
System::Call 'kernel32::SetDllDirectoryW(w "")'
|
||||
|
||||
SetSilent silent
|
||||
|
||||
; On Windows 2000 we do not install the maintenance service.
|
||||
; We won't run this installer from the parent installer, but just in case
|
||||
; someone tries to execute it on Windows 2000...
|
||||
${Unless} ${AtLeastWinXP}
|
||||
Abort
|
||||
${EndUnless}
|
||||
FunctionEnd
|
||||
|
||||
Function un.onInit
|
||||
; Remove the current exe directory from the search order.
|
||||
; This only effects LoadLibrary calls and not implicitly loaded DLLs.
|
||||
System::Call 'kernel32::SetDllDirectoryW(w "")'
|
||||
|
||||
; The commands inside this ifndef are needed prior to NSIS 3.0a2 and can be
|
||||
; removed after we require NSIS 3.0a2 or greater.
|
||||
!ifndef NSIS_PACKEDVERSION
|
||||
${If} ${AtLeastWinVista}
|
||||
System::Call 'user32::SetProcessDPIAware()'
|
||||
${EndIf}
|
||||
!endif
|
||||
|
||||
StrCpy $BrandFullNameDA "${MaintFullName}"
|
||||
StrCpy $BrandFullName "${MaintFullName}"
|
||||
FunctionEnd
|
||||
|
||||
Section "MaintenanceService"
|
||||
AllowSkipFiles off
|
||||
|
||||
CreateDirectory $INSTDIR
|
||||
SetOutPath $INSTDIR
|
||||
|
||||
; If the service already exists, then it will be stopped when upgrading it
|
||||
; via the maintenanceservice_tmp.exe command executed below.
|
||||
; The maintenanceservice_tmp.exe command will rename the file to
|
||||
; maintenanceservice.exe if maintenanceservice_tmp.exe is newer.
|
||||
; If the service does not exist yet, we install it and drop the file on
|
||||
; disk as maintenanceservice.exe directly.
|
||||
StrCpy $TempMaintServiceName "maintenanceservice.exe"
|
||||
IfFileExists "$INSTDIR\maintenanceservice.exe" 0 skipAlreadyExists
|
||||
StrCpy $TempMaintServiceName "maintenanceservice_tmp.exe"
|
||||
skipAlreadyExists:
|
||||
|
||||
; We always write out a copy and then decide whether to install it or
|
||||
; not via calling its 'install' cmdline which works by version comparison.
|
||||
CopyFiles "$EXEDIR\maintenanceservice.exe" "$INSTDIR\$TempMaintServiceName"
|
||||
|
||||
; The updater.ini file is only used when performing an install or upgrade,
|
||||
; and only if that install or upgrade is successful. If an old updater.ini
|
||||
; happened to be copied into the maintenance service installation directory
|
||||
; but the service was not newer, the updater.ini file would be unused.
|
||||
; It is used to fill the description of the service on success.
|
||||
CopyFiles "$EXEDIR\updater.ini" "$INSTDIR\updater.ini"
|
||||
|
||||
; Install the application maintenance service.
|
||||
; If a service already exists, the command line parameter will stop the
|
||||
; service and only install itself if it is newer than the already installed
|
||||
; service. If successful it will remove the old maintenanceservice.exe
|
||||
; and replace it with maintenanceservice_tmp.exe.
|
||||
ClearErrors
|
||||
${GetParameters} $0
|
||||
${GetOptions} "$0" "/Upgrade" $0
|
||||
${If} ${Errors}
|
||||
ExecWait '"$INSTDIR\$TempMaintServiceName" install'
|
||||
${Else}
|
||||
; The upgrade cmdline is the same as install except
|
||||
; It will fail if the service isn't already installed.
|
||||
ExecWait '"$INSTDIR\$TempMaintServiceName" upgrade'
|
||||
${EndIf}
|
||||
|
||||
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
||||
WriteRegStr HKLM "${MaintUninstallKey}" "DisplayName" "${MaintFullName}"
|
||||
WriteRegStr HKLM "${MaintUninstallKey}" "UninstallString" \
|
||||
'"$INSTDIR\uninstall.exe"'
|
||||
WriteRegStr HKLM "${MaintUninstallKey}" "DisplayIcon" \
|
||||
"$INSTDIR\Uninstall.exe,0"
|
||||
WriteRegStr HKLM "${MaintUninstallKey}" "DisplayVersion" "${AppVersion}"
|
||||
WriteRegStr HKLM "${MaintUninstallKey}" "Publisher" "Mozilla"
|
||||
WriteRegStr HKLM "${MaintUninstallKey}" "Comments" "${BrandFullName}"
|
||||
WriteRegDWORD HKLM "${MaintUninstallKey}" "NoModify" 1
|
||||
${GetSize} "$INSTDIR" "/S=0K" $R2 $R3 $R4
|
||||
WriteRegDWORD HKLM "${MaintUninstallKey}" "EstimatedSize" $R2
|
||||
|
||||
; Write out that a maintenance service was attempted.
|
||||
; We do this because on upgrades we will check this value and we only
|
||||
; want to install once on the first upgrade to maintenance service.
|
||||
; Also write out that we are currently installed, preferences will check
|
||||
; this value to determine if we should show the service update pref.
|
||||
; Since the Maintenance service can be installed either x86 or x64,
|
||||
; always use the 64-bit registry for checking if an attempt was made.
|
||||
${If} ${RunningX64}
|
||||
SetRegView 64
|
||||
${EndIf}
|
||||
WriteRegDWORD HKLM "Software\Mozilla\MaintenanceService" "Attempted" 1
|
||||
WriteRegDWORD HKLM "Software\Mozilla\MaintenanceService" "Installed" 1
|
||||
DeleteRegValue HKLM "Software\Mozilla\MaintenanceService" "FFPrefetchDisabled"
|
||||
|
||||
; Included here for debug purposes only.
|
||||
; These keys are used to bypass the installation dir is a valid installation
|
||||
; check from the service so that tests can be run.
|
||||
; WriteRegStr HKLM "${FallbackKey}\0" "name" "Mozilla Corporation"
|
||||
; WriteRegStr HKLM "${FallbackKey}\0" "issuer" "DigiCert SHA2 Assured ID Code Signing CA"
|
||||
${If} ${RunningX64}
|
||||
SetRegView lastused
|
||||
${EndIf}
|
||||
SectionEnd
|
||||
|
||||
; By renaming before deleting we improve things slightly in case
|
||||
; there is a file in use error. In this case a new install can happen.
|
||||
Function un.RenameDelete
|
||||
Pop $9
|
||||
; If the .moz-delete file already exists previously, delete it
|
||||
; If it doesn't exist, the call is ignored.
|
||||
; We don't need to pass /REBOOTOK here since it was already marked that way
|
||||
; if it exists.
|
||||
Delete "$9.moz-delete"
|
||||
Rename "$9" "$9.moz-delete"
|
||||
${If} ${Errors}
|
||||
Delete /REBOOTOK "$9"
|
||||
${Else}
|
||||
Delete /REBOOTOK "$9.moz-delete"
|
||||
${EndIf}
|
||||
ClearErrors
|
||||
FunctionEnd
|
||||
|
||||
Section "Uninstall"
|
||||
; Delete the service so that no updates will be attempted
|
||||
ExecWait '"$INSTDIR\maintenanceservice.exe" uninstall'
|
||||
|
||||
Push "$INSTDIR\updater.ini"
|
||||
Call un.RenameDelete
|
||||
Push "$INSTDIR\maintenanceservice.exe"
|
||||
Call un.RenameDelete
|
||||
Push "$INSTDIR\maintenanceservice_tmp.exe"
|
||||
Call un.RenameDelete
|
||||
Push "$INSTDIR\maintenanceservice.old"
|
||||
Call un.RenameDelete
|
||||
Push "$INSTDIR\Uninstall.exe"
|
||||
Call un.RenameDelete
|
||||
Push "$INSTDIR\update\updater.ini"
|
||||
Call un.RenameDelete
|
||||
Push "$INSTDIR\update\updater.exe"
|
||||
Call un.RenameDelete
|
||||
Push "$INSTDIR\logs\maintenanceservice.log"
|
||||
Call un.RenameDelete
|
||||
Push "$INSTDIR\logs\maintenanceservice-1.log"
|
||||
Call un.RenameDelete
|
||||
Push "$INSTDIR\logs\maintenanceservice-2.log"
|
||||
Call un.RenameDelete
|
||||
Push "$INSTDIR\logs\maintenanceservice-3.log"
|
||||
Call un.RenameDelete
|
||||
Push "$INSTDIR\logs\maintenanceservice-4.log"
|
||||
Call un.RenameDelete
|
||||
Push "$INSTDIR\logs\maintenanceservice-5.log"
|
||||
Call un.RenameDelete
|
||||
Push "$INSTDIR\logs\maintenanceservice-6.log"
|
||||
Call un.RenameDelete
|
||||
Push "$INSTDIR\logs\maintenanceservice-7.log"
|
||||
Call un.RenameDelete
|
||||
Push "$INSTDIR\logs\maintenanceservice-8.log"
|
||||
Call un.RenameDelete
|
||||
Push "$INSTDIR\logs\maintenanceservice-9.log"
|
||||
Call un.RenameDelete
|
||||
Push "$INSTDIR\logs\maintenanceservice-10.log"
|
||||
Call un.RenameDelete
|
||||
Push "$INSTDIR\logs\maintenanceservice-install.log"
|
||||
Call un.RenameDelete
|
||||
Push "$INSTDIR\logs\maintenanceservice-uninstall.log"
|
||||
Call un.RenameDelete
|
||||
SetShellVarContext all
|
||||
Push "$APPDATA\Mozilla\logs\maintenanceservice.log"
|
||||
Call un.RenameDelete
|
||||
Push "$APPDATA\Mozilla\logs\maintenanceservice-1.log"
|
||||
Call un.RenameDelete
|
||||
Push "$APPDATA\Mozilla\logs\maintenanceservice-2.log"
|
||||
Call un.RenameDelete
|
||||
Push "$APPDATA\Mozilla\logs\maintenanceservice-3.log"
|
||||
Call un.RenameDelete
|
||||
Push "$APPDATA\Mozilla\logs\maintenanceservice-4.log"
|
||||
Call un.RenameDelete
|
||||
Push "$APPDATA\Mozilla\logs\maintenanceservice-5.log"
|
||||
Call un.RenameDelete
|
||||
Push "$APPDATA\Mozilla\logs\maintenanceservice-6.log"
|
||||
Call un.RenameDelete
|
||||
Push "$APPDATA\Mozilla\logs\maintenanceservice-7.log"
|
||||
Call un.RenameDelete
|
||||
Push "$APPDATA\Mozilla\logs\maintenanceservice-8.log"
|
||||
Call un.RenameDelete
|
||||
Push "$APPDATA\Mozilla\logs\maintenanceservice-9.log"
|
||||
Call un.RenameDelete
|
||||
Push "$APPDATA\Mozilla\logs\maintenanceservice-10.log"
|
||||
Call un.RenameDelete
|
||||
Push "$APPDATA\Mozilla\logs\maintenanceservice-install.log"
|
||||
Call un.RenameDelete
|
||||
Push "$APPDATA\Mozilla\logs\maintenanceservice-uninstall.log"
|
||||
Call un.RenameDelete
|
||||
RMDir /REBOOTOK "$APPDATA\Mozilla\logs"
|
||||
RMDir /REBOOTOK "$APPDATA\Mozilla"
|
||||
RMDir /REBOOTOK "$INSTDIR\logs"
|
||||
RMDir /REBOOTOK "$INSTDIR\update"
|
||||
RMDir /REBOOTOK "$INSTDIR"
|
||||
|
||||
DeleteRegKey HKLM "${MaintUninstallKey}"
|
||||
|
||||
${If} ${RunningX64}
|
||||
SetRegView 64
|
||||
${EndIf}
|
||||
DeleteRegValue HKLM "Software\Mozilla\MaintenanceService" "Installed"
|
||||
DeleteRegValue HKLM "Software\Mozilla\MaintenanceService" "FFPrefetchDisabled"
|
||||
DeleteRegKey HKLM "${FallbackKey}\"
|
||||
${If} ${RunningX64}
|
||||
SetRegView lastused
|
||||
${EndIf}
|
||||
SectionEnd
|
||||
1410
application/basilisk/installer/windows/nsis/shared.nsh
Normal file
1410
application/basilisk/installer/windows/nsis/shared.nsh
Normal file
File diff suppressed because it is too large
Load diff
627
application/basilisk/installer/windows/nsis/uninstaller.nsi
Normal file
627
application/basilisk/installer/windows/nsis/uninstaller.nsi
Normal file
|
|
@ -0,0 +1,627 @@
|
|||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
# Required Plugins:
|
||||
# AppAssocReg http://nsis.sourceforge.net/Application_Association_Registration_plug-in
|
||||
# CityHash http://dxr.mozilla.org/mozilla-central/source/other-licenses/nsis/Contrib/CityHash
|
||||
# ShellLink http://nsis.sourceforge.net/ShellLink_plug-in
|
||||
# UAC http://nsis.sourceforge.net/UAC_plug-in
|
||||
|
||||
; Set verbosity to 3 (e.g. no script) to lessen the noise in the build logs
|
||||
!verbose 3
|
||||
|
||||
; 7-Zip provides better compression than the lzma from NSIS so we add the files
|
||||
; uncompressed and use 7-Zip to create a SFX archive of it
|
||||
SetDatablockOptimize on
|
||||
SetCompress off
|
||||
CRCCheck on
|
||||
|
||||
RequestExecutionLevel user
|
||||
|
||||
; The commands inside this ifdef require NSIS 3.0a2 or greater so the ifdef can
|
||||
; be removed after we require NSIS 3.0a2 or greater.
|
||||
!ifdef NSIS_PACKEDVERSION
|
||||
Unicode true
|
||||
ManifestSupportedOS all
|
||||
ManifestDPIAware true
|
||||
!endif
|
||||
|
||||
!addplugindir ./
|
||||
|
||||
; On Vista and above attempt to elevate Standard Users in addition to users that
|
||||
; are a member of the Administrators group.
|
||||
!define NONADMIN_ELEVATE
|
||||
|
||||
; prevents compiling of the reg write logging.
|
||||
!define NO_LOG
|
||||
|
||||
!define MaintUninstallKey \
|
||||
"Software\Microsoft\Windows\CurrentVersion\Uninstall\MozillaMaintenanceService"
|
||||
|
||||
Var TmpVal
|
||||
Var MaintCertKey
|
||||
|
||||
; Other included files may depend upon these includes!
|
||||
; The following includes are provided by NSIS.
|
||||
!include FileFunc.nsh
|
||||
!include LogicLib.nsh
|
||||
!include MUI.nsh
|
||||
!include WinMessages.nsh
|
||||
!include WinVer.nsh
|
||||
!include WordFunc.nsh
|
||||
|
||||
!insertmacro GetSize
|
||||
!insertmacro StrFilter
|
||||
!insertmacro WordReplace
|
||||
|
||||
!insertmacro un.GetParent
|
||||
|
||||
; The following includes are custom.
|
||||
!include branding.nsi
|
||||
!include defines.nsi
|
||||
!include common.nsh
|
||||
!include locales.nsi
|
||||
|
||||
; This is named BrandShortName helper because we use this for software update
|
||||
; post update cleanup.
|
||||
VIAddVersionKey "FileDescription" "${BrandShortName} Helper"
|
||||
VIAddVersionKey "OriginalFilename" "helper.exe"
|
||||
|
||||
!insertmacro AddDisabledDDEHandlerValues
|
||||
!insertmacro CleanVirtualStore
|
||||
!insertmacro ElevateUAC
|
||||
!insertmacro GetLongPath
|
||||
!insertmacro GetPathFromString
|
||||
!insertmacro InitHashAppModelId
|
||||
!insertmacro IsHandlerForInstallDir
|
||||
!insertmacro IsPinnedToTaskBar
|
||||
!insertmacro IsUserAdmin
|
||||
!insertmacro LogDesktopShortcut
|
||||
!insertmacro LogQuickLaunchShortcut
|
||||
!insertmacro LogStartMenuShortcut
|
||||
!insertmacro PinnedToStartMenuLnkCount
|
||||
!insertmacro RegCleanAppHandler
|
||||
!insertmacro RegCleanMain
|
||||
!insertmacro RegCleanUninstall
|
||||
!insertmacro SetAppLSPCategories
|
||||
!insertmacro SetBrandNameVars
|
||||
!insertmacro UpdateShortcutAppModelIDs
|
||||
!insertmacro UnloadUAC
|
||||
!insertmacro WriteRegDWORD2
|
||||
!insertmacro WriteRegStr2
|
||||
|
||||
!insertmacro un.ChangeMUIHeaderImage
|
||||
!insertmacro un.CheckForFilesInUse
|
||||
!insertmacro un.CleanUpdateDirectories
|
||||
!insertmacro un.CleanVirtualStore
|
||||
!insertmacro un.DeleteShortcuts
|
||||
!insertmacro un.GetLongPath
|
||||
!insertmacro un.GetSecondInstallPath
|
||||
!insertmacro un.InitHashAppModelId
|
||||
!insertmacro un.ManualCloseAppPrompt
|
||||
!insertmacro un.RegCleanAppHandler
|
||||
!insertmacro un.RegCleanFileHandler
|
||||
!insertmacro un.RegCleanMain
|
||||
!insertmacro un.RegCleanUninstall
|
||||
!insertmacro un.RegCleanProtocolHandler
|
||||
!insertmacro un.RemoveQuotesFromPath
|
||||
!insertmacro un.RemovePrecompleteEntries
|
||||
!insertmacro un.SetAppLSPCategories
|
||||
!insertmacro un.SetBrandNameVars
|
||||
|
||||
!include shared.nsh
|
||||
|
||||
; Helper macros for ui callbacks. Insert these after shared.nsh
|
||||
!insertmacro OnEndCommon
|
||||
!insertmacro UninstallOnInitCommon
|
||||
|
||||
!insertmacro un.OnEndCommon
|
||||
!insertmacro un.UninstallUnOnInitCommon
|
||||
|
||||
Name "${BrandFullName}"
|
||||
OutFile "helper.exe"
|
||||
!ifdef HAVE_64BIT_BUILD
|
||||
InstallDir "$PROGRAMFILES64\${BrandFullName}\"
|
||||
!else
|
||||
InstallDir "$PROGRAMFILES32\${BrandFullName}\"
|
||||
!endif
|
||||
ShowUnInstDetails nevershow
|
||||
|
||||
################################################################################
|
||||
# Modern User Interface - MUI
|
||||
|
||||
!define MUI_ABORTWARNING
|
||||
!define MUI_ICON setup.ico
|
||||
!define MUI_UNICON setup.ico
|
||||
!define MUI_WELCOMEPAGE_TITLE_3LINES
|
||||
!define MUI_HEADERIMAGE
|
||||
!define MUI_HEADERIMAGE_RIGHT
|
||||
!define MUI_UNWELCOMEFINISHPAGE_BITMAP wizWatermark.bmp
|
||||
|
||||
; Use a right to left header image when the language is right to left
|
||||
!ifdef ${AB_CD}_rtl
|
||||
!define MUI_HEADERIMAGE_BITMAP_RTL wizHeaderRTL.bmp
|
||||
!else
|
||||
!define MUI_HEADERIMAGE_BITMAP wizHeader.bmp
|
||||
!endif
|
||||
|
||||
/**
|
||||
* Uninstall Pages
|
||||
*/
|
||||
; Welcome Page
|
||||
!define MUI_PAGE_CUSTOMFUNCTION_PRE un.preWelcome
|
||||
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE un.leaveWelcome
|
||||
!insertmacro MUI_UNPAGE_WELCOME
|
||||
|
||||
; Custom Uninstall Confirm Page
|
||||
UninstPage custom un.preConfirm
|
||||
|
||||
; Remove Files Page
|
||||
!insertmacro MUI_UNPAGE_INSTFILES
|
||||
|
||||
; Finish Page
|
||||
|
||||
!insertmacro MUI_UNPAGE_FINISH
|
||||
|
||||
; Use the default dialog for IDD_VERIFY for a simple Banner
|
||||
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
|
||||
; Empty section required for the installer to compile as an uninstaller
|
||||
Section ""
|
||||
SectionEnd
|
||||
|
||||
################################################################################
|
||||
# Uninstall Sections
|
||||
|
||||
Section "Uninstall"
|
||||
SetDetailsPrint textonly
|
||||
DetailPrint $(STATUS_UNINSTALL_MAIN)
|
||||
SetDetailsPrint none
|
||||
|
||||
; Delete the app exe to prevent launching the app while we are uninstalling.
|
||||
ClearErrors
|
||||
${DeleteFile} "$INSTDIR\${FileMainEXE}"
|
||||
${If} ${Errors}
|
||||
; If the user closed the application it can take several seconds for it to
|
||||
; shut down completely. If the application is being used by another user we
|
||||
; can still delete the files when the system is restarted.
|
||||
Sleep 5000
|
||||
${DeleteFile} "$INSTDIR\${FileMainEXE}"
|
||||
ClearErrors
|
||||
${EndIf}
|
||||
|
||||
; setup the application model id registration value
|
||||
${un.InitHashAppModelId} "$INSTDIR" "Software\Mozilla\${AppName}\TaskBarIDs"
|
||||
|
||||
SetShellVarContext current ; Set SHCTX to HKCU
|
||||
${un.RegCleanMain} "Software\Mozilla"
|
||||
${un.RegCleanUninstall}
|
||||
${un.DeleteShortcuts}
|
||||
|
||||
; Unregister resources associated with Win7 taskbar jump lists.
|
||||
${If} ${AtLeastWin7}
|
||||
${AndIf} "$AppUserModelID" != ""
|
||||
ApplicationID::UninstallJumpLists "$AppUserModelID"
|
||||
${EndIf}
|
||||
|
||||
; Remove the updates directory for Vista and above
|
||||
${un.CleanUpdateDirectories} "Mozilla\Basilisk" "Mozilla\updates"
|
||||
|
||||
; Remove any app model id's stored in the registry for this install path
|
||||
DeleteRegValue HKCU "Software\Mozilla\${AppName}\TaskBarIDs" "$INSTDIR"
|
||||
DeleteRegValue HKLM "Software\Mozilla\${AppName}\TaskBarIDs" "$INSTDIR"
|
||||
|
||||
ClearErrors
|
||||
WriteRegStr HKLM "Software\Mozilla" "${BrandShortName}InstallerTest" "Write Test"
|
||||
${If} ${Errors}
|
||||
StrCpy $TmpVal "HKCU" ; used primarily for logging
|
||||
${Else}
|
||||
SetShellVarContext all ; Set SHCTX to HKLM
|
||||
DeleteRegValue HKLM "Software\Mozilla" "${BrandShortName}InstallerTest"
|
||||
StrCpy $TmpVal "HKLM" ; used primarily for logging
|
||||
${un.RegCleanMain} "Software\Mozilla"
|
||||
${un.RegCleanUninstall}
|
||||
${un.DeleteShortcuts}
|
||||
${un.SetAppLSPCategories}
|
||||
${EndIf}
|
||||
|
||||
${un.RegCleanAppHandler} "BasiliskURL"
|
||||
${un.RegCleanAppHandler} "BasiliskHTML"
|
||||
${un.RegCleanProtocolHandler} "ftp"
|
||||
${un.RegCleanProtocolHandler} "http"
|
||||
${un.RegCleanProtocolHandler} "https"
|
||||
|
||||
ClearErrors
|
||||
ReadRegStr $R9 HKCR "BasiliskHTML" ""
|
||||
; Don't clean up the file handlers if the BasiliskHTML key still exists since
|
||||
; there should be a second installation that may be the default file handler
|
||||
${If} ${Errors}
|
||||
${un.RegCleanFileHandler} ".htm" "BasiliskHTML"
|
||||
${un.RegCleanFileHandler} ".html" "BasiliskHTML"
|
||||
${un.RegCleanFileHandler} ".shtml" "BasiliskHTML"
|
||||
${un.RegCleanFileHandler} ".xht" "BasiliskHTML"
|
||||
${un.RegCleanFileHandler} ".xhtml" "BasiliskHTML"
|
||||
${un.RegCleanFileHandler} ".oga" "BasiliskHTML"
|
||||
${un.RegCleanFileHandler} ".ogg" "BasiliskHTML"
|
||||
${un.RegCleanFileHandler} ".ogv" "BasiliskHTML"
|
||||
${un.RegCleanFileHandler} ".pdf" "BasiliskHTML"
|
||||
${un.RegCleanFileHandler} ".webm" "BasiliskHTML"
|
||||
${EndIf}
|
||||
|
||||
SetShellVarContext all ; Set SHCTX to HKLM
|
||||
${un.GetSecondInstallPath} "Software\Mozilla" $R9
|
||||
${If} $R9 == "false"
|
||||
SetShellVarContext current ; Set SHCTX to HKCU
|
||||
${un.GetSecondInstallPath} "Software\Mozilla" $R9
|
||||
${EndIf}
|
||||
|
||||
StrCpy $0 "Software\Clients\StartMenuInternet\${FileMainEXE}\shell\open\command"
|
||||
ReadRegStr $R1 HKLM "$0" ""
|
||||
${un.RemoveQuotesFromPath} "$R1" $R1
|
||||
${un.GetParent} "$R1" $R1
|
||||
|
||||
; Only remove the StartMenuInternet key if it refers to this install location.
|
||||
; The StartMenuInternet registry key is independent of the default browser
|
||||
; settings. The XPInstall base un-installer always removes this key if it is
|
||||
; uninstalling the default browser and it will always replace the keys when
|
||||
; installing even if there is another install of Basilisk that is set as the
|
||||
; default browser. Now the key is always updated on install but it is only
|
||||
; removed if it refers to this install location.
|
||||
${If} "$INSTDIR" == "$R1"
|
||||
DeleteRegKey HKLM "Software\Clients\StartMenuInternet\${FileMainEXE}"
|
||||
DeleteRegValue HKLM "Software\RegisteredApplications" "${AppRegName}"
|
||||
${EndIf}
|
||||
|
||||
ReadRegStr $R1 HKCU "$0" ""
|
||||
${un.RemoveQuotesFromPath} "$R1" $R1
|
||||
${un.GetParent} "$R1" $R1
|
||||
|
||||
; Only remove the StartMenuInternet key if it refers to this install location.
|
||||
; The StartMenuInternet registry key is independent of the default browser
|
||||
; settings. The XPInstall base un-installer always removes this key if it is
|
||||
; uninstalling the default browser and it will always replace the keys when
|
||||
; installing even if there is another install of Basilisk that is set as the
|
||||
; default browser. Now the key is always updated on install but it is only
|
||||
; removed if it refers to this install location.
|
||||
${If} "$INSTDIR" == "$R1"
|
||||
DeleteRegKey HKCU "Software\Clients\StartMenuInternet\${FileMainEXE}"
|
||||
DeleteRegValue HKCU "Software\RegisteredApplications" "${AppRegName}"
|
||||
${EndIf}
|
||||
|
||||
StrCpy $0 "Software\Microsoft\Windows\CurrentVersion\App Paths\${FileMainEXE}"
|
||||
${If} $R9 == "false"
|
||||
DeleteRegKey HKLM "$0"
|
||||
DeleteRegKey HKCU "$0"
|
||||
StrCpy $0 "Software\Microsoft\MediaPlayer\ShimInclusionList\${FileMainEXE}"
|
||||
DeleteRegKey HKLM "$0"
|
||||
DeleteRegKey HKCU "$0"
|
||||
StrCpy $0 "Software\Microsoft\MediaPlayer\ShimInclusionList\plugin-container.exe"
|
||||
DeleteRegKey HKLM "$0"
|
||||
DeleteRegKey HKCU "$0"
|
||||
StrCpy $0 "Software\Classes\MIME\Database\Content Type\application/x-xpinstall;app=Basilisk"
|
||||
DeleteRegKey HKLM "$0"
|
||||
DeleteRegKey HKCU "$0"
|
||||
${Else}
|
||||
ReadRegStr $R1 HKLM "$0" ""
|
||||
${un.RemoveQuotesFromPath} "$R1" $R1
|
||||
${un.GetParent} "$R1" $R1
|
||||
${If} "$INSTDIR" == "$R1"
|
||||
WriteRegStr HKLM "$0" "" "$R9"
|
||||
${un.GetParent} "$R9" $R1
|
||||
WriteRegStr HKLM "$0" "Path" "$R1"
|
||||
${EndIf}
|
||||
${EndIf}
|
||||
|
||||
; Remove directories and files we always control before parsing the uninstall
|
||||
; log so empty directories can be removed.
|
||||
${If} ${FileExists} "$INSTDIR\updates"
|
||||
RmDir /r /REBOOTOK "$INSTDIR\updates"
|
||||
${EndIf}
|
||||
${If} ${FileExists} "$INSTDIR\updated"
|
||||
RmDir /r /REBOOTOK "$INSTDIR\updated"
|
||||
${EndIf}
|
||||
${If} ${FileExists} "$INSTDIR\defaults\shortcuts"
|
||||
RmDir /r /REBOOTOK "$INSTDIR\defaults\shortcuts"
|
||||
${EndIf}
|
||||
${If} ${FileExists} "$INSTDIR\distribution"
|
||||
RmDir /r /REBOOTOK "$INSTDIR\distribution"
|
||||
${EndIf}
|
||||
|
||||
; Remove files that may be left behind by the application in the
|
||||
; VirtualStore directory.
|
||||
${un.CleanVirtualStore}
|
||||
|
||||
; Only unregister the dll if the registration points to this installation
|
||||
ReadRegStr $R1 HKCR "CLSID\{0D68D6D0-D93D-4D08-A30D-F00DD1F45B24}\InProcServer32" ""
|
||||
${If} "$INSTDIR\AccessibleMarshal.dll" == "$R1"
|
||||
${UnregisterDLL} "$INSTDIR\AccessibleMarshal.dll"
|
||||
${EndIf}
|
||||
|
||||
${un.RemovePrecompleteEntries} "false"
|
||||
|
||||
${If} ${FileExists} "$INSTDIR\defaults\pref\channel-prefs.js"
|
||||
Delete /REBOOTOK "$INSTDIR\defaults\pref\channel-prefs.js"
|
||||
${EndIf}
|
||||
${If} ${FileExists} "$INSTDIR\defaults\pref"
|
||||
RmDir /REBOOTOK "$INSTDIR\defaults\pref"
|
||||
${EndIf}
|
||||
${If} ${FileExists} "$INSTDIR\defaults"
|
||||
RmDir /REBOOTOK "$INSTDIR\defaults"
|
||||
${EndIf}
|
||||
${If} ${FileExists} "$INSTDIR\uninstall"
|
||||
; Remove the uninstall directory that we control
|
||||
RmDir /r /REBOOTOK "$INSTDIR\uninstall"
|
||||
${EndIf}
|
||||
${If} ${FileExists} "$INSTDIR\install.log"
|
||||
Delete /REBOOTOK "$INSTDIR\install.log"
|
||||
${EndIf}
|
||||
${If} ${FileExists} "$INSTDIR\update-settings.ini"
|
||||
Delete /REBOOTOK "$INSTDIR\update-settings.ini"
|
||||
${EndIf}
|
||||
|
||||
; Explicitly remove empty webapprt dir in case it exists (bug 757978).
|
||||
RmDir "$INSTDIR\webapprt\components"
|
||||
RmDir "$INSTDIR\webapprt"
|
||||
|
||||
; Remove the installation directory if it is empty
|
||||
RmDir "$INSTDIR"
|
||||
|
||||
; If Basilisk.exe was successfully deleted yet we still need to restart to
|
||||
; remove other files create a dummy Basilisk.exe.moz-delete to prevent the
|
||||
; installer from allowing an install without restart when it is required
|
||||
; to complete an uninstall.
|
||||
${If} ${RebootFlag}
|
||||
; Admin is required to delete files on reboot so only add the moz-delete if
|
||||
; the user is an admin. After calling UAC::IsAdmin $0 will equal 1 if the
|
||||
; user is an admin.
|
||||
UAC::IsAdmin
|
||||
${If} "$0" == "1"
|
||||
${Unless} ${FileExists} "$INSTDIR\${FileMainEXE}.moz-delete"
|
||||
FileOpen $0 "$INSTDIR\${FileMainEXE}.moz-delete" w
|
||||
FileWrite $0 "Will be deleted on restart"
|
||||
Delete /REBOOTOK "$INSTDIR\${FileMainEXE}.moz-delete"
|
||||
FileClose $0
|
||||
${EndUnless}
|
||||
${EndIf}
|
||||
${EndIf}
|
||||
|
||||
; Refresh desktop icons otherwise the start menu internet item won't be
|
||||
; removed and other ugly things will happen like recreation of the app's
|
||||
; clients registry key by the OS under some conditions.
|
||||
System::Call "shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i 0, i 0, i 0)"
|
||||
|
||||
; Users who uninstall then reinstall expecting Basilisk to use a clean profile
|
||||
; may be surprised during first-run. This key is checked during startup of Basilisk and
|
||||
; subsequently deleted after checking. If the value is found during startup
|
||||
; the browser will offer to Reset Basilisk. We use the UpdateChannel to match
|
||||
; uninstalls of Basilisk-release with reinstalls of Basilisk-release, for example.
|
||||
WriteRegStr HKCU "Software\Mozilla\Basilisk" "Uninstalled-${UpdateChannel}" "True"
|
||||
|
||||
!ifdef MOZ_MAINTENANCE_SERVICE
|
||||
; Get the path the allowed cert is at and remove it
|
||||
; Keep this block of code last since it modfies the reg view
|
||||
ServicesHelper::PathToUniqueRegistryPath "$INSTDIR"
|
||||
Pop $MaintCertKey
|
||||
${If} $MaintCertKey != ""
|
||||
; Always use the 64bit registry for certs on 64bit systems.
|
||||
${If} ${RunningX64}
|
||||
SetRegView 64
|
||||
${EndIf}
|
||||
DeleteRegKey HKLM "$MaintCertKey"
|
||||
${If} ${RunningX64}
|
||||
SetRegView lastused
|
||||
${EndIf}
|
||||
${EndIf}
|
||||
Call un.UninstallServiceIfNotUsed
|
||||
!endif
|
||||
|
||||
${un.IsFirewallSvcRunning}
|
||||
Pop $0
|
||||
${If} "$0" == "true"
|
||||
liteFirewallW::RemoveRule "$INSTDIR\${FileMainEXE}" "${BrandShortName} ($INSTDIR)"
|
||||
${EndIf}
|
||||
SectionEnd
|
||||
|
||||
################################################################################
|
||||
# Language
|
||||
|
||||
!insertmacro MOZ_MUI_LANGUAGE 'baseLocale'
|
||||
!verbose push
|
||||
!verbose 3
|
||||
!include "overrideLocale.nsh"
|
||||
!include "customLocale.nsh"
|
||||
!verbose pop
|
||||
|
||||
; Set this after the locale files to override it if it is in the locale. Using
|
||||
; " " for BrandingText will hide the "Nullsoft Install System..." branding.
|
||||
BrandingText " "
|
||||
|
||||
################################################################################
|
||||
# Page pre, show, and leave functions
|
||||
|
||||
Function un.preWelcome
|
||||
${If} ${FileExists} "$INSTDIR\distribution\modern-wizard.bmp"
|
||||
Delete "$PLUGINSDIR\modern-wizard.bmp"
|
||||
CopyFiles /SILENT "$INSTDIR\distribution\modern-wizard.bmp" "$PLUGINSDIR\modern-wizard.bmp"
|
||||
${EndIf}
|
||||
FunctionEnd
|
||||
|
||||
Function un.leaveWelcome
|
||||
${If} ${FileExists} "$INSTDIR\${FileMainEXE}"
|
||||
Banner::show /NOUNLOAD "$(BANNER_CHECK_EXISTING)"
|
||||
|
||||
; If the message window has been found previously give the app an additional
|
||||
; five seconds to close.
|
||||
${If} "$TmpVal" == "FoundMessageWindow"
|
||||
Sleep 5000
|
||||
${EndIf}
|
||||
|
||||
${PushFilesToCheck}
|
||||
|
||||
${un.CheckForFilesInUse} $TmpVal
|
||||
|
||||
Banner::destroy
|
||||
|
||||
; If there are files in use $TmpVal will be "true"
|
||||
${If} "$TmpVal" == "true"
|
||||
; If the message window is found the call to ManualCloseAppPrompt will
|
||||
; abort leaving the value of $TmpVal set to "FoundMessageWindow".
|
||||
StrCpy $TmpVal "FoundMessageWindow"
|
||||
${un.ManualCloseAppPrompt} "${WindowClass}" "$(WARN_MANUALLY_CLOSE_APP_UNINSTALL)"
|
||||
; If the message window is not found set $TmpVal to "true" so the restart
|
||||
; required message is displayed.
|
||||
StrCpy $TmpVal "true"
|
||||
${EndIf}
|
||||
${EndIf}
|
||||
FunctionEnd
|
||||
|
||||
Function un.preConfirm
|
||||
${If} ${FileExists} "$INSTDIR\distribution\modern-header.bmp"
|
||||
${AndIf} $hHeaderBitmap == ""
|
||||
Delete "$PLUGINSDIR\modern-header.bmp"
|
||||
CopyFiles /SILENT "$INSTDIR\distribution\modern-header.bmp" "$PLUGINSDIR\modern-header.bmp"
|
||||
${un.ChangeMUIHeaderImage} "$PLUGINSDIR\modern-header.bmp"
|
||||
${EndIf}
|
||||
|
||||
; Setup the unconfirm.ini file for the Custom Uninstall Confirm Page
|
||||
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Settings" NumFields "3"
|
||||
|
||||
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 1" Type "label"
|
||||
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 1" Text "$(UN_CONFIRM_UNINSTALLED_FROM)"
|
||||
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 1" Left "0"
|
||||
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 1" Right "-1"
|
||||
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 1" Top "5"
|
||||
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 1" Bottom "15"
|
||||
|
||||
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 2" Type "text"
|
||||
; The contents of this control must be set as follows in the pre function
|
||||
; ${MUI_INSTALLOPTIONS_READ} $1 "unconfirm.ini" "Field 2" "HWND"
|
||||
; SendMessage $1 ${WM_SETTEXT} 0 "STR:$INSTDIR"
|
||||
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 2" State ""
|
||||
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 2" Left "0"
|
||||
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 2" Right "-1"
|
||||
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 2" Top "17"
|
||||
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 2" Bottom "30"
|
||||
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 2" flags "READONLY"
|
||||
|
||||
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Type "label"
|
||||
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Text "$(UN_CONFIRM_CLICK)"
|
||||
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Left "0"
|
||||
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Right "-1"
|
||||
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Top "130"
|
||||
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Bottom "150"
|
||||
|
||||
${If} "$TmpVal" == "true"
|
||||
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Type "label"
|
||||
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Text "$(SUMMARY_REBOOT_REQUIRED_UNINSTALL)"
|
||||
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Left "0"
|
||||
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Right "-1"
|
||||
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Top "35"
|
||||
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Bottom "45"
|
||||
|
||||
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Settings" NumFields "4"
|
||||
${EndIf}
|
||||
|
||||
!insertmacro MUI_HEADER_TEXT "$(UN_CONFIRM_PAGE_TITLE)" "$(UN_CONFIRM_PAGE_SUBTITLE)"
|
||||
; The Summary custom page has a textbox that will automatically receive
|
||||
; focus. This sets the focus to the Install button instead.
|
||||
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "unconfirm.ini"
|
||||
GetDlgItem $0 $HWNDPARENT 1
|
||||
System::Call "user32::SetFocus(i r0, i 0x0007, i,i)i"
|
||||
${MUI_INSTALLOPTIONS_READ} $1 "unconfirm.ini" "Field 2" "HWND"
|
||||
SendMessage $1 ${WM_SETTEXT} 0 "STR:$INSTDIR"
|
||||
!insertmacro MUI_INSTALLOPTIONS_SHOW
|
||||
FunctionEnd
|
||||
|
||||
################################################################################
|
||||
# Initialization Functions
|
||||
|
||||
Function .onInit
|
||||
; Remove the current exe directory from the search order.
|
||||
; This only effects LoadLibrary calls and not implicitly loaded DLLs.
|
||||
System::Call 'kernel32::SetDllDirectoryW(w "")'
|
||||
|
||||
; We need this set up for most of the helper.exe operations.
|
||||
${UninstallOnInitCommon}
|
||||
FunctionEnd
|
||||
|
||||
Function un.onInit
|
||||
; Remove the current exe directory from the search order.
|
||||
; This only effects LoadLibrary calls and not implicitly loaded DLLs.
|
||||
System::Call 'kernel32::SetDllDirectoryW(w "")'
|
||||
|
||||
StrCpy $LANGUAGE 0
|
||||
|
||||
${un.UninstallUnOnInitCommon}
|
||||
|
||||
; The commands inside this ifndef are needed prior to NSIS 3.0a2 and can be
|
||||
; removed after we require NSIS 3.0a2 or greater.
|
||||
!ifndef NSIS_PACKEDVERSION
|
||||
${If} ${AtLeastWinVista}
|
||||
System::Call 'user32::SetProcessDPIAware()'
|
||||
${EndIf}
|
||||
!endif
|
||||
|
||||
!insertmacro InitInstallOptionsFile "unconfirm.ini"
|
||||
FunctionEnd
|
||||
|
||||
Function .onGUIEnd
|
||||
${OnEndCommon}
|
||||
FunctionEnd
|
||||
|
||||
Function un.onGUIEnd
|
||||
${un.OnEndCommon}
|
||||
FunctionEnd
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
|
||||
; IMPORTANT: This file should always start with a newline in case a locale
|
||||
; provided updater.ini does not end with a newline.
|
||||
; Application to launch after an update has been successfully applied. This
|
||||
; must be in the same directory or a sub-directory of the directory of the
|
||||
; application executable that initiated the software update.
|
||||
[PostUpdateWin]
|
||||
; ExeRelPath is the path to the PostUpdateWin executable relative to the
|
||||
; application executable.
|
||||
ExeRelPath=uninstall\helper.exe
|
||||
; ExeArg is the argument to pass to the PostUpdateWin exe
|
||||
ExeArg=/PostUpdate
|
||||
Loading…
Add table
Add a link
Reference in a new issue