2007-03-22 10:30:00 -07:00
|
|
|
# ***** BEGIN LICENSE BLOCK *****
|
|
|
|
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
#
|
|
|
|
# The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
# 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
# the License. You may obtain a copy of the License at
|
|
|
|
# http://www.mozilla.org/MPL/
|
|
|
|
#
|
|
|
|
# Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
# for the specific language governing rights and limitations under the
|
|
|
|
# License.
|
|
|
|
#
|
|
|
|
# The Original Code is the Mozilla Installer code.
|
|
|
|
#
|
|
|
|
# The Initial Developer of the Original Code is Mozilla Foundation
|
|
|
|
# Portions created by the Initial Developer are Copyright (C) 2006
|
|
|
|
# the Initial Developer. All Rights Reserved.
|
|
|
|
#
|
|
|
|
# Contributor(s):
|
|
|
|
# Robert Strong <robert.bugzilla@gmail.com>
|
|
|
|
#
|
|
|
|
# Alternatively, the contents of this file may be used under the terms of
|
|
|
|
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
# in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
# of those above. If you wish to allow use of your version of this file only
|
|
|
|
# under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
# use your version of this file under the terms of the MPL, indicate your
|
|
|
|
# decision by deleting the provisions above and replace them with the notice
|
|
|
|
# and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
# the provisions above, a recipient may use your version of this file under
|
|
|
|
# the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
#
|
|
|
|
# ***** END LICENSE BLOCK *****
|
|
|
|
|
2007-09-17 19:47:34 -07:00
|
|
|
# Required Plugins:
|
2007-10-19 14:26:30 -07:00
|
|
|
# AppAssocReg http://nsis.sourceforge.net/Application_Association_Registration_plug-in
|
|
|
|
# ShellLink http://nsis.sourceforge.net/ShellLink_plug-in
|
|
|
|
# UAC http://nsis.sourceforge.net/UAC_plug-in
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
; 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
|
|
|
|
|
2008-07-27 18:46:47 -07:00
|
|
|
RequestExecutionLevel user
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
!addplugindir ./
|
|
|
|
|
2009-05-20 15:49:24 -07:00
|
|
|
; On Vista and above attempt to elevate Standard Users in addition to users that
|
|
|
|
; are a member of the Administrators group.
|
|
|
|
!define NONADMIN_ELEVATE
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
; prevents compiling of the reg write logging.
|
|
|
|
!define NO_LOG
|
|
|
|
|
|
|
|
Var TmpVal
|
|
|
|
|
|
|
|
; Other included files may depend upon these includes!
|
|
|
|
; The following includes are provided by NSIS.
|
|
|
|
!include FileFunc.nsh
|
|
|
|
!include LogicLib.nsh
|
2007-10-19 14:26:30 -07:00
|
|
|
!include MUI.nsh
|
2007-03-22 10:30:00 -07:00
|
|
|
!include WinMessages.nsh
|
2008-07-27 18:46:47 -07:00
|
|
|
!include WinVer.nsh
|
2007-03-22 10:30:00 -07:00
|
|
|
!include WordFunc.nsh
|
2007-09-17 19:47:34 -07:00
|
|
|
|
2010-08-27 18:25:25 -07:00
|
|
|
!insertmacro GetSize
|
2007-03-22 10:30:00 -07:00
|
|
|
!insertmacro StrFilter
|
|
|
|
!insertmacro WordReplace
|
|
|
|
|
2007-09-17 19:47:34 -07:00
|
|
|
!insertmacro un.GetParent
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
; 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"
|
2008-07-27 18:46:47 -07:00
|
|
|
VIAddVersionKey "OriginalFilename" "helper.exe"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2009-01-12 22:17:49 -08:00
|
|
|
; Most commonly used macros for managing shortcuts
|
|
|
|
!insertmacro _LoggingShortcutsCommon
|
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
!insertmacro AddDDEHandlerValues
|
2007-07-17 11:11:18 -07:00
|
|
|
!insertmacro CleanVirtualStore
|
2009-05-20 15:49:24 -07:00
|
|
|
!insertmacro ElevateUAC
|
2009-01-12 22:17:49 -08:00
|
|
|
!insertmacro FindSMProgramsDir
|
2007-09-17 19:47:34 -07:00
|
|
|
!insertmacro GetLongPath
|
2007-09-29 02:48:32 -07:00
|
|
|
!insertmacro GetPathFromString
|
|
|
|
!insertmacro IsHandlerForInstallDir
|
|
|
|
!insertmacro RegCleanAppHandler
|
2007-03-22 10:30:00 -07:00
|
|
|
!insertmacro RegCleanMain
|
|
|
|
!insertmacro RegCleanUninstall
|
2010-08-12 21:09:06 -07:00
|
|
|
!insertmacro SetAppLSPCategories
|
2008-03-21 12:56:08 -07:00
|
|
|
!insertmacro SetBrandNameVars
|
2010-05-14 17:24:50 -07:00
|
|
|
!insertmacro UpdateShortcutAppModelIDs
|
2007-10-19 14:26:30 -07:00
|
|
|
!insertmacro UnloadUAC
|
2007-03-22 10:30:00 -07:00
|
|
|
!insertmacro WriteRegDWORD2
|
2007-09-17 19:47:34 -07:00
|
|
|
!insertmacro WriteRegStr2
|
2007-07-31 11:51:58 -07:00
|
|
|
|
2007-10-19 14:26:30 -07:00
|
|
|
!insertmacro un.ChangeMUIHeaderImage
|
2007-11-30 11:02:09 -08:00
|
|
|
!insertmacro un.CheckForFilesInUse
|
2008-03-21 13:25:15 -07:00
|
|
|
!insertmacro un.CleanUpdatesDir
|
2007-07-17 11:11:18 -07:00
|
|
|
!insertmacro un.CleanVirtualStore
|
2007-10-20 15:56:49 -07:00
|
|
|
!insertmacro un.DeleteRelativeProfiles
|
2009-01-12 22:17:49 -08:00
|
|
|
!insertmacro un.DeleteShortcuts
|
2007-09-17 19:47:34 -07:00
|
|
|
!insertmacro un.GetLongPath
|
2007-03-22 10:30:00 -07:00
|
|
|
!insertmacro un.GetSecondInstallPath
|
2007-09-21 15:09:04 -07:00
|
|
|
!insertmacro un.ManualCloseAppPrompt
|
2007-09-17 19:47:34 -07:00
|
|
|
!insertmacro un.ParseUninstallLog
|
2007-09-29 02:48:32 -07:00
|
|
|
!insertmacro un.RegCleanAppHandler
|
|
|
|
!insertmacro un.RegCleanFileHandler
|
2007-09-17 19:47:34 -07:00
|
|
|
!insertmacro un.RegCleanMain
|
|
|
|
!insertmacro un.RegCleanUninstall
|
2007-09-29 02:48:32 -07:00
|
|
|
!insertmacro un.RegCleanProtocolHandler
|
2007-09-17 19:47:34 -07:00
|
|
|
!insertmacro un.RemoveQuotesFromPath
|
2010-08-12 21:09:06 -07:00
|
|
|
!insertmacro un.SetAppLSPCategories
|
2007-10-24 00:02:57 -07:00
|
|
|
!insertmacro un.SetBrandNameVars
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
!include shared.nsh
|
|
|
|
|
2007-09-17 19:47:34 -07:00
|
|
|
; Helper macros for ui callbacks. Insert these after shared.nsh
|
2007-10-19 14:26:30 -07:00
|
|
|
!insertmacro OnEndCommon
|
2007-09-17 19:47:34 -07:00
|
|
|
!insertmacro UninstallOnInitCommon
|
|
|
|
|
2007-10-19 14:26:30 -07:00
|
|
|
!insertmacro un.OnEndCommon
|
2010-08-27 18:25:25 -07:00
|
|
|
!insertmacro un.UninstallUnOnInitCommon
|
2007-10-19 14:26:30 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
Name "${BrandFullName}"
|
|
|
|
OutFile "helper.exe"
|
2010-08-27 18:25:25 -07:00
|
|
|
!ifdef HAVE_64BIT_OS
|
|
|
|
InstallDir "$PROGRAMFILES64\${BrandFullName}\"
|
|
|
|
!else
|
|
|
|
InstallDir "$PROGRAMFILES32\${BrandFullName}\"
|
|
|
|
!endif
|
2007-03-22 10:30:00 -07:00
|
|
|
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
|
2007-10-19 14:26:30 -07:00
|
|
|
!define MUI_PAGE_CUSTOMFUNCTION_PRE un.preWelcome
|
2007-11-30 11:02:09 -08:00
|
|
|
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE un.leaveWelcome
|
2007-03-22 10:30:00 -07:00
|
|
|
!insertmacro MUI_UNPAGE_WELCOME
|
|
|
|
|
2008-09-09 19:17:16 -07:00
|
|
|
; Custom Uninstall Confirm Page
|
2007-10-20 15:56:49 -07:00
|
|
|
UninstPage custom un.preConfirm un.leaveConfirm
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
; Remove Files Page
|
|
|
|
!insertmacro MUI_UNPAGE_INSTFILES
|
|
|
|
|
|
|
|
; Finish Page
|
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
; Don't setup the survey controls, functions, etc. when the application has
|
2007-03-22 10:30:00 -07:00
|
|
|
; defined NO_UNINSTALL_SURVEY
|
|
|
|
!ifndef NO_UNINSTALL_SURVEY
|
2007-09-29 02:48:32 -07:00
|
|
|
!define MUI_PAGE_CUSTOMFUNCTION_PRE un.preFinish
|
|
|
|
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
|
|
|
|
!define MUI_FINISHPAGE_SHOWREADME ""
|
2007-03-22 10:30:00 -07:00
|
|
|
!define MUI_FINISHPAGE_SHOWREADME_TEXT $(SURVEY_TEXT)
|
|
|
|
!define MUI_FINISHPAGE_SHOWREADME_FUNCTION un.Survey
|
|
|
|
!endif
|
|
|
|
|
|
|
|
!insertmacro MUI_UNPAGE_FINISH
|
|
|
|
|
2007-11-30 11:02:09 -08:00
|
|
|
; Use the default dialog for IDD_VERIFY for a simple Banner
|
|
|
|
ChangeUI IDD_VERIFY "${NSISDIR}\Contrib\UIs\default.exe"
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
################################################################################
|
|
|
|
# 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
|
2007-09-17 19:47:34 -07:00
|
|
|
|
2007-09-21 15:09:04 -07:00
|
|
|
; 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
|
2010-08-27 18:25:25 -07:00
|
|
|
; can still delete the files when the system is restarted.
|
2007-09-21 15:09:04 -07:00
|
|
|
Sleep 5000
|
|
|
|
${DeleteFile} "$INSTDIR\${FileMainEXE}"
|
|
|
|
ClearErrors
|
|
|
|
${EndIf}
|
|
|
|
|
2007-10-20 15:56:49 -07:00
|
|
|
${MUI_INSTALLOPTIONS_READ} $0 "unconfirm.ini" "Field 3" "State"
|
|
|
|
${If} "$0" == "1"
|
|
|
|
${un.DeleteRelativeProfiles} "Mozilla\Firefox"
|
2008-04-14 17:08:07 -07:00
|
|
|
RmDir "$APPDATA\Mozilla\Extensions\{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
|
|
|
|
RmDir "$APPDATA\Mozilla\Extensions"
|
|
|
|
RmDir "$APPDATA\Mozilla"
|
2007-10-20 15:56:49 -07:00
|
|
|
${EndIf}
|
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
SetShellVarContext current ; Set SHCTX to HKCU
|
2007-03-22 10:30:00 -07:00
|
|
|
${un.RegCleanMain} "Software\Mozilla"
|
2007-09-17 19:47:34 -07:00
|
|
|
${un.RegCleanUninstall}
|
2009-01-12 22:17:49 -08:00
|
|
|
${un.DeleteShortcuts}
|
2007-09-17 19:47:34 -07:00
|
|
|
|
2010-05-14 17:24:01 -07:00
|
|
|
; Unregister resources associated with Win7 taskbar jump lists.
|
|
|
|
ApplicationID::UninstallJumpLists "${AppUserModelID}"
|
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
ClearErrors
|
2009-02-04 20:36:16 -08:00
|
|
|
WriteRegStr HKLM "Software\Mozilla" "${BrandShortName}InstallerTest" "Write Test"
|
2007-09-29 02:48:32 -07:00
|
|
|
${If} ${Errors}
|
|
|
|
StrCpy $TmpVal "HKCU" ; used primarily for logging
|
|
|
|
${Else}
|
|
|
|
SetShellVarContext all ; Set SHCTX to HKLM
|
2009-02-04 20:36:16 -08:00
|
|
|
DeleteRegValue HKLM "Software\Mozilla" "${BrandShortName}InstallerTest"
|
2007-09-29 02:48:32 -07:00
|
|
|
StrCpy $TmpVal "HKLM" ; used primarily for logging
|
|
|
|
${un.RegCleanMain} "Software\Mozilla"
|
|
|
|
${un.RegCleanUninstall}
|
2009-01-12 22:17:49 -08:00
|
|
|
${un.DeleteShortcuts}
|
2010-08-12 21:09:06 -07:00
|
|
|
${un.SetAppLSPCategories}
|
2007-09-29 02:48:32 -07:00
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
${un.RegCleanAppHandler} "FirefoxURL"
|
|
|
|
${un.RegCleanAppHandler} "FirefoxHTML"
|
|
|
|
${un.RegCleanProtocolHandler} "ftp"
|
|
|
|
${un.RegCleanProtocolHandler} "http"
|
|
|
|
${un.RegCleanProtocolHandler} "https"
|
|
|
|
|
|
|
|
ClearErrors
|
|
|
|
ReadRegStr $R9 HKCR "FirefoxHTML" ""
|
|
|
|
; Don't clean up the file handlers if the FirefoxHTML key still exists since
|
|
|
|
; there should be a second installation that may be the default file handler
|
|
|
|
${If} ${Errors}
|
|
|
|
${un.RegCleanFileHandler} ".htm" "FirefoxHTML"
|
|
|
|
${un.RegCleanFileHandler} ".html" "FirefoxHTML"
|
|
|
|
${un.RegCleanFileHandler} ".shtml" "FirefoxHTML"
|
|
|
|
${un.RegCleanFileHandler} ".xht" "FirefoxHTML"
|
|
|
|
${un.RegCleanFileHandler} ".xhtml" "FirefoxHTML"
|
|
|
|
${EndIf}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
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"
|
2007-09-17 19:47:34 -07:00
|
|
|
ReadRegStr $R1 HKLM "$0" ""
|
|
|
|
${un.RemoveQuotesFromPath} "$R1" $R1
|
|
|
|
${un.GetParent} "$R1" $R1
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
; 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 Firefox 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}
|
|
|
|
|
|
|
|
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"
|
2010-11-11 12:09:25 -08:00
|
|
|
StrCpy $0 "Software\Microsoft\MediaPlayer\ShimInclusionList\plugin-container.exe"
|
|
|
|
DeleteRegKey HKLM "$0"
|
|
|
|
DeleteRegKey HKCU "$0"
|
2007-09-29 02:48:32 -07:00
|
|
|
StrCpy $0 "Software\Classes\MIME\Database\Content Type\application/x-xpinstall;app=firefox"
|
|
|
|
DeleteRegKey HKLM "$0"
|
|
|
|
DeleteRegKey HKCU "$0"
|
2007-03-22 10:30:00 -07:00
|
|
|
${Else}
|
2007-09-17 19:47:34 -07:00
|
|
|
ReadRegStr $R1 HKLM "$0" ""
|
|
|
|
${un.RemoveQuotesFromPath} "$R1" $R1
|
|
|
|
${un.GetParent} "$R1" $R1
|
2007-03-22 10:30:00 -07:00
|
|
|
${If} "$INSTDIR" == "$R1"
|
|
|
|
WriteRegStr HKLM "$0" "" "$R9"
|
2007-09-17 19:47:34 -07:00
|
|
|
${un.GetParent} "$R9" $R1
|
2007-03-22 10:30:00 -07:00
|
|
|
WriteRegStr HKLM "$0" "Path" "$R1"
|
|
|
|
${EndIf}
|
|
|
|
${EndIf}
|
|
|
|
|
2007-09-21 15:09:04 -07:00
|
|
|
; 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\defaults\shortcuts"
|
|
|
|
RmDir /r /REBOOTOK "$INSTDIR\defaults\shortcuts"
|
|
|
|
${EndIf}
|
|
|
|
${If} ${FileExists} "$INSTDIR\distribution"
|
|
|
|
RmDir /r /REBOOTOK "$INSTDIR\distribution"
|
|
|
|
${EndIf}
|
|
|
|
${If} ${FileExists} "$INSTDIR\removed-files"
|
|
|
|
Delete /REBOOTOK "$INSTDIR\removed-files"
|
|
|
|
${EndIf}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-03-21 13:25:15 -07:00
|
|
|
; Remove the updates directory for Vista and above
|
|
|
|
${un.CleanUpdatesDir} "Mozilla\Firefox"
|
|
|
|
|
|
|
|
; Remove files that may be left behind by the application in the
|
|
|
|
; VirtualStore directory.
|
|
|
|
${un.CleanVirtualStore}
|
|
|
|
|
2007-09-17 19:47:34 -07:00
|
|
|
; Parse the uninstall log to unregister dll's and remove all installed
|
|
|
|
; files / directories this install is responsible for.
|
|
|
|
${un.ParseUninstallLog}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-09-17 19:47:34 -07:00
|
|
|
; Remove the uninstall directory that we control
|
2007-09-21 15:09:04 -07:00
|
|
|
RmDir /r /REBOOTOK "$INSTDIR\uninstall"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-09-17 19:47:34 -07:00
|
|
|
; Remove the installation directory if it is empty
|
|
|
|
${RemoveDir} "$INSTDIR"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-09-21 15:09:04 -07:00
|
|
|
; If firefox.exe was successfully deleted yet we still need to restart to
|
|
|
|
; remove other files create a dummy firefox.exe.moz-delete to prevent the
|
|
|
|
; installer from allowing an install without restart when it is required
|
|
|
|
; to complete an uninstall.
|
|
|
|
${If} ${RebootFlag}
|
|
|
|
${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}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
; Refresh desktop icons otherwise the start menu internet item won't be
|
2007-09-17 19:47:34 -07:00
|
|
|
; removed and other ugly things will happen like recreation of the app's
|
|
|
|
; clients registry key by the OS under some conditions.
|
2007-03-22 10:30:00 -07:00
|
|
|
System::Call "shell32::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)"
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Helper Functions
|
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
; Don't setup the survey controls, functions, etc. when the application has
|
2007-03-22 10:30:00 -07:00
|
|
|
; defined NO_UNINSTALL_SURVEY
|
|
|
|
!ifndef NO_UNINSTALL_SURVEY
|
|
|
|
Function un.Survey
|
|
|
|
Exec "$\"$TmpVal$\" $\"${SurveyURL}$\""
|
|
|
|
FunctionEnd
|
|
|
|
!endif
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# 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 " "
|
|
|
|
|
|
|
|
################################################################################
|
2007-10-19 14:26:30 -07:00
|
|
|
# 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
|
|
|
|
|
2007-11-30 11:02:09 -08:00
|
|
|
Function un.leaveWelcome
|
|
|
|
${If} ${FileExists} "$INSTDIR\${FileMainEXE}"
|
|
|
|
Banner::show /NOUNLOAD "$(BANNER_CHECK_EXISTING)"
|
|
|
|
|
2008-10-20 12:08:26 -07:00
|
|
|
; If the message window has been found previously give the app an additional
|
|
|
|
; five seconds to close.
|
2007-11-30 11:02:09 -08:00
|
|
|
${If} "$TmpVal" == "FoundMessageWindow"
|
|
|
|
Sleep 5000
|
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
${PushFilesToCheck}
|
|
|
|
|
|
|
|
${un.CheckForFilesInUse} $TmpVal
|
|
|
|
|
|
|
|
Banner::destroy
|
|
|
|
|
2008-10-20 12:08:26 -07:00
|
|
|
; If there are files in use $TmpVal will be "true"
|
2007-11-30 11:02:09 -08:00
|
|
|
${If} "$TmpVal" == "true"
|
2008-10-20 12:08:26 -07:00
|
|
|
; If the message window is found the call to ManualCloseAppPrompt will
|
|
|
|
; abort leaving the value of $TmpVal set to "FoundMessageWindow".
|
2007-11-30 11:02:09 -08:00
|
|
|
StrCpy $TmpVal "FoundMessageWindow"
|
|
|
|
${un.ManualCloseAppPrompt} "${WindowClass}" "$(WARN_MANUALLY_CLOSE_APP_UNINSTALL)"
|
2008-10-20 12:08:26 -07:00
|
|
|
; If the message window is not found set $TmpVal to "true" so the restart
|
|
|
|
; required message is displayed.
|
2007-11-30 11:02:09 -08:00
|
|
|
StrCpy $TmpVal "true"
|
|
|
|
${EndIf}
|
|
|
|
${EndIf}
|
|
|
|
FunctionEnd
|
|
|
|
|
2007-10-20 15:56:49 -07:00
|
|
|
Function un.preConfirm
|
2007-10-19 14:26:30 -07:00
|
|
|
${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}
|
2007-10-20 15:56:49 -07:00
|
|
|
|
2008-09-09 19:17:16 -07:00
|
|
|
; Setup the unconfirm.ini file for the Custom Uninstall Confirm Page
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Settings" NumFields "5"
|
|
|
|
|
|
|
|
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 "checkbox"
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Text "$(UN_REMOVE_PROFILES)"
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Left "0"
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Right "-1"
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Top "40"
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Bottom "50"
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" State "0"
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" flags "NOTIFY"
|
|
|
|
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Type "text"
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" State "$(UN_REMOVE_PROFILES_DESC)"
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Left "0"
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Right "-1"
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Top "52"
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Bottom "120"
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" flags "MULTILINE|READONLY"
|
|
|
|
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 5" Type "label"
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 5" Text "$(UN_CONFIRM_CLICK)"
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 5" Left "0"
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 5" Right "-1"
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 5" Top "130"
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 5" Bottom "150"
|
|
|
|
|
|
|
|
${If} "$TmpVal" == "true"
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 6" Type "label"
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 6" Text "$(SUMMARY_REBOOT_REQUIRED_UNINSTALL)"
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 6" Left "0"
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 6" Right "-1"
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 6" Top "35"
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 6" Bottom "45"
|
|
|
|
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Settings" NumFields "6"
|
|
|
|
|
|
|
|
; To insert this control reset Top / Bottom for controls below this one
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Top "55"
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Bottom "65"
|
|
|
|
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Top "67"
|
|
|
|
${EndIf}
|
|
|
|
|
2007-10-20 15:56:49 -07:00
|
|
|
!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
|
|
|
|
${MUI_INSTALLOPTIONS_READ} $1 "unconfirm.ini" "Field 4" "HWND"
|
|
|
|
SetCtlColors $1 0x000000 0xFFFFEE
|
|
|
|
ShowWindow $1 ${SW_HIDE}
|
|
|
|
System::Call "user32::SetFocus(i r0, i 0x0007, i,i)i"
|
2007-11-30 11:02:09 -08:00
|
|
|
${MUI_INSTALLOPTIONS_READ} $1 "unconfirm.ini" "Field 2" "HWND"
|
|
|
|
SendMessage $1 ${WM_SETTEXT} 0 "STR:$INSTDIR"
|
2007-10-20 15:56:49 -07:00
|
|
|
!insertmacro MUI_INSTALLOPTIONS_SHOW
|
2007-10-19 14:26:30 -07:00
|
|
|
FunctionEnd
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-09-21 15:09:04 -07:00
|
|
|
Function un.leaveConfirm
|
2007-10-20 15:56:49 -07:00
|
|
|
${MUI_INSTALLOPTIONS_READ} $0 "unconfirm.ini" "Settings" "State"
|
|
|
|
StrCmp $0 "3" +1 continue
|
|
|
|
${MUI_INSTALLOPTIONS_READ} $0 "unconfirm.ini" "Field 3" "State"
|
|
|
|
${MUI_INSTALLOPTIONS_READ} $1 "unconfirm.ini" "Field 4" "HWND"
|
|
|
|
StrCmp $0 1 +1 +3
|
|
|
|
ShowWindow $1 ${SW_SHOW}
|
|
|
|
Abort
|
|
|
|
|
|
|
|
ShowWindow $1 ${SW_HIDE}
|
|
|
|
Abort
|
|
|
|
|
|
|
|
continue:
|
|
|
|
|
2007-09-21 15:09:04 -07:00
|
|
|
; Try to delete the app executable and if we can't delete it try to find the
|
|
|
|
; app's message window and prompt the user to close the app. This allows
|
|
|
|
; running an instance that is located in another directory. If for whatever
|
|
|
|
; reason there is no message window we will just rename the app's files and
|
|
|
|
; then remove them on restart if they are in use.
|
2007-03-22 10:30:00 -07:00
|
|
|
ClearErrors
|
2007-09-21 15:09:04 -07:00
|
|
|
${DeleteFile} "$INSTDIR\${FileMainEXE}"
|
2007-03-22 10:30:00 -07:00
|
|
|
${If} ${Errors}
|
2007-09-21 15:09:04 -07:00
|
|
|
${un.ManualCloseAppPrompt} "${WindowClass}" "$(WARN_MANUALLY_CLOSE_APP_UNINSTALL)"
|
2007-03-22 10:30:00 -07:00
|
|
|
${EndIf}
|
|
|
|
FunctionEnd
|
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
!ifndef NO_UNINSTALL_SURVEY
|
2007-03-22 10:30:00 -07:00
|
|
|
Function un.preFinish
|
2007-09-21 15:09:04 -07:00
|
|
|
; Do not modify the finish page if there is a reboot pending
|
|
|
|
${Unless} ${RebootFlag}
|
|
|
|
; Setup the survey controls, functions, etc.
|
2007-03-22 10:30:00 -07:00
|
|
|
StrCpy $TmpVal "SOFTWARE\Microsoft\IE Setup\Setup"
|
|
|
|
ClearErrors
|
|
|
|
ReadRegStr $0 HKLM $TmpVal "Path"
|
|
|
|
${If} ${Errors}
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "settings" "NumFields" "3"
|
|
|
|
${Else}
|
|
|
|
ExpandEnvStrings $0 "$0" ; this value will usually contain %programfiles%
|
|
|
|
${If} $0 != "\"
|
|
|
|
StrCpy $0 "$0\"
|
|
|
|
${EndIf}
|
|
|
|
StrCpy $0 "$0\iexplore.exe"
|
|
|
|
ClearErrors
|
|
|
|
GetFullPathName $TmpVal $0
|
|
|
|
${If} ${Errors}
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "settings" "NumFields" "3"
|
2007-09-21 15:09:04 -07:00
|
|
|
${Else}
|
|
|
|
; When we add an optional action to the finish page the cancel button
|
|
|
|
; is enabled. This disables it and leaves the finish button as the
|
|
|
|
; only choice.
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "settings" "cancelenabled" "0"
|
2007-03-22 10:30:00 -07:00
|
|
|
${EndIf}
|
|
|
|
${EndIf}
|
2007-09-21 15:09:04 -07:00
|
|
|
${EndUnless}
|
2007-03-22 10:30:00 -07:00
|
|
|
FunctionEnd
|
2007-09-29 02:48:32 -07:00
|
|
|
!endif
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Initialization Functions
|
2007-09-29 02:48:32 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
Function .onInit
|
2007-09-17 19:47:34 -07:00
|
|
|
${UninstallOnInitCommon}
|
2007-03-22 10:30:00 -07:00
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function un.onInit
|
|
|
|
StrCpy $LANGUAGE 0
|
2007-10-19 14:26:30 -07:00
|
|
|
|
2010-08-27 18:25:25 -07:00
|
|
|
${un.UninstallUnOnInitCommon}
|
2009-01-12 22:17:49 -08:00
|
|
|
|
|
|
|
!insertmacro InitInstallOptionsFile "unconfirm.ini"
|
2007-10-19 14:26:30 -07:00
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function .onGUIEnd
|
|
|
|
${OnEndCommon}
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function un.onGUIEnd
|
|
|
|
${un.OnEndCommon}
|
2007-03-22 10:30:00 -07:00
|
|
|
FunctionEnd
|