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 *****
|
|
|
|
|
|
|
|
!macro PostUpdate
|
|
|
|
; Remove registry entries for non-existent apps and for apps that point to our
|
2007-09-17 19:47:34 -07:00
|
|
|
; install location in the Software\Mozilla key and uninstall registry entries
|
|
|
|
; that point to our install location for both HKCU and HKLM.
|
2007-09-29 02:48:32 -07:00
|
|
|
SetShellVarContext current ; Set SHCTX to the current user (e.g. HKCU)
|
2007-03-22 10:30:00 -07:00
|
|
|
${RegCleanMain} "Software\Mozilla"
|
2007-09-17 19:47:34 -07:00
|
|
|
${RegCleanUninstall}
|
2008-07-27 18:58:27 -07:00
|
|
|
${UpdateProtocolHandlers}
|
2007-09-17 19:47:34 -07:00
|
|
|
|
2007-09-29 02:48:32 -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 all users (e.g. HKLM)
|
|
|
|
DeleteRegKey HKLM "Software\Mozilla\InstallerTest"
|
|
|
|
StrCpy $TmpVal "HKLM" ; used primarily for logging
|
|
|
|
${RegCleanMain} "Software\Mozilla"
|
|
|
|
${RegCleanUninstall}
|
|
|
|
${SetStartMenuInternet}
|
|
|
|
${FixShellIconHandler}
|
|
|
|
${SetUninstallKeys}
|
2008-07-27 18:58:27 -07:00
|
|
|
${UpdateProtocolHandlers}
|
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-09-29 02:48:32 -07:00
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
${RemoveDeprecatedKeys}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
; Add Software\Mozilla\ registry entries
|
|
|
|
${SetAppKeys}
|
|
|
|
${FixClassKeys}
|
2007-07-17 11:11:18 -07:00
|
|
|
|
|
|
|
; Remove files that may be left behind by the application in the
|
|
|
|
; VirtualStore directory.
|
|
|
|
${CleanVirtualStore}
|
2007-07-24 13:22:58 -07:00
|
|
|
|
|
|
|
; Remove talkback if it is present (remove after bug 386760 is fixed)
|
|
|
|
${If} ${FileExists} "$INSTDIR\extensions\talkback@mozilla.org\"
|
|
|
|
RmDir /r "$INSTDIR\extensions\talkback@mozilla.org\"
|
|
|
|
${EndIf}
|
2007-03-22 10:30:00 -07:00
|
|
|
!macroend
|
|
|
|
!define PostUpdate "!insertmacro PostUpdate"
|
|
|
|
|
|
|
|
!macro SetAsDefaultAppUser
|
2007-09-29 02:48:32 -07:00
|
|
|
; It is only possible to set this installation of the application as the
|
|
|
|
; StartMenuInternet handler if it was added to the HKLM StartMenuInternet
|
|
|
|
; registry keys.
|
|
|
|
; http://support.microsoft.com/kb/297878
|
|
|
|
|
|
|
|
${StrFilter} "${FileMainEXE}" "+" "" "" $R9
|
|
|
|
ClearErrors
|
|
|
|
ReadRegStr $0 HKLM "Software\Clients\StartMenuInternet\$R9\DefaultIcon" ""
|
|
|
|
IfErrors updateclientkeys +1
|
|
|
|
${GetPathFromString} "$0" $0
|
|
|
|
${GetParent} "$0" $0
|
|
|
|
IfFileExists "$0" +1 updateclientkeys
|
|
|
|
${GetLongPath} "$0" $0
|
|
|
|
StrCmp "$0" "$INSTDIR" setdefaultuser +1
|
|
|
|
|
|
|
|
updateclientkeys:
|
|
|
|
; Calls after ElevateUAC won't be made if the user can elevate. They
|
|
|
|
; will be made in the new elevated process if the user allows elevation.
|
|
|
|
${ElevateUAC}
|
|
|
|
|
|
|
|
${SetStartMenuInternet}
|
|
|
|
|
|
|
|
setdefaultuser:
|
|
|
|
SetShellVarContext all ; Set SHCTX to all users (e.g. HKLM)
|
|
|
|
${FixShellIconHandler}
|
|
|
|
WriteRegStr HKCU "Software\Clients\StartMenuInternet" "" "$R9"
|
|
|
|
|
|
|
|
${If} ${AtLeastWinVista}
|
|
|
|
ClearErrors
|
|
|
|
ReadRegStr $0 HKLM "Software\RegisteredApplications" "${AppRegName}"
|
|
|
|
; Only register as the handler on Vista if the app registry name exists
|
|
|
|
; under the RegisteredApplications registry key.
|
|
|
|
${Unless} ${Errors}
|
2007-10-19 14:26:30 -07:00
|
|
|
AppAssocReg::SetAppAsDefaultAll "${AppRegName}"
|
2007-09-29 02:48:32 -07:00
|
|
|
${EndUnless}
|
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
${RemoveDeprecatedKeys}
|
|
|
|
|
|
|
|
SetShellVarContext current ; Set SHCTX to the current user (e.g. HKCU)
|
2007-03-22 10:30:00 -07:00
|
|
|
${SetHandlers}
|
|
|
|
!macroend
|
|
|
|
!define SetAsDefaultAppUser "!insertmacro SetAsDefaultAppUser"
|
|
|
|
|
|
|
|
!macro SetAsDefaultAppGlobal
|
2007-09-29 02:48:32 -07:00
|
|
|
${RemoveDeprecatedKeys}
|
|
|
|
|
|
|
|
SetShellVarContext all ; Set SHCTX to all users (e.g. HKLM)
|
2007-03-22 10:30:00 -07:00
|
|
|
${SetHandlers}
|
|
|
|
${SetStartMenuInternet}
|
2007-09-29 02:48:32 -07:00
|
|
|
${FixShellIconHandler}
|
2007-03-22 10:30:00 -07:00
|
|
|
${ShowShortcuts}
|
2007-09-29 02:48:32 -07:00
|
|
|
${StrFilter} "${FileMainEXE}" "+" "" "" $R9
|
|
|
|
WriteRegStr HKLM "Software\Clients\StartMenuInternet" "" "$R9"
|
2007-03-22 10:30:00 -07:00
|
|
|
!macroend
|
|
|
|
!define SetAsDefaultAppGlobal "!insertmacro SetAsDefaultAppGlobal"
|
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
!macro FixReg
|
|
|
|
${SetAsDefaultAppUser}
|
|
|
|
!macroend
|
|
|
|
!define FixReg "!insertmacro FixReg"
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
!macro HideShortcuts
|
|
|
|
${StrFilter} "${FileMainEXE}" "+" "" "" $0
|
|
|
|
StrCpy $R1 "Software\Clients\StartMenuInternet\$0\InstallInfo"
|
2007-09-29 02:48:32 -07:00
|
|
|
WriteRegDWORD HKLM "$R1" "IconsVisible" 0
|
2007-03-22 10:30:00 -07:00
|
|
|
SetShellVarContext all ; Set $DESKTOP to All Users
|
|
|
|
${Unless} ${FileExists} "$DESKTOP\${BrandFullName}.lnk"
|
|
|
|
SetShellVarContext current ; Set $DESKTOP to the current user's desktop
|
|
|
|
${EndUnless}
|
|
|
|
|
|
|
|
${If} ${FileExists} "$DESKTOP\${BrandFullName}.lnk"
|
|
|
|
ShellLink::GetShortCutArgs "$DESKTOP\${BrandFullName}.lnk"
|
|
|
|
Pop $0
|
2008-07-27 18:58:27 -07:00
|
|
|
${If} "$0" == ""
|
2007-03-22 10:30:00 -07:00
|
|
|
ShellLink::GetShortCutTarget "$DESKTOP\${BrandFullName}.lnk"
|
|
|
|
Pop $0
|
|
|
|
; Needs to handle short paths
|
2008-07-27 18:58:27 -07:00
|
|
|
${If} "$0" == "$INSTDIR\${FileMainEXE}"
|
2007-03-22 10:30:00 -07:00
|
|
|
Delete "$DESKTOP\${BrandFullName}.lnk"
|
|
|
|
${EndIf}
|
|
|
|
${EndIf}
|
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
${If} ${FileExists} "$QUICKLAUNCH\${BrandFullName}.lnk"
|
|
|
|
ShellLink::GetShortCutArgs "$QUICKLAUNCH\${BrandFullName}.lnk"
|
|
|
|
Pop $0
|
2008-07-27 18:58:27 -07:00
|
|
|
${If} "$0" == ""
|
2007-03-22 10:30:00 -07:00
|
|
|
ShellLink::GetShortCutTarget "$QUICKLAUNCH\${BrandFullName}.lnk"
|
|
|
|
Pop $0
|
|
|
|
; Needs to handle short paths
|
2008-07-27 18:58:27 -07:00
|
|
|
${If} "$0" == "$INSTDIR\${FileMainEXE}"
|
2007-03-22 10:30:00 -07:00
|
|
|
Delete "$QUICKLAUNCH\${BrandFullName}.lnk"
|
|
|
|
${EndIf}
|
|
|
|
${EndIf}
|
|
|
|
${EndIf}
|
|
|
|
!macroend
|
|
|
|
!define HideShortcuts "!insertmacro HideShortcuts"
|
|
|
|
|
|
|
|
!macro ShowShortcuts
|
|
|
|
${StrFilter} "${FileMainEXE}" "+" "" "" $0
|
|
|
|
StrCpy $R1 "Software\Clients\StartMenuInternet\$0\InstallInfo"
|
2007-09-29 02:48:32 -07:00
|
|
|
WriteRegDWORD HKLM "$R1" "IconsVisible" 1
|
2007-03-22 10:30:00 -07:00
|
|
|
SetShellVarContext all ; Set $DESKTOP to All Users
|
|
|
|
${Unless} ${FileExists} "$DESKTOP\${BrandFullName}.lnk"
|
|
|
|
CreateShortCut "$DESKTOP\${BrandFullName}.lnk" "$INSTDIR\${FileMainEXE}" "" "$INSTDIR\${FileMainEXE}" 0
|
|
|
|
ShellLink::SetShortCutWorkingDirectory "$DESKTOP\${BrandFullName}.lnk" "$INSTDIR"
|
|
|
|
${Unless} ${FileExists} "$DESKTOP\${BrandFullName}.lnk"
|
|
|
|
SetShellVarContext current ; Set $DESKTOP to the current user's desktop
|
|
|
|
${Unless} ${FileExists} "$DESKTOP\${BrandFullName}.lnk"
|
|
|
|
CreateShortCut "$DESKTOP\${BrandFullName}.lnk" "$INSTDIR\${FileMainEXE}" "" "$INSTDIR\${FileMainEXE}" 0
|
|
|
|
ShellLink::SetShortCutWorkingDirectory "$DESKTOP\${BrandFullName}.lnk" "$INSTDIR"
|
|
|
|
${EndUnless}
|
|
|
|
${EndUnless}
|
|
|
|
${EndUnless}
|
|
|
|
${Unless} ${FileExists} "$QUICKLAUNCH\${BrandFullName}.lnk"
|
|
|
|
CreateShortCut "$QUICKLAUNCH\${BrandFullName}.lnk" "$INSTDIR\${FileMainEXE}" "" "$INSTDIR\${FileMainEXE}" 0
|
|
|
|
ShellLink::SetShortCutWorkingDirectory "$QUICKLAUNCH\${BrandFullName}.lnk" "$INSTDIR"
|
|
|
|
${EndUnless}
|
|
|
|
!macroend
|
|
|
|
!define ShowShortcuts "!insertmacro ShowShortcuts"
|
|
|
|
|
|
|
|
!macro SetHandlers
|
2007-09-29 02:48:32 -07:00
|
|
|
${GetLongPath} "$INSTDIR\${FileMainEXE}" $8
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
StrCpy $0 "SOFTWARE\Classes"
|
2007-07-10 22:59:56 -07:00
|
|
|
StrCpy $2 "$\"$8$\" -requestPending -osint -url $\"%1$\""
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
; Associate the file handlers with FirefoxHTML
|
2007-09-29 02:48:32 -07:00
|
|
|
ReadRegStr $6 HKCR ".htm" ""
|
|
|
|
${If} "$6" != "FirefoxHTML"
|
|
|
|
WriteRegStr SHCTX "$0\.htm" "" "FirefoxHTML"
|
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
ReadRegStr $6 HKCR ".html" ""
|
|
|
|
${If} "$6" != "FirefoxHTML"
|
|
|
|
WriteRegStr SHCTX "$0\.html" "" "FirefoxHTML"
|
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
ReadRegStr $6 HKCR ".shtml" ""
|
|
|
|
${If} "$6" != "FirefoxHTML"
|
|
|
|
WriteRegStr SHCTX "$0\.shtml" "" "FirefoxHTML"
|
|
|
|
${EndIf}
|
|
|
|
|
2008-07-27 18:58:27 -07:00
|
|
|
ReadRegStr $6 HKCR ".xht" ""
|
2007-09-29 02:48:32 -07:00
|
|
|
${If} "$6" != "FirefoxHTML"
|
|
|
|
WriteRegStr SHCTX "$0\.xht" "" "FirefoxHTML"
|
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
ReadRegStr $6 HKCR ".xhtml" ""
|
|
|
|
${If} "$6" != "FirefoxHTML"
|
|
|
|
WriteRegStr SHCTX "$0\.xhtml" "" "FirefoxHTML"
|
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
StrCpy $3 "$\"%1$\",,0,0,,,,"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
; An empty string is used for the 5th param because FirefoxHTML is not a
|
|
|
|
; protocol handler
|
2007-09-29 02:48:32 -07:00
|
|
|
${AddDDEHandlerValues} "FirefoxHTML" "$2" "$8,1" "${AppRegName} Document" "" \
|
|
|
|
"${DDEApplication}" "$3" "WWW_OpenURL"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
${AddDDEHandlerValues} "FirefoxURL" "$2" "$8,1" "${AppRegName} URL" "true" \
|
|
|
|
"${DDEApplication}" "$3" "WWW_OpenURL"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
; An empty string is used for the 4th & 5th params because the following
|
2007-09-29 02:48:32 -07:00
|
|
|
; protocol handlers already have a display name and the additional keys
|
|
|
|
; required for a protocol handler.
|
|
|
|
${AddDDEHandlerValues} "ftp" "$2" "$8,1" "" "" \
|
|
|
|
"${DDEApplication}" "$3" "WWW_OpenURL"
|
|
|
|
${AddDDEHandlerValues} "http" "$2" "$8,1" "" "" \
|
|
|
|
"${DDEApplication}" "$3" "WWW_OpenURL"
|
|
|
|
${AddDDEHandlerValues} "https" "$2" "$8,1" "" "" \
|
|
|
|
"${DDEApplication}" "$3" "WWW_OpenURL"
|
2007-03-22 10:30:00 -07:00
|
|
|
!macroend
|
|
|
|
!define SetHandlers "!insertmacro SetHandlers"
|
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
; The values for StartMenuInternet are only valid under HKLM and there can only
|
|
|
|
; be one installation registerred under StartMenuInternet per application since
|
|
|
|
; the key name is derived from the main application executable.
|
|
|
|
; http://support.microsoft.com/kb/297878
|
|
|
|
;
|
|
|
|
; Note: we might be able to get away with using the full path to the
|
|
|
|
; application executable for the key name in order to support multiple
|
|
|
|
; installations.
|
2007-03-22 10:30:00 -07:00
|
|
|
!macro SetStartMenuInternet
|
2007-09-29 02:48:32 -07:00
|
|
|
${GetLongPath} "$INSTDIR\${FileMainEXE}" $8
|
|
|
|
${GetLongPath} "$INSTDIR\uninstall\helper.exe" $7
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
${StrFilter} "${FileMainEXE}" "+" "" "" $R9
|
|
|
|
|
|
|
|
StrCpy $0 "Software\Clients\StartMenuInternet\$R9"
|
2007-06-17 21:28:02 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
WriteRegStr HKLM "$0" "" "${BrandFullName}"
|
|
|
|
|
|
|
|
WriteRegStr HKLM "$0\DefaultIcon" "" "$8,0"
|
|
|
|
|
|
|
|
; The Reinstall Command is defined at
|
|
|
|
; http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_adv/registeringapps.asp
|
|
|
|
WriteRegStr HKLM "$0\InstallInfo" "HideIconsCommand" "$\"$7$\" /HideShortcuts"
|
|
|
|
WriteRegStr HKLM "$0\InstallInfo" "ShowIconsCommand" "$\"$7$\" /ShowShortcuts"
|
|
|
|
WriteRegStr HKLM "$0\InstallInfo" "ReinstallCommand" "$\"$7$\" /SetAsDefaultAppGlobal"
|
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
ClearErrors
|
|
|
|
ReadRegDWORD $1 HKLM "$0\InstallInfo" "IconsVisible"
|
|
|
|
; If the IconsVisible name vale pair doesn't exist add it otherwise the
|
|
|
|
; application won't be displayed in Set Program Access and Defaults.
|
|
|
|
${If} ${Errors}
|
|
|
|
${If} ${FileExists} "$QUICKLAUNCH\${BrandFullName}.lnk"
|
|
|
|
WriteRegDWORD HKLM "$0\InstallInfo" "IconsVisible" 1
|
|
|
|
${Else}
|
|
|
|
WriteRegDWORD HKLM "$0\InstallInfo" "IconsVisible" 0
|
|
|
|
${EndIf}
|
|
|
|
${EndIf}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
WriteRegStr HKLM "$0\shell\open\command" "" "$8"
|
|
|
|
|
|
|
|
WriteRegStr HKLM "$0\shell\properties" "" "$(CONTEXT_OPTIONS)"
|
|
|
|
WriteRegStr HKLM "$0\shell\properties\command" "" "$\"$8$\" -preferences"
|
|
|
|
|
|
|
|
WriteRegStr HKLM "$0\shell\safemode" "" "$(CONTEXT_SAFE_MODE)"
|
|
|
|
WriteRegStr HKLM "$0\shell\safemode\command" "" "$\"$8$\" -safe-mode"
|
|
|
|
|
|
|
|
; Vista Capabilities registry keys
|
|
|
|
WriteRegStr HKLM "$0\Capabilities" "ApplicationDescription" "$(REG_APP_DESC)"
|
|
|
|
WriteRegStr HKLM "$0\Capabilities" "ApplicationIcon" "$8,0"
|
|
|
|
WriteRegStr HKLM "$0\Capabilities" "ApplicationName" "${BrandShortName}"
|
|
|
|
|
|
|
|
WriteRegStr HKLM "$0\Capabilities\FileAssociations" ".htm" "FirefoxHTML"
|
|
|
|
WriteRegStr HKLM "$0\Capabilities\FileAssociations" ".html" "FirefoxHTML"
|
|
|
|
WriteRegStr HKLM "$0\Capabilities\FileAssociations" ".shtml" "FirefoxHTML"
|
|
|
|
WriteRegStr HKLM "$0\Capabilities\FileAssociations" ".xht" "FirefoxHTML"
|
|
|
|
WriteRegStr HKLM "$0\Capabilities\FileAssociations" ".xhtml" "FirefoxHTML"
|
|
|
|
|
|
|
|
WriteRegStr HKLM "$0\Capabilities\StartMenu" "StartMenuInternet" "$R9"
|
|
|
|
|
|
|
|
WriteRegStr HKLM "$0\Capabilities\URLAssociations" "ftp" "FirefoxURL"
|
|
|
|
WriteRegStr HKLM "$0\Capabilities\URLAssociations" "http" "FirefoxURL"
|
|
|
|
WriteRegStr HKLM "$0\Capabilities\URLAssociations" "https" "FirefoxURL"
|
|
|
|
|
|
|
|
; Vista Registered Application
|
|
|
|
WriteRegStr HKLM "Software\RegisteredApplications" "${AppRegName}" "$0\Capabilities"
|
2007-09-29 02:48:32 -07:00
|
|
|
!macroend
|
|
|
|
!define SetStartMenuInternet "!insertmacro SetStartMenuInternet"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
!macro FixShellIconHandler
|
2007-03-22 10:30:00 -07:00
|
|
|
; The IconHandler reference for FirefoxHTML can end up in an inconsistent
|
|
|
|
; state due to changes not being detected by the IconHandler for side by side
|
|
|
|
; installs. The symptoms can be either an incorrect icon or no icon being
|
|
|
|
; displayed for files associated with Firefox. By setting it here it will
|
|
|
|
; always reference the install referenced in the
|
|
|
|
; HKLM\Software\Classes\FirefoxHTML registry key.
|
2007-09-29 02:48:32 -07:00
|
|
|
${GetLongPath} "$INSTDIR\${FileMainEXE}" $8
|
2007-03-22 10:30:00 -07:00
|
|
|
ClearErrors
|
|
|
|
ReadRegStr $2 HKLM "Software\Classes\FirefoxHTML\ShellEx\IconHandler" ""
|
|
|
|
${Unless} ${Errors}
|
|
|
|
ClearErrors
|
|
|
|
ReadRegStr $3 HKLM "Software\Classes\CLSID\$2\Old Icon\FirefoxHTML\DefaultIcon" ""
|
|
|
|
${Unless} ${Errors}
|
|
|
|
WriteRegStr HKLM "Software\Classes\CLSID\$2\Old Icon\FirefoxHTML\DefaultIcon" "" "$8,1"
|
|
|
|
${EndUnless}
|
|
|
|
${EndUnless}
|
|
|
|
!macroend
|
2007-09-29 02:48:32 -07:00
|
|
|
!define FixShellIconHandler "!insertmacro FixShellIconHandler"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
!macro SetAppKeys
|
2007-09-29 02:48:32 -07:00
|
|
|
${GetLongPath} "$INSTDIR" $8
|
2007-03-22 10:30:00 -07:00
|
|
|
StrCpy $0 "Software\Mozilla\${BrandFullNameInternal}\${AppVersion} (${AB_CD})\Main"
|
2007-09-29 02:48:32 -07:00
|
|
|
${WriteRegStr2} $TmpVal "$0" "Install Directory" "$8" 0
|
|
|
|
${WriteRegStr2} $TmpVal "$0" "PathToExe" "$8\${FileMainEXE}" 0
|
2007-03-22 10:30:00 -07:00
|
|
|
${WriteRegStr2} $TmpVal "$0" "Program Folder Path" "$SMPROGRAMS\$StartMenuDir" 0
|
|
|
|
|
|
|
|
SetShellVarContext all ; Set $DESKTOP to All Users
|
|
|
|
${Unless} ${FileExists} "$DESKTOP\${BrandFullName}.lnk"
|
|
|
|
SetShellVarContext current ; Set $DESKTOP to the current user's desktop
|
|
|
|
${EndUnless}
|
|
|
|
|
|
|
|
${If} ${FileExists} "$DESKTOP\${BrandFullName}.lnk"
|
|
|
|
ShellLink::GetShortCutArgs "$DESKTOP\${BrandFullName}.lnk"
|
|
|
|
Pop $1
|
2008-07-27 18:58:27 -07:00
|
|
|
${If} "$1" == ""
|
2007-03-22 10:30:00 -07:00
|
|
|
ShellLink::GetShortCutTarget "$DESKTOP\${BrandFullName}.lnk"
|
|
|
|
Pop $1
|
2007-09-29 02:48:32 -07:00
|
|
|
${GetLongPath} "$1" $1
|
|
|
|
${If} "$1" == "$8\${FileMainEXE}"
|
2007-03-22 10:30:00 -07:00
|
|
|
${WriteRegDWORD2} $TmpVal "$0" "Create Desktop Shortcut" 1 0
|
|
|
|
${Else}
|
|
|
|
${WriteRegDWORD2} $TmpVal "$0" "Create Desktop Shortcut" 0 0
|
|
|
|
${EndIf}
|
|
|
|
${EndIf}
|
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
; XXXrstrong - need a cleaner way to prevent unsetting SHCTX from HKLM when
|
|
|
|
; trying to find the desktop shortcut.
|
2008-07-27 18:58:27 -07:00
|
|
|
${If} "$TmpVal" == "HKCU"
|
2007-09-29 02:48:32 -07:00
|
|
|
SetShellVarContext current ; Set SHCTX to the current user (e.g. HKCU)
|
2007-03-22 10:30:00 -07:00
|
|
|
${Else}
|
2007-09-29 02:48:32 -07:00
|
|
|
SetShellVarContext all ; Set SHCTX to all users (e.g. HKLM)
|
2007-03-22 10:30:00 -07:00
|
|
|
${EndIf}
|
|
|
|
|
|
|
|
${If} ${FileExists} "$QUICKLAUNCH\${BrandFullName}.lnk"
|
|
|
|
ShellLink::GetShortCutArgs "$QUICKLAUNCH\${BrandFullName}.lnk"
|
|
|
|
Pop $1
|
2008-07-27 18:58:27 -07:00
|
|
|
${If} "$1" == ""
|
2007-03-22 10:30:00 -07:00
|
|
|
ShellLink::GetShortCutTarget "$QUICKLAUNCH\${BrandFullName}.lnk"
|
|
|
|
Pop $1
|
2007-09-29 02:48:32 -07:00
|
|
|
${GetLongPath} "$1" $1
|
2008-07-27 18:58:27 -07:00
|
|
|
${If} "$1" == "$8\${FileMainEXE}"
|
2007-03-22 10:30:00 -07:00
|
|
|
${WriteRegDWORD2} $TmpVal "$0" "Create Quick Launch Shortcut" 1 0
|
|
|
|
${Else}
|
|
|
|
${WriteRegDWORD2} $TmpVal "$0" "Create Quick Launch Shortcut" 0 0
|
|
|
|
${EndIf}
|
|
|
|
${EndIf}
|
|
|
|
${EndIf}
|
|
|
|
; XXXrstrong - "Create Start Menu Shortcut" and "Start Menu Folder" are only
|
|
|
|
; set in the installer and should also be set here for software update.
|
|
|
|
|
|
|
|
StrCpy $0 "Software\Mozilla\${BrandFullNameInternal}\${AppVersion} (${AB_CD})\Uninstall"
|
2007-09-29 02:48:32 -07:00
|
|
|
${WriteRegStr2} $TmpVal "$0" "Uninstall Log Folder" "$8\uninstall" 0
|
2007-03-22 10:30:00 -07:00
|
|
|
${WriteRegStr2} $TmpVal "$0" "Description" "${BrandFullNameInternal} (${AppVersion})" 0
|
|
|
|
|
|
|
|
StrCpy $0 "Software\Mozilla\${BrandFullNameInternal}\${AppVersion} (${AB_CD})"
|
|
|
|
${WriteRegStr2} $TmpVal "$0" "" "${AppVersion} (${AB_CD})" 0
|
|
|
|
|
|
|
|
StrCpy $0 "Software\Mozilla\${BrandFullNameInternal} ${AppVersion}\bin"
|
2007-09-29 02:48:32 -07:00
|
|
|
${WriteRegStr2} $TmpVal "$0" "PathToExe" "$8\${FileMainEXE}" 0
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
StrCpy $0 "Software\Mozilla\${BrandFullNameInternal} ${AppVersion}\extensions"
|
2007-09-29 02:48:32 -07:00
|
|
|
${WriteRegStr2} $TmpVal "$0" "Components" "$8\components" 0
|
|
|
|
${WriteRegStr2} $TmpVal "$0" "Plugins" "$8\plugins" 0
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
StrCpy $0 "Software\Mozilla\${BrandFullNameInternal} ${AppVersion}"
|
|
|
|
${WriteRegStr2} $TmpVal "$0" "GeckoVer" "${GREVersion}" 0
|
|
|
|
|
|
|
|
StrCpy $0 "Software\Mozilla\${BrandFullNameInternal}"
|
|
|
|
${WriteRegStr2} $TmpVal "$0" "" "${GREVersion}" 0
|
|
|
|
${WriteRegStr2} $TmpVal "$0" "CurrentVersion" "${AppVersion} (${AB_CD})" 0
|
|
|
|
!macroend
|
|
|
|
!define SetAppKeys "!insertmacro SetAppKeys"
|
|
|
|
|
|
|
|
!macro SetUninstallKeys
|
|
|
|
StrCpy $0 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${BrandFullNameInternal} (${AppVersion})"
|
2007-09-29 02:48:32 -07:00
|
|
|
${GetLongPath} "$INSTDIR" $8
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
; Write the uninstall registry keys
|
2007-03-22 10:30:00 -07:00
|
|
|
${WriteRegStr2} $TmpVal "$0" "Comments" "${BrandFullNameInternal}" 0
|
2007-09-29 02:48:32 -07:00
|
|
|
${WriteRegStr2} $TmpVal "$0" "DisplayIcon" "$8\${FileMainEXE},0" 0
|
2007-03-22 10:30:00 -07:00
|
|
|
${WriteRegStr2} $TmpVal "$0" "DisplayName" "${BrandFullNameInternal} (${AppVersion})" 0
|
|
|
|
${WriteRegStr2} $TmpVal "$0" "DisplayVersion" "${AppVersion} (${AB_CD})" 0
|
2007-09-29 02:48:32 -07:00
|
|
|
${WriteRegStr2} $TmpVal "$0" "InstallLocation" "$8" 0
|
2007-03-22 10:30:00 -07:00
|
|
|
${WriteRegStr2} $TmpVal "$0" "Publisher" "Mozilla" 0
|
2007-09-29 02:48:32 -07:00
|
|
|
${WriteRegStr2} $TmpVal "$0" "UninstallString" "$8\uninstall\helper.exe" 0
|
2007-03-22 10:30:00 -07:00
|
|
|
${WriteRegStr2} $TmpVal "$0" "URLInfoAbout" "${URLInfoAbout}" 0
|
|
|
|
${WriteRegStr2} $TmpVal "$0" "URLUpdateInfo" "${URLUpdateInfo}" 0
|
|
|
|
${WriteRegDWORD2} $TmpVal "$0" "NoModify" 1 0
|
|
|
|
${WriteRegDWORD2} $TmpVal "$0" "NoRepair" 1 0
|
|
|
|
!macroend
|
|
|
|
!define SetUninstallKeys "!insertmacro SetUninstallKeys"
|
|
|
|
|
|
|
|
!macro FixClassKeys
|
2007-09-29 02:48:32 -07:00
|
|
|
StrCpy $1 "SOFTWARE\Classes"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
; File handler keys and name value pairs that may need to be created during
|
|
|
|
; install or upgrade.
|
2007-09-29 02:48:32 -07:00
|
|
|
ReadRegStr $0 HKCR ".shtml" "Content Type"
|
|
|
|
${If} "$0" == ""
|
|
|
|
StrCpy $0 "$1\.shtml"
|
|
|
|
${WriteRegStr2} $TmpVal "$1\.shtml" "" "shtmlfile" 0
|
|
|
|
${WriteRegStr2} $TmpVal "$1\.shtml" "Content Type" "text/html" 0
|
|
|
|
${WriteRegStr2} $TmpVal "$1\.shtml" "PerceivedType" "text" 0
|
2007-03-22 10:30:00 -07:00
|
|
|
${EndIf}
|
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
ReadRegStr $0 HKCR ".xht" "Content Type"
|
|
|
|
${If} "$0" == ""
|
|
|
|
${WriteRegStr2} $TmpVal "$1\.xht" "" "xhtfile" 0
|
|
|
|
${WriteRegStr2} $TmpVal "$1\.xht" "Content Type" "application/xhtml+xml" 0
|
2007-03-22 10:30:00 -07:00
|
|
|
${EndIf}
|
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
ReadRegStr $0 HKCR ".xhtml" "Content Type"
|
|
|
|
${If} "$0" == ""
|
|
|
|
${WriteRegStr2} $TmpVal "$1\.xhtml" "" "xhtmlfile" 0
|
|
|
|
${WriteRegStr2} $TmpVal "$1\.xhtml" "Content Type" "application/xhtml+xml" 0
|
2007-03-22 10:30:00 -07:00
|
|
|
${EndIf}
|
2007-09-29 02:48:32 -07:00
|
|
|
!macroend
|
|
|
|
!define FixClassKeys "!insertmacro FixClassKeys"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
; Updates protocol handlers if their registry open command value is for this
|
|
|
|
; install location
|
|
|
|
!macro UpdateProtocolHandlers
|
|
|
|
; Store the command to open the app with an url in a register for easy access.
|
|
|
|
${GetLongPath} "$INSTDIR\${FileMainEXE}" $8
|
|
|
|
StrCpy $2 "$\"$8$\" -requestPending -osint -url $\"%1$\""
|
|
|
|
StrCpy $3 "$\"%1$\",,0,0,,,,"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
; Only set the file and protocol handlers if the existing one under HKCR is
|
|
|
|
; for this install location.
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
${IsHandlerForInstallDir} "FirefoxHTML" $R9
|
|
|
|
${If} "$R9" == "true"
|
|
|
|
; 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"
|
|
|
|
${EndIf}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
${IsHandlerForInstallDir} "FirefoxURL" $R9
|
|
|
|
${If} "$R9" == "true"
|
|
|
|
${AddDDEHandlerValues} "FirefoxURL" "$2" "$8,1" "${AppRegName} URL" "true" \
|
|
|
|
"${DDEApplication}" "$3" "WWW_OpenURL"
|
|
|
|
${EndIf}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
${IsHandlerForInstallDir} "ftp" $R9
|
|
|
|
${If} "$R9" == "true"
|
|
|
|
${AddDDEHandlerValues} "ftp" "$2" "$8,1" "" "" \
|
|
|
|
"${DDEApplication}" "$3" "WWW_OpenURL"
|
|
|
|
${EndIf}
|
2007-07-17 11:23:26 -07:00
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
${IsHandlerForInstallDir} "http" $R9
|
|
|
|
${If} "$R9" == "true"
|
|
|
|
${AddDDEHandlerValues} "http" "$2" "$8,1" "" "" \
|
|
|
|
"${DDEApplication}" "$3" "WWW_OpenURL"
|
|
|
|
${EndIf}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
${IsHandlerForInstallDir} "https" $R9
|
|
|
|
${If} "$R9" == "true"
|
|
|
|
${AddDDEHandlerValues} "https" "$2" "$8,1" "" "" \
|
|
|
|
"${DDEApplication}" "$3" "WWW_OpenURL"
|
|
|
|
${EndIf}
|
|
|
|
!macroend
|
|
|
|
!define UpdateProtocolHandlers "!insertmacro UpdateProtocolHandlers"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
!macro RemoveDeprecatedKeys
|
|
|
|
StrCpy $0 "SOFTWARE\Classes"
|
|
|
|
; Remove support for launching gopher urls from the shell during install or
|
|
|
|
; update if the DefaultIcon is from firefox.exe.
|
|
|
|
${RegCleanAppHandler} "gopher"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
; Remove support for launching chrome urls from the shell during install or
|
|
|
|
; update if the DefaultIcon is from firefox.exe (Bug 301073).
|
|
|
|
${RegCleanAppHandler} "chrome"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
; Remove protocol handler registry keys added by the MS shim
|
|
|
|
DeleteRegKey HKLM "Software\Classes\Firefox.URL"
|
|
|
|
DeleteRegKey HKCU "Software\Classes\Firefox.URL"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
; Remove the app compatibility registry key
|
|
|
|
StrCpy $0 "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"
|
|
|
|
DeleteRegValue HKLM "$0" "$INSTDIR\${FileMainEXE}"
|
|
|
|
DeleteRegValue HKCU "$0" "$INSTDIR\${FileMainEXE}"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
; Delete gopher from Capabilities\URLAssociations if it is present.
|
|
|
|
${StrFilter} "${FileMainEXE}" "+" "" "" $R9
|
|
|
|
StrCpy $0 "Software\Clients\StartMenuInternet\$R9"
|
2007-07-17 11:23:26 -07:00
|
|
|
ClearErrors
|
2007-09-29 02:48:32 -07:00
|
|
|
ReadRegStr $2 HKLM "$0\Capabilities\URLAssociations" "gopher"
|
2007-07-17 11:23:26 -07:00
|
|
|
${Unless} ${Errors}
|
2007-09-29 02:48:32 -07:00
|
|
|
DeleteRegValue HKLM "$0\Capabilities\URLAssociations" "gopher"
|
2007-07-17 11:23:26 -07:00
|
|
|
${EndUnless}
|
2007-07-23 12:27:04 -07:00
|
|
|
|
2007-09-29 02:48:32 -07:00
|
|
|
; Delete gopher from the user's UrlAssociations if it points to FirefoxURL.
|
|
|
|
StrCpy $0 "Software\Microsoft\Windows\Shell\Associations\UrlAssociations\gopher"
|
|
|
|
ReadRegStr $2 HKCU "$0\UserChoice" "Progid"
|
2008-07-27 18:58:27 -07:00
|
|
|
${If} "$2" == "FirefoxURL"
|
2007-09-29 02:48:32 -07:00
|
|
|
DeleteRegKey HKCU "$0"
|
|
|
|
${EndIf}
|
2007-03-22 10:30:00 -07:00
|
|
|
!macroend
|
2007-09-29 02:48:32 -07:00
|
|
|
!define RemoveDeprecatedKeys "!insertmacro RemoveDeprecatedKeys"
|
2007-11-30 11:02:09 -08:00
|
|
|
|
|
|
|
; The files to check if they are in use during (un)install so the restart is
|
2008-03-19 14:27:39 -07:00
|
|
|
; required message is displayed. All files must be located in the $INSTDIR
|
|
|
|
; directory.
|
2007-11-30 11:02:09 -08:00
|
|
|
!macro PushFilesToCheck
|
|
|
|
; The first string to be pushed onto the stack MUST be "end" to indicate
|
2008-03-19 14:27:39 -07:00
|
|
|
; that there are no more files to check in $INSTDIR and the last string
|
2007-11-30 11:02:09 -08:00
|
|
|
; should be ${FileMainEXE} so if it is in use the CheckForFilesInUse macro
|
|
|
|
; returns after the first check.
|
|
|
|
Push "end"
|
|
|
|
Push "AccessibleMarshal.dll"
|
|
|
|
Push "freebl3.dll"
|
|
|
|
Push "nssckbi.dll"
|
|
|
|
Push "nspr4.dll"
|
|
|
|
Push "nssdbm3.dll"
|
|
|
|
Push "sqlite3.dll"
|
|
|
|
Push "xpcom.dll"
|
|
|
|
Push "crashreporter.exe"
|
|
|
|
Push "updater.exe"
|
|
|
|
Push "xpicleanup.exe"
|
|
|
|
Push "${FileMainEXE}"
|
|
|
|
!macroend
|
|
|
|
!define PushFilesToCheck "!insertmacro PushFilesToCheck"
|