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
|
|
|
|
|
|
|
|
!addplugindir ./
|
|
|
|
|
|
|
|
; empty files - except for the comment line - for generating custom pages.
|
|
|
|
!system 'echo ; > options.ini'
|
|
|
|
!system 'echo ; > components.ini'
|
|
|
|
!system 'echo ; > shortcuts.ini'
|
2007-09-21 15:09:04 -07:00
|
|
|
!system 'echo ; > summary.ini'
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
; USE_UAC_PLUGIN is temporary until Thunderbird has been updated to use the UAC plugin
|
|
|
|
!define USE_UAC_PLUGIN
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
Var TmpVal
|
|
|
|
Var StartMenuDir
|
|
|
|
Var InstallType
|
|
|
|
Var AddStartMenuSC
|
|
|
|
Var AddQuickLaunchSC
|
|
|
|
Var AddDesktopSC
|
|
|
|
|
|
|
|
; Other included files may depend upon these includes!
|
|
|
|
; The following includes are provided by NSIS.
|
|
|
|
!include FileFunc.nsh
|
|
|
|
!include LogicLib.nsh
|
|
|
|
!include TextFunc.nsh
|
|
|
|
!include WinMessages.nsh
|
|
|
|
!include WordFunc.nsh
|
|
|
|
!include MUI.nsh
|
|
|
|
|
2007-09-17 19:47:34 -07:00
|
|
|
; WinVer.nsh was added in the same release that RequestExecutionLevel so check
|
|
|
|
; if ___WINVER__NSH___ is defined to determine if RequestExecutionLevel is
|
|
|
|
; available.
|
|
|
|
!include /NONFATAL WinVer.nsh
|
|
|
|
!ifdef ___WINVER__NSH___
|
2007-09-29 02:48:32 -07:00
|
|
|
RequestExecutionLevel user
|
2007-09-17 19:47:34 -07:00
|
|
|
!else
|
|
|
|
!warning "Installer will be created without Vista compatibility.$\n \
|
|
|
|
Upgrade your NSIS installation to at least version 2.22 to resolve."
|
|
|
|
!endif
|
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
!insertmacro GetOptions
|
|
|
|
!insertmacro GetParameters
|
|
|
|
!insertmacro GetSize
|
2007-03-22 10:30:00 -07:00
|
|
|
!insertmacro StrFilter
|
|
|
|
!insertmacro WordReplace
|
|
|
|
|
|
|
|
; NSIS provided macros that we have overridden
|
|
|
|
!include overrides.nsh
|
|
|
|
!insertmacro LocateNoDetails
|
|
|
|
!insertmacro TextCompareNoDetails
|
|
|
|
|
|
|
|
; The following includes are custom.
|
|
|
|
!include branding.nsi
|
|
|
|
!include defines.nsi
|
|
|
|
!include common.nsh
|
|
|
|
!include locales.nsi
|
|
|
|
!include version.nsh
|
|
|
|
|
|
|
|
VIAddVersionKey "FileDescription" "${BrandShortName} Installer"
|
|
|
|
|
2007-09-17 19:47:34 -07:00
|
|
|
; Must be inserted before other macros that use logging
|
|
|
|
!insertmacro _LoggingCommon
|
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
!insertmacro AddDDEHandlerValues
|
2007-10-19 14:26:30 -07:00
|
|
|
!insertmacro ChangeMUIHeaderImage
|
2007-11-30 11:02:09 -08:00
|
|
|
!insertmacro CheckForFilesInUse
|
2007-08-22 14:38:03 -07:00
|
|
|
!insertmacro CloseApp
|
2007-11-30 11:02:09 -08:00
|
|
|
!insertmacro CopyFilesFromDir
|
2007-08-22 14:38:03 -07:00
|
|
|
!insertmacro CreateRegKey
|
2007-09-29 02:48:32 -07:00
|
|
|
!insertmacro GetPathFromString
|
2007-10-19 14:26:30 -07:00
|
|
|
!insertmacro GetParent
|
2007-09-29 02:48:32 -07:00
|
|
|
!insertmacro IsHandlerForInstallDir
|
2007-09-21 15:09:04 -07:00
|
|
|
!insertmacro ManualCloseAppPrompt
|
2007-09-29 02:48:32 -07:00
|
|
|
!insertmacro RegCleanAppHandler
|
2007-03-22 10:30:00 -07:00
|
|
|
!insertmacro RegCleanMain
|
|
|
|
!insertmacro RegCleanUninstall
|
2007-10-24 00:02:57 -07:00
|
|
|
!insertmacro SetBrandNameVars
|
2007-10-19 14:26:30 -07:00
|
|
|
!insertmacro UnloadUAC
|
2007-03-22 10:30:00 -07:00
|
|
|
!insertmacro WriteRegStr2
|
|
|
|
!insertmacro WriteRegDWORD2
|
|
|
|
|
|
|
|
!include shared.nsh
|
|
|
|
|
2007-09-17 19:47:34 -07:00
|
|
|
; Helper macros for ui callbacks. Insert these after shared.nsh
|
|
|
|
!insertmacro CheckCustomCommon
|
|
|
|
!insertmacro InstallEndCleanupCommon
|
|
|
|
!insertmacro InstallOnInitCommon
|
|
|
|
!insertmacro InstallStartCleanupCommon
|
|
|
|
!insertmacro LeaveDirectoryCommon
|
2007-10-19 14:26:30 -07:00
|
|
|
!insertmacro OnEndCommon
|
2007-09-17 19:47:34 -07:00
|
|
|
!insertmacro PreDirectoryCommon
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
Name "${BrandFullName}"
|
|
|
|
OutFile "setup.exe"
|
|
|
|
InstallDirRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${BrandFullNameInternal} (${AppVersion})" "InstallLocation"
|
|
|
|
InstallDir "$PROGRAMFILES\${BrandFullName}\"
|
|
|
|
ShowInstDetails nevershow
|
|
|
|
|
|
|
|
ReserveFile options.ini
|
|
|
|
ReserveFile components.ini
|
|
|
|
ReserveFile shortcuts.ini
|
2007-09-21 15:09:04 -07:00
|
|
|
ReserveFile summary.ini
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# 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_WELCOMEFINISHPAGE_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
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Installation Pages
|
|
|
|
*/
|
|
|
|
; Welcome Page
|
2007-10-19 14:26:30 -07:00
|
|
|
!define MUI_PAGE_CUSTOMFUNCTION_PRE preWelcome
|
2007-03-22 10:30:00 -07:00
|
|
|
!insertmacro MUI_PAGE_WELCOME
|
|
|
|
|
|
|
|
; License Page
|
2007-10-19 14:26:30 -07:00
|
|
|
!define MUI_PAGE_CUSTOMFUNCTION_SHOW showLicense
|
2007-09-18 20:27:17 -07:00
|
|
|
!define MUI_LICENSEPAGE_CHECKBOX
|
2007-03-22 10:30:00 -07:00
|
|
|
!insertmacro MUI_PAGE_LICENSE license.rtf
|
|
|
|
|
|
|
|
; Custom Options Page
|
|
|
|
Page custom preOptions leaveOptions
|
|
|
|
|
|
|
|
; Custom Components Page
|
|
|
|
Page custom preComponents leaveComponents
|
|
|
|
|
|
|
|
; Select Install Directory Page
|
|
|
|
!define MUI_PAGE_CUSTOMFUNCTION_PRE preDirectory
|
|
|
|
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE leaveDirectory
|
|
|
|
!define MUI_DIRECTORYPAGE_VERIFYONLEAVE
|
|
|
|
!insertmacro MUI_PAGE_DIRECTORY
|
|
|
|
|
|
|
|
; Custom Shortcuts Page
|
|
|
|
Page custom preShortcuts leaveShortcuts
|
|
|
|
|
|
|
|
; Start Menu Folder Page Configuration
|
|
|
|
!define MUI_PAGE_CUSTOMFUNCTION_PRE preStartMenu
|
2007-11-30 11:02:09 -08:00
|
|
|
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE leaveStartMenu
|
2007-03-22 10:30:00 -07:00
|
|
|
!define MUI_STARTMENUPAGE_NODISABLE
|
|
|
|
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
|
|
|
|
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Mozilla\${BrandFullNameInternal}\${AppVersion} (${AB_CD})\Main"
|
|
|
|
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
|
|
|
|
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuDir
|
|
|
|
|
2007-09-21 15:09:04 -07:00
|
|
|
; Custom Summary Page
|
|
|
|
Page custom preSummary leaveSummary
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
; Install Files Page
|
|
|
|
!insertmacro MUI_PAGE_INSTFILES
|
|
|
|
|
|
|
|
; Finish Page
|
|
|
|
!define MUI_FINISHPAGE_TITLE_3LINES
|
|
|
|
!define MUI_FINISHPAGE_RUN
|
|
|
|
!define MUI_FINISHPAGE_RUN_FUNCTION LaunchApp
|
|
|
|
!define MUI_FINISHPAGE_RUN_TEXT $(LAUNCH_TEXT)
|
|
|
|
!define MUI_PAGE_CUSTOMFUNCTION_PRE preFinish
|
|
|
|
!insertmacro MUI_PAGE_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
|
|
|
|
|
2007-09-17 19:47:34 -07:00
|
|
|
; Cleanup operations to perform at the start of the installation.
|
|
|
|
Section "-InstallStartCleanup"
|
|
|
|
SetDetailsPrint both
|
2007-03-22 10:30:00 -07:00
|
|
|
DetailPrint $(STATUS_CLEANUP)
|
|
|
|
SetDetailsPrint none
|
|
|
|
|
2007-10-19 14:26:30 -07:00
|
|
|
SetOutPath "$INSTDIR"
|
2007-09-17 19:47:34 -07:00
|
|
|
${StartInstallLog} "${BrandFullName}" "${AB_CD}" "${AppVersion}" "${GREVersion}"
|
|
|
|
|
2007-11-30 11:02:09 -08:00
|
|
|
; Delete the app exe to prevent launching the app while we are installing.
|
|
|
|
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 rename the file and then delete is when the system is restarted.
|
|
|
|
Sleep 5000
|
|
|
|
${DeleteFile} "$INSTDIR\${FileMainEXE}"
|
2007-03-22 10:30:00 -07:00
|
|
|
ClearErrors
|
|
|
|
${EndIf}
|
|
|
|
|
2007-09-17 19:47:34 -07:00
|
|
|
${If} $InstallType == ${INSTALLTYPE_CUSTOM}
|
2007-03-22 10:30:00 -07:00
|
|
|
; Custom installs.
|
|
|
|
; If DOMi is installed and this install includes DOMi remove it from
|
|
|
|
; the installation directory. This will remove it if the user deselected
|
|
|
|
; DOMi on the components page.
|
|
|
|
${If} ${FileExists} "$INSTDIR\extensions\inspector@mozilla.org"
|
|
|
|
${AndIf} ${FileExists} "$EXEDIR\optional\extensions\inspector@mozilla.org"
|
|
|
|
RmDir /r "$INSTDIR\extensions\inspector@mozilla.org"
|
|
|
|
${EndIf}
|
|
|
|
${EndIf}
|
|
|
|
|
2007-09-17 19:47:34 -07:00
|
|
|
${InstallStartCleanupCommon}
|
|
|
|
SectionEnd
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-09-17 19:47:34 -07:00
|
|
|
Section "-Application" APP_IDX
|
|
|
|
${StartUninstallLog}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-09-17 19:47:34 -07:00
|
|
|
SetDetailsPrint both
|
2007-03-22 10:30:00 -07:00
|
|
|
DetailPrint $(STATUS_INSTALL_APP)
|
|
|
|
SetDetailsPrint none
|
2007-09-17 19:47:34 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
${LogHeader} "Installing Main Files"
|
2007-11-30 11:02:09 -08:00
|
|
|
${CopyFilesFromDir} "$EXEDIR\nonlocalized" "$INSTDIR" \
|
|
|
|
"$(ERROR_CREATE_DIRECTORY_PREFIX)" \
|
|
|
|
"$(ERROR_CREATE_DIRECTORY_SUFFIX)"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
; Register DLLs
|
|
|
|
; XXXrstrong - AccessibleMarshal.dll can be used by multiple applications but
|
|
|
|
; is only registered for the last application installed. When the last
|
|
|
|
; application installed is uninstalled AccessibleMarshal.dll will no longer be
|
|
|
|
; registered. bug 338878
|
|
|
|
${LogHeader} "DLL Registration"
|
|
|
|
ClearErrors
|
|
|
|
RegDLL "$INSTDIR\AccessibleMarshal.dll"
|
|
|
|
${If} ${Errors}
|
|
|
|
${LogMsg} "** ERROR Registering: $INSTDIR\AccessibleMarshal.dll **"
|
|
|
|
${Else}
|
|
|
|
${LogUninstall} "DLLReg: \AccessibleMarshal.dll"
|
|
|
|
${LogMsg} "Registered: $INSTDIR\AccessibleMarshal.dll"
|
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
; Write extra files created by the application to the uninstall.log so they
|
|
|
|
; will be removed when the application is uninstalled. To remove an empty
|
|
|
|
; directory write a bogus filename to the deepest directory and all empty
|
|
|
|
; parent directories will be removed.
|
|
|
|
${LogUninstall} "File: \components\compreg.dat"
|
|
|
|
${LogUninstall} "File: \components\xpti.dat"
|
|
|
|
${LogUninstall} "File: \.autoreg"
|
|
|
|
${LogUninstall} "File: \active-update.xml"
|
|
|
|
${LogUninstall} "File: \install.log"
|
|
|
|
${LogUninstall} "File: \install_status.log"
|
|
|
|
${LogUninstall} "File: \install_wizard.log"
|
|
|
|
${LogUninstall} "File: \updates.xml"
|
|
|
|
|
2007-09-17 19:47:34 -07:00
|
|
|
SetDetailsPrint both
|
2007-03-22 10:30:00 -07:00
|
|
|
DetailPrint $(STATUS_INSTALL_LANG)
|
|
|
|
SetDetailsPrint none
|
2007-09-17 19:47:34 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
${LogHeader} "Installing Localized Files"
|
2007-11-30 11:02:09 -08:00
|
|
|
${CopyFilesFromDir} "$EXEDIR\localized" "$INSTDIR" \
|
|
|
|
"$(ERROR_CREATE_DIRECTORY_PREFIX)" \
|
|
|
|
"$(ERROR_CREATE_DIRECTORY_SUFFIX)"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
${LogHeader} "Adding Additional Files"
|
|
|
|
; Check if QuickTime is installed and copy the nsIQTScriptablePlugin.xpt from
|
|
|
|
; its plugins directory into the app's components directory.
|
|
|
|
ClearErrors
|
|
|
|
ReadRegStr $R0 HKLM "Software\Apple Computer, Inc.\QuickTime" "InstallDir"
|
|
|
|
${Unless} ${Errors}
|
|
|
|
Push $R0
|
|
|
|
${GetPathFromRegStr}
|
|
|
|
Pop $R0
|
|
|
|
${Unless} ${Errors}
|
|
|
|
GetFullPathName $R0 "$R0\Plugins\nsIQTScriptablePlugin.xpt"
|
|
|
|
${Unless} ${Errors}
|
|
|
|
${LogHeader} "Copying QuickTime Scriptable Component"
|
|
|
|
CopyFiles /SILENT "$R0" "$INSTDIR\components"
|
|
|
|
${If} ${Errors}
|
|
|
|
${LogMsg} "** ERROR Installing File: $INSTDIR\components\nsIQTScriptablePlugin.xpt **"
|
|
|
|
${Else}
|
|
|
|
${LogMsg} "Installed File: $INSTDIR\components\nsIQTScriptablePlugin.xpt"
|
2007-07-09 11:45:42 -07:00
|
|
|
${LogUninstall} "File: \components\nsIQTScriptablePlugin.xpt"
|
2007-03-22 10:30:00 -07:00
|
|
|
${EndIf}
|
|
|
|
${EndUnless}
|
|
|
|
${EndUnless}
|
|
|
|
${EndUnless}
|
|
|
|
ClearErrors
|
|
|
|
|
|
|
|
; Default for creating Start Menu folder and shortcuts
|
|
|
|
; (1 = create, 0 = don't create)
|
|
|
|
${If} $AddStartMenuSC == ""
|
|
|
|
StrCpy $AddStartMenuSC "1"
|
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
; Default for creating Quick Launch shortcut (1 = create, 0 = don't create)
|
|
|
|
${If} $AddQuickLaunchSC == ""
|
|
|
|
StrCpy $AddQuickLaunchSC "1"
|
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
; Default for creating Desktop shortcut (1 = create, 0 = don't create)
|
|
|
|
${If} $AddDesktopSC == ""
|
|
|
|
StrCpy $AddDesktopSC "1"
|
|
|
|
${EndIf}
|
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
${LogHeader} "Adding Registry Entries"
|
2007-03-22 10:30:00 -07:00
|
|
|
SetShellVarContext current ; Set SHCTX to HKCU
|
|
|
|
${RegCleanMain} "Software\Mozilla"
|
2007-09-17 19:47:34 -07:00
|
|
|
${RegCleanUninstall}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
ClearErrors
|
|
|
|
WriteRegStr HKLM "Software\Mozilla\InstallerTest" "InstallerTest" "Test"
|
|
|
|
${If} ${Errors}
|
|
|
|
StrCpy $TmpVal "HKCU" ; used primarily for logging
|
|
|
|
${Else}
|
|
|
|
SetShellVarContext all ; Set SHCTX to HKLM
|
|
|
|
DeleteRegKey HKLM "Software\Mozilla\InstallerTest"
|
|
|
|
StrCpy $TmpVal "HKLM" ; used primarily for logging
|
2007-09-29 02:48:32 -07:00
|
|
|
${RegCleanMain} "Software\Mozilla"
|
|
|
|
${RegCleanUninstall}
|
2007-10-23 10:34:39 -07:00
|
|
|
|
|
|
|
ReadRegStr $0 HKLM "Software\mozilla.org\Mozilla" "CurrentVersion"
|
|
|
|
${If} "$0" != "${GREVersion}"
|
|
|
|
WriteRegStr HKLM "Software\mozilla.org\Mozilla" "CurrentVersion" "${GREVersion}"
|
|
|
|
${EndIf}
|
2007-03-22 10:30:00 -07:00
|
|
|
${EndIf}
|
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
${RemoveDeprecatedKeys}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
; The previous installer adds several regsitry values to both HKLM and HKCU.
|
|
|
|
; We now try to add to HKLM and if that fails to HKCU
|
|
|
|
|
|
|
|
; The order that reg keys and values are added is important if you use the
|
|
|
|
; uninstall log to remove them on uninstall. When using the uninstall log you
|
|
|
|
; MUST add children first so they will be removed first on uninstall so they
|
|
|
|
; will be empty when the key is deleted. This allows the uninstaller to
|
|
|
|
; specify that only empty keys will be deleted.
|
|
|
|
${SetAppKeys}
|
|
|
|
|
|
|
|
; XXXrstrong - this should be set in shared.nsh along with "Create Quick
|
|
|
|
; Launch Shortcut" and Create Desktop Shortcut.
|
|
|
|
StrCpy $0 "Software\Mozilla\${BrandFullNameInternal}\${AppVersion} (${AB_CD})\Uninstall"
|
|
|
|
${WriteRegDWORD2} $TmpVal "$0" "Create Start Menu Shortcut" $AddStartMenuSC 0
|
|
|
|
|
|
|
|
${FixClassKeys}
|
2007-09-29 02:48:32 -07:00
|
|
|
${UpdateProtocolHandlers}
|
|
|
|
|
|
|
|
; On install always add the FirefoxHTML and FirefoxURL keys.
|
|
|
|
; An empty string is used for the 5th param because FirefoxHTML is not a
|
|
|
|
; protocol handler.
|
|
|
|
${AddDDEHandlerValues} "FirefoxHTML" "$2" "$8,1" "${AppRegName} Document" "" \
|
|
|
|
"${DDEApplication}" "$3" "WWW_OpenURL"
|
|
|
|
|
|
|
|
${AddDDEHandlerValues} "FirefoxURL" "$2" "$8,1" "${AppRegName} URL" "true" \
|
|
|
|
"${DDEApplication}" "$3" "WWW_OpenURL"
|
|
|
|
|
|
|
|
${FixShellIconHandler}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
; The following keys should only be set if we can write to HKLM
|
|
|
|
${If} $TmpVal == "HKLM"
|
|
|
|
; Uninstall keys can only exist under HKLM on some versions of windows.
|
|
|
|
${SetUninstallKeys}
|
|
|
|
|
|
|
|
; Set the Start Menu Internet and Vista Registered App HKLM registry keys.
|
|
|
|
${SetStartMenuInternet}
|
|
|
|
|
|
|
|
; If we are writing to HKLM and create the quick launch and the desktop
|
|
|
|
; shortcuts set IconsVisible to 1 otherwise to 0.
|
2007-09-29 02:48:32 -07:00
|
|
|
${StrFilter} "${FileMainEXE}" "+" "" "" $R9
|
|
|
|
StrCpy $0 "Software\Clients\StartMenuInternet\$R9\InstallInfo"
|
2007-03-22 10:30:00 -07:00
|
|
|
${If} $AddQuickLaunchSC == 1
|
|
|
|
${OrIf} $AddDesktopSC == 1
|
|
|
|
WriteRegDWORD HKLM "$0" "IconsVisible" 1
|
|
|
|
${Else}
|
|
|
|
WriteRegDWORD HKLM "$0" "IconsVisible" 0
|
|
|
|
${EndIf}
|
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
; These need special handling on uninstall since they may be overwritten by
|
|
|
|
; an install into a different location.
|
|
|
|
StrCpy $0 "Software\Microsoft\Windows\CurrentVersion\App Paths\${FileMainEXE}"
|
|
|
|
${WriteRegStr2} $TmpVal "$0" "" "$INSTDIR\${FileMainEXE}" 0
|
|
|
|
${WriteRegStr2} $TmpVal "$0" "Path" "$INSTDIR" 0
|
|
|
|
|
|
|
|
StrCpy $0 "Software\Microsoft\MediaPlayer\ShimInclusionList\$R9"
|
|
|
|
${CreateRegKey} "$TmpVal" "$0" 0
|
|
|
|
|
|
|
|
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
|
|
|
|
|
|
|
|
; Create Start Menu shortcuts
|
|
|
|
${LogHeader} "Adding Shortcuts"
|
|
|
|
${If} $AddStartMenuSC == 1
|
2007-09-17 19:47:34 -07:00
|
|
|
${Unless} ${FileExists} "$SMPROGRAMS\$StartMenuDir"
|
|
|
|
CreateDirectory "$SMPROGRAMS\$StartMenuDir"
|
|
|
|
${LogMsg} "Added Start Menu Directory: $SMPROGRAMS\$StartMenuDir"
|
|
|
|
${EndUnless}
|
2007-03-22 10:30:00 -07:00
|
|
|
CreateShortCut "$SMPROGRAMS\$StartMenuDir\${BrandFullNameInternal}.lnk" "$INSTDIR\${FileMainEXE}" "" "$INSTDIR\${FileMainEXE}" 0
|
|
|
|
${LogUninstall} "File: $SMPROGRAMS\$StartMenuDir\${BrandFullNameInternal}.lnk"
|
2007-09-17 19:47:34 -07:00
|
|
|
${LogMsg} "Added Shortcut: $SMPROGRAMS\$StartMenuDir\${BrandFullNameInternal}.lnk"
|
2007-03-22 10:30:00 -07:00
|
|
|
CreateShortCut "$SMPROGRAMS\$StartMenuDir\${BrandFullNameInternal} ($(SAFE_MODE)).lnk" "$INSTDIR\${FileMainEXE}" "-safe-mode" "$INSTDIR\${FileMainEXE}" 0
|
|
|
|
${LogUninstall} "File: $SMPROGRAMS\$StartMenuDir\${BrandFullNameInternal} ($(SAFE_MODE)).lnk"
|
2007-09-17 19:47:34 -07:00
|
|
|
${LogMsg} "Added Shortcut: $SMPROGRAMS\$StartMenuDir\${BrandFullNameInternal} ($(SAFE_MODE)).lnk"
|
2007-03-22 10:30:00 -07:00
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
; perhaps use the uninstall keys
|
|
|
|
${If} $AddQuickLaunchSC == 1
|
|
|
|
CreateShortCut "$QUICKLAUNCH\${BrandFullName}.lnk" "$INSTDIR\${FileMainEXE}" "" "$INSTDIR\${FileMainEXE}" 0
|
|
|
|
${LogUninstall} "File: $QUICKLAUNCH\${BrandFullName}.lnk"
|
2007-09-17 19:47:34 -07:00
|
|
|
${LogMsg} "Added Shortcut: $QUICKLAUNCH\${BrandFullName}.lnk"
|
2007-03-22 10:30:00 -07:00
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
${If} $AddDesktopSC == 1
|
|
|
|
CreateShortCut "$DESKTOP\${BrandFullName}.lnk" "$INSTDIR\${FileMainEXE}" "" "$INSTDIR\${FileMainEXE}" 0
|
|
|
|
${LogUninstall} "File: $DESKTOP\${BrandFullName}.lnk"
|
2007-09-17 19:47:34 -07:00
|
|
|
${LogMsg} "Added Shortcut: $DESKTOP\${BrandFullName}.lnk"
|
2007-03-22 10:30:00 -07:00
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
!insertmacro MUI_STARTMENU_WRITE_END
|
|
|
|
SectionEnd
|
|
|
|
|
2007-09-17 19:47:34 -07:00
|
|
|
Section /o "Developer Tools" DOMI_IDX
|
2007-03-22 10:30:00 -07:00
|
|
|
${If} ${FileExists} "$EXEDIR\optional\extensions\inspector@mozilla.org"
|
2007-09-17 19:47:34 -07:00
|
|
|
SetDetailsPrint both
|
2007-03-22 10:30:00 -07:00
|
|
|
DetailPrint $(STATUS_INSTALL_OPTIONAL)
|
|
|
|
SetDetailsPrint none
|
2007-09-17 19:47:34 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
${RemoveDir} "$INSTDIR\extensions\inspector@mozilla.org"
|
|
|
|
ClearErrors
|
|
|
|
${LogHeader} "Installing Developer Tools"
|
2007-11-30 11:02:09 -08:00
|
|
|
${CopyFilesFromDir} "$EXEDIR\optional\extensions\inspector@mozilla.org" \
|
|
|
|
"$INSTDIR\extensions\inspector@mozilla.org" \
|
|
|
|
"$(ERROR_CREATE_DIRECTORY_PREFIX)" \
|
|
|
|
"$(ERROR_CREATE_DIRECTORY_SUFFIX)"
|
2007-03-22 10:30:00 -07:00
|
|
|
${EndIf}
|
2007-09-17 19:47:34 -07:00
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
; Cleanup operations to perform at the end of the installation.
|
|
|
|
Section "-InstallEndCleanup"
|
|
|
|
SetDetailsPrint both
|
|
|
|
DetailPrint "$(STATUS_CLEANUP)"
|
|
|
|
SetDetailsPrint none
|
|
|
|
${LogHeader} "Updating Uninstall Log With Previous Uninstall Log"
|
|
|
|
|
|
|
|
; Refresh desktop icons
|
|
|
|
System::Call "shell32::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)"
|
|
|
|
|
2007-11-30 11:02:09 -08:00
|
|
|
${InstallEndCleanupCommon}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-11-30 11:02:09 -08:00
|
|
|
; If we have to reboot give SHChangeNotify time to finish the refreshing
|
|
|
|
; the icons so the OS doesn't display the icons from helper.exe
|
|
|
|
${If} ${RebootFlag}
|
|
|
|
Sleep 10000
|
|
|
|
${LogHeader} "Reboot Required To Finish Installation"
|
|
|
|
; ${FileMainEXE}.moz-upgrade should never exist but just in case...
|
|
|
|
${Unless} ${FileExists} "$INSTDIR\${FileMainEXE}.moz-upgrade"
|
|
|
|
Rename "$INSTDIR\${FileMainEXE}" "$INSTDIR\${FileMainEXE}.moz-upgrade"
|
2007-05-03 16:40:54 -07:00
|
|
|
${EndUnless}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-11-30 11:02:09 -08:00
|
|
|
${If} ${FileExists} "$INSTDIR\${FileMainEXE}"
|
2007-03-22 10:30:00 -07:00
|
|
|
ClearErrors
|
2007-11-30 11:02:09 -08:00
|
|
|
Rename "$INSTDIR\${FileMainEXE}" "$INSTDIR\${FileMainEXE}.moz-delete"
|
|
|
|
${Unless} ${Errors}
|
|
|
|
Delete /REBOOTOK "$INSTDIR\${FileMainEXE}.moz-delete"
|
|
|
|
${EndUnless}
|
2007-03-22 10:30:00 -07:00
|
|
|
${EndUnless}
|
2007-11-30 11:02:09 -08:00
|
|
|
|
|
|
|
${Unless} ${FileExists} "$INSTDIR\${FileMainEXE}"
|
|
|
|
CopyFiles /SILENT "$INSTDIR\uninstall\helper.exe" "$INSTDIR"
|
|
|
|
FileOpen $0 "$INSTDIR\${FileMainEXE}" w
|
|
|
|
FileWrite $0 "Will be deleted on restart"
|
|
|
|
Rename /REBOOTOK "$INSTDIR\${FileMainEXE}.moz-upgrade" "$INSTDIR\${FileMainEXE}"
|
|
|
|
FileClose $0
|
|
|
|
Delete "$INSTDIR\${FileMainEXE}"
|
|
|
|
Rename "$INSTDIR\helper.exe" "$INSTDIR\${FileMainEXE}"
|
2007-03-22 10:30:00 -07:00
|
|
|
${EndUnless}
|
2007-11-30 11:02:09 -08:00
|
|
|
${EndIf}
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Helper Functions
|
|
|
|
|
|
|
|
Function CheckExistingInstall
|
|
|
|
; If there is a pending file copy from a previous uninstall don't allow
|
|
|
|
; installing until after the system has rebooted.
|
|
|
|
IfFileExists "$INSTDIR\${FileMainEXE}.moz-upgrade" +1 +4
|
|
|
|
MessageBox MB_YESNO "$(WARN_RESTART_REQUIRED_UPGRADE)" IDNO +2
|
|
|
|
Reboot
|
|
|
|
Quit
|
|
|
|
|
|
|
|
; If there is a pending file deletion from a previous uninstall don't allow
|
|
|
|
; installing until after the system has rebooted.
|
|
|
|
IfFileExists "$INSTDIR\${FileMainEXE}.moz-delete" +1 +4
|
|
|
|
MessageBox MB_YESNO "$(WARN_RESTART_REQUIRED_UNINSTALL)" IDNO +2
|
|
|
|
Reboot
|
|
|
|
Quit
|
|
|
|
|
|
|
|
${If} ${FileExists} "$INSTDIR\${FileMainEXE}"
|
|
|
|
Banner::show /NOUNLOAD "$(BANNER_CHECK_EXISTING)"
|
|
|
|
|
|
|
|
${If} "$TmpVal" == "FoundMessageWindow"
|
|
|
|
Sleep 5000
|
2007-03-22 10:30:00 -07:00
|
|
|
${EndIf}
|
2007-09-17 19:47:34 -07:00
|
|
|
|
2007-11-30 11:02:09 -08:00
|
|
|
${PushFilesToCheck}
|
2007-09-17 19:47:34 -07:00
|
|
|
|
2007-11-30 11:02:09 -08:00
|
|
|
; Store the return value in $TmpVal so it is less likely to be accidentally
|
|
|
|
; overwritten elsewhere.
|
|
|
|
${CheckForFilesInUse} $TmpVal
|
|
|
|
|
|
|
|
Banner::destroy
|
|
|
|
|
|
|
|
${If} "$TmpVal" == "true"
|
|
|
|
StrCpy $TmpVal "FoundMessageWindow"
|
|
|
|
${ManualCloseAppPrompt} "${WindowClass}" "$(WARN_MANUALLY_CLOSE_APP_INSTALL)"
|
|
|
|
StrCpy $TmpVal "true"
|
2007-03-22 10:30:00 -07:00
|
|
|
${EndIf}
|
|
|
|
${EndIf}
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function LaunchApp
|
2007-10-19 14:26:30 -07:00
|
|
|
ClearErrors
|
2007-09-29 02:48:32 -07:00
|
|
|
${GetParameters} $0
|
2007-10-19 14:26:30 -07:00
|
|
|
${GetOptions} "$0" "/UAC:" $1
|
|
|
|
${If} ${Errors}
|
|
|
|
${ManualCloseAppPrompt} "${WindowClass}" "$(WARN_MANUALLY_CLOSE_APP_LAUNCH)"
|
|
|
|
Exec "$INSTDIR\${FileMainEXE}"
|
|
|
|
${Else}
|
|
|
|
GetFunctionAddress $0 LaunchAppFromElevatedProcess
|
|
|
|
UAC::ExecCodeSegment $0
|
2007-09-29 02:48:32 -07:00
|
|
|
${EndIf}
|
2007-03-22 10:30:00 -07:00
|
|
|
FunctionEnd
|
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
Function LaunchAppFromElevatedProcess
|
|
|
|
${ManualCloseAppPrompt} "${WindowClass}" "$(WARN_MANUALLY_CLOSE_APP_LAUNCH)"
|
|
|
|
|
|
|
|
; Find the installation directory when launching using GetFunctionAddress
|
|
|
|
; from an elevated installer since $INSTDIR will not be set in this installer
|
|
|
|
${StrFilter} "${FileMainEXE}" "+" "" "" $R9
|
|
|
|
ReadRegStr $0 HKLM "Software\Clients\StartMenuInternet\$R9\DefaultIcon" ""
|
|
|
|
${GetPathFromString} "$0" $0
|
2007-10-19 14:26:30 -07:00
|
|
|
${GetParent} "$0" $1
|
|
|
|
; Set our current working directory to the application's install directory
|
|
|
|
; otherwise the 7-Zip temp directory will be in use and won't be deleted.
|
|
|
|
SetOutPath "$1"
|
2007-09-29 02:48:32 -07:00
|
|
|
Exec "$0"
|
|
|
|
FunctionEnd
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
################################################################################
|
|
|
|
# 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 preWelcome
|
|
|
|
${If} ${FileExists} "$EXEDIR\localized\distribution\modern-wizard.bmp"
|
|
|
|
Delete "$PLUGINSDIR\modern-wizard.bmp"
|
|
|
|
CopyFiles /SILENT "$EXEDIR\localized\distribution\modern-wizard.bmp" "$PLUGINSDIR\modern-wizard.bmp"
|
|
|
|
${EndIf}
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function showLicense
|
|
|
|
${If} ${FileExists} "$EXEDIR\localized\distribution\modern-header.bmp"
|
|
|
|
${AndIf} $hHeaderBitmap == ""
|
|
|
|
Delete "$PLUGINSDIR\modern-header.bmp"
|
|
|
|
CopyFiles /SILENT "$EXEDIR\localized\distribution\modern-header.bmp" "$PLUGINSDIR\modern-header.bmp"
|
|
|
|
${ChangeMUIHeaderImage} "$PLUGINSDIR\modern-header.bmp"
|
|
|
|
${EndIf}
|
|
|
|
FunctionEnd
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
Function preOptions
|
|
|
|
!insertmacro MUI_HEADER_TEXT "$(OPTIONS_PAGE_TITLE)" "$(OPTIONS_PAGE_SUBTITLE)"
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "options.ini"
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function leaveOptions
|
|
|
|
${MUI_INSTALLOPTIONS_READ} $0 "options.ini" "Settings" "State"
|
|
|
|
${If} $0 != 0
|
|
|
|
Abort
|
|
|
|
${EndIf}
|
|
|
|
${MUI_INSTALLOPTIONS_READ} $R0 "options.ini" "Field 2" "State"
|
|
|
|
StrCmp $R0 "1" +1 +2
|
2007-09-17 19:47:34 -07:00
|
|
|
StrCpy $InstallType ${INSTALLTYPE_BASIC}
|
2007-03-22 10:30:00 -07:00
|
|
|
${MUI_INSTALLOPTIONS_READ} $R0 "options.ini" "Field 3" "State"
|
|
|
|
StrCmp $R0 "1" +1 +2
|
2007-09-17 19:47:34 -07:00
|
|
|
StrCpy $InstallType ${INSTALLTYPE_CUSTOM}
|
2007-11-30 11:02:09 -08:00
|
|
|
|
|
|
|
${If} $InstallType != ${INSTALLTYPE_CUSTOM}
|
|
|
|
Call CheckExistingInstall
|
|
|
|
${EndIf}
|
2007-03-22 10:30:00 -07:00
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function preComponents
|
2007-09-17 19:47:34 -07:00
|
|
|
${CheckCustomCommon}
|
2007-03-22 10:30:00 -07:00
|
|
|
; If DOMi isn't available skip the components page
|
|
|
|
${Unless} ${FileExists} "$EXEDIR\optional\extensions\inspector@mozilla.org"
|
|
|
|
Abort
|
|
|
|
${EndUnless}
|
|
|
|
!insertmacro MUI_HEADER_TEXT "$(OPTIONAL_COMPONENTS_TITLE)" "$(OPTIONAL_COMPONENTS_SUBTITLE)"
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "components.ini"
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function leaveComponents
|
2007-07-24 13:22:58 -07:00
|
|
|
${MUI_INSTALLOPTIONS_READ} $R0 "components.ini" "Field 2" "State"
|
|
|
|
; State will be 1 for checked and 0 for unchecked so we can use that to set
|
|
|
|
; the section flags for installation.
|
2007-09-17 19:47:34 -07:00
|
|
|
SectionSetFlags ${DOMI_IDX} $R0
|
2007-03-22 10:30:00 -07:00
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function preDirectory
|
2007-09-17 19:47:34 -07:00
|
|
|
${PreDirectoryCommon}
|
2007-03-22 10:30:00 -07:00
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function leaveDirectory
|
2007-09-17 19:47:34 -07:00
|
|
|
${LeaveDirectoryCommon} "$(WARN_DISK_SPACE)" "$(WARN_WRITE_ACCESS)"
|
2007-03-22 10:30:00 -07:00
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function preShortcuts
|
2007-09-17 19:47:34 -07:00
|
|
|
${CheckCustomCommon}
|
2007-03-22 10:30:00 -07:00
|
|
|
!insertmacro MUI_HEADER_TEXT "$(SHORTCUTS_PAGE_TITLE)" "$(SHORTCUTS_PAGE_SUBTITLE)"
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "shortcuts.ini"
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function leaveShortcuts
|
|
|
|
${MUI_INSTALLOPTIONS_READ} $0 "shortcuts.ini" "Settings" "State"
|
|
|
|
${If} $0 != 0
|
|
|
|
Abort
|
|
|
|
${EndIf}
|
|
|
|
${MUI_INSTALLOPTIONS_READ} $AddDesktopSC "shortcuts.ini" "Field 2" "State"
|
|
|
|
${MUI_INSTALLOPTIONS_READ} $AddStartMenuSC "shortcuts.ini" "Field 3" "State"
|
|
|
|
${MUI_INSTALLOPTIONS_READ} $AddQuickLaunchSC "shortcuts.ini" "Field 4" "State"
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function preStartMenu
|
2007-09-17 19:47:34 -07:00
|
|
|
${CheckCustomCommon}
|
2007-03-22 10:30:00 -07:00
|
|
|
${If} $AddStartMenuSC != 1
|
|
|
|
Abort
|
|
|
|
${EndIf}
|
|
|
|
FunctionEnd
|
|
|
|
|
2007-11-30 11:02:09 -08:00
|
|
|
Function leaveStartMenu
|
|
|
|
${If} $InstallType == ${INSTALLTYPE_CUSTOM}
|
|
|
|
Call CheckExistingInstall
|
|
|
|
${EndIf}
|
|
|
|
FunctionEnd
|
|
|
|
|
2007-09-21 15:09:04 -07:00
|
|
|
Function preSummary
|
|
|
|
!insertmacro createSummaryINI
|
|
|
|
!insertmacro MUI_HEADER_TEXT "$(SUMMARY_PAGE_TITLE)" "$(SUMMARY_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 "summary.ini"
|
|
|
|
GetDlgItem $0 $HWNDPARENT 1
|
|
|
|
System::Call "user32::SetFocus(i r0, i 0x0007, i,i)i"
|
2007-11-30 11:02:09 -08:00
|
|
|
${MUI_INSTALLOPTIONS_READ} $1 "summary.ini" "Field 2" "HWND"
|
|
|
|
SendMessage $1 ${WM_SETTEXT} 0 "STR:$INSTDIR"
|
2007-09-21 15:09:04 -07:00
|
|
|
!insertmacro MUI_INSTALLOPTIONS_SHOW
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function leaveSummary
|
2007-09-17 19:47:34 -07:00
|
|
|
${If} $InstallType != ${INSTALLTYPE_CUSTOM}
|
|
|
|
; Set DOMi to be installed
|
|
|
|
SectionSetFlags ${DOMI_IDX} 1
|
2007-03-22 10:30:00 -07:00
|
|
|
${EndIf}
|
2007-11-30 11:02:09 -08: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.
|
|
|
|
ClearErrors
|
|
|
|
${DeleteFile} "$INSTDIR\${FileMainEXE}"
|
|
|
|
${If} ${Errors}
|
|
|
|
${ManualCloseAppPrompt} "${WindowClass}" "$(WARN_MANUALLY_CLOSE_APP_INSTALL)"
|
|
|
|
${EndIf}
|
2007-03-22 10:30:00 -07:00
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
; 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.
|
|
|
|
Function preFinish
|
2007-09-17 19:47:34 -07:00
|
|
|
${EndInstallLog} "${BrandFullName}"
|
2007-03-22 10:30:00 -07:00
|
|
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "settings" "cancelenabled" "0"
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Initialization Functions
|
|
|
|
|
|
|
|
Function .onInit
|
2007-10-24 00:02:57 -07:00
|
|
|
StrCpy $LANGUAGE 0
|
|
|
|
${SetBrandNameVars} "$EXEDIR\localized\distribution\setup.ini"
|
|
|
|
|
2007-09-17 19:47:34 -07:00
|
|
|
${InstallOnInitCommon} "$(WARN_UNSUPPORTED_MSG)"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "options.ini"
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "components.ini"
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "shortcuts.ini"
|
2007-09-21 15:09:04 -07:00
|
|
|
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "summary.ini"
|
2007-03-22 10:30:00 -07:00
|
|
|
!insertmacro createBasicCustomOptionsINI
|
|
|
|
!insertmacro createComponentsINI
|
|
|
|
!insertmacro createShortcutsINI
|
|
|
|
|
|
|
|
; There must always be nonlocalized and localized directories.
|
2007-09-17 19:47:34 -07:00
|
|
|
${GetSize} "$EXEDIR\nonlocalized\" "/S=0K" $R5 $R7 $R8
|
|
|
|
${GetSize} "$EXEDIR\localized\" "/S=0K" $R6 $R7 $R8
|
|
|
|
IntOp $R8 $R5 + $R6
|
|
|
|
SectionSetSize ${APP_IDX} $R8
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
${If} ${FileExists} "$EXEDIR\optional\extensions\inspector@mozilla.org"
|
|
|
|
; Set the section size for DOMi.
|
|
|
|
${GetSize} "$EXEDIR\optional\extensions\inspector@mozilla.org" "/S=0K" $0 $8 $9
|
2007-09-17 19:47:34 -07:00
|
|
|
SectionSetSize ${DOMI_IDX} $0
|
2007-03-22 10:30:00 -07:00
|
|
|
${Else}
|
|
|
|
; Hide DOMi in the components page if it isn't available.
|
2007-09-17 19:47:34 -07:00
|
|
|
SectionSetText ${DOMI_IDX} ""
|
2007-03-22 10:30:00 -07:00
|
|
|
${EndIf}
|
2007-09-29 02:48:32 -07:00
|
|
|
|
2007-10-19 14:26:30 -07:00
|
|
|
; Initialize $hHeaderBitmap to prevent redundant changing of the bitmap if
|
|
|
|
; the user clicks the back button
|
|
|
|
StrCpy $hHeaderBitmap ""
|
2007-09-29 02:48:32 -07:00
|
|
|
FunctionEnd
|
|
|
|
|
2007-10-19 14:26:30 -07:00
|
|
|
Function .onGUIEnd
|
|
|
|
${OnEndCommon}
|
2007-09-29 02:48:32 -07:00
|
|
|
FunctionEnd
|