Bug #354897 --> thunderbird installer changes to support vista including renaming uninst.exe to helper.exe.

r=rob strong
This commit is contained in:
scott%scott-macgregor.org 2007-02-26 07:18:45 +00:00
Родитель e33dab905e
Коммит 14dabe7356
14 изменённых файлов: 775 добавлений и 251 удалений

Просмотреть файл

@ -213,5 +213,7 @@ mozABConduit.dll
components/palmsync.dll
components/palmSync.xpt
uninstall/UninstallThunderbird.exe
uninstall/uninst.exe
uninstall/uninstall.exe
components/myspell/en-US.dic
components/myspell/en-US.aff

Просмотреть файл

@ -56,6 +56,7 @@ INSTALLER_FILES = \
app.tag \
nsis/installer.nsi \
nsis/uninstaller.nsi \
nsis/shared.nsh \
$(NULL)
BRANDING_FILES = \

Просмотреть файл

@ -35,7 +35,7 @@
# ***** END LICENSE BLOCK *****
# NSIS defines for nightly builds.
# The release build branding.nsi is located in other-license/branding/firefox/
# The release build branding.nsi is located in other-license/branding/thunderbird/
!define BrandShortName "Thunderbird"
!define BrandFullName "Mozilla Thunderbird"
# BrandFullNameInternal is used for some registry and file system values that

Просмотреть файл

@ -8,3 +8,6 @@
!define FileMainEXE "thunderbird.exe"
!define WindowClass "ThunderbirdMessageWindow"
!define AppRegNameMail "Thunderbird"
!define AppRegNameNews "Thunderbird (News)"

Просмотреть файл

@ -62,7 +62,6 @@ Var AddQuickLaunchSC
Var AddDesktopSC
Var fhInstallLog
Var fhUninstallLog
Var ShortPathNameToExe
; Other included files may depend upon these includes!
; The following includes are provided by NSIS.
@ -85,6 +84,11 @@ Var ShortPathNameToExe
!insertmacro GetRoot
!insertmacro DriveSpace
; 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
@ -101,15 +105,16 @@ VIAddVersionKey "FileDescription" "${BrandShortName} Installer"
!insertmacro WriteRegDWORD2
!insertmacro CanWriteToInstallDir
!insertmacro CheckDiskSpace
!insertmacro GetPathFromString
!insertmacro AddHandlerValues
!insertmacro DisplayCopyErrMsg
!include overrides.nsh
!insertmacro LocateNoDetails
!insertmacro TextCompareNoDetails
!include shared.nsh
Name "${BrandFullName}"
OutFile "setup.exe"
InstallDirRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${BrandFullNameInternal} (${AppVersion})" "InstallLocation"
InstallDir "$PROGRAMFILES\${BrandFullName}"
InstallDir "$PROGRAMFILES\${BrandFullName}\"
ShowInstDetails nevershow
ReserveFile options.ini
@ -190,8 +195,9 @@ Section "-Application" Section1
SetDetailsPrint none
SetOutPath $INSTDIR
; Try to delete the app executable and if we can't delete it try to close the
; app. This allows running an instance that is located in another directory.
; Try to delete the app's main executable and if we can't delete it try to
; close the app. This allows running an instance that is located in another
; directory and prevents the launching of the app during the installation.
ClearErrors
${If} ${FileExists} "$INSTDIR\${FileMainEXE}"
${DeleteFile} "$INSTDIR\${FileMainEXE}"
@ -201,10 +207,31 @@ Section "-Application" Section1
${CloseApp} "true" $(WARN_APP_RUNNING_INSTALL)
; Try to delete it again to prevent launching the app while we are
; installing.
${DeleteFile} "$INSTDIR\${FileMainEXE}"
ClearErrors
${DeleteFile} "$INSTDIR\${FileMainEXE}"
${If} ${Errors}
ClearErrors
; Try closing the app a second time
${CloseApp} "true" $(WARN_APP_RUNNING_INSTALL)
retry:
ClearErrors
${DeleteFile} "$INSTDIR\${FileMainEXE}"
${If} ${Errors}
; Fallback to the FileError_NoIgnore error with retry/cancel options
${DisplayCopyErrMsg} "${FileMainEXE}"
GoTo retry
${EndIf}
${EndIf}
${EndIf}
; During an install Vista checks if a new entry is added under the uninstall
; registry key (e.g. ARP). When the same version of the app is installed on
; top of an existing install the key is deleted / added and the Program
; Compatibility Assistant doesn't see this as a new entry and displays an
; error to the user. See Bug 354000.
StrCpy $0 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${BrandFullNameInternal} (${AppVersion})"
DeleteRegKey HKLM "$0"
; For a "Standard" upgrade without talkback installed add the InstallDisabled
; file to the talkback source files so it will be disabled by the extension
; manager. This is done at the start of the installation since we check for
@ -312,19 +339,6 @@ Section "-Application" Section1
${LogUninstall} "DLLReg: \AccessibleMarshal.dll"
${LogMsg} "Registered: $INSTDIR\AccessibleMarshal.dll"
${EndIf}
; MapiProxy.dll can be used by multiple applications but
; is only registered for the last application installed. When the last
; application installed is uninstalled MapiProxy.dll will no longer be
; registered.
ClearErrors
RegDLL "$INSTDIR\MapiProxy.dll"
${If} ${Errors}
${LogMsg} "** ERROR Registering: $INSTDIR\MapiProxy.dll **"
${Else}
${LogUninstall} "DLLReg: \MapiProxy.dll"
${LogMsg} "Registered: $INSTDIR\MapiProxy.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
@ -400,150 +414,40 @@ Section "-Application" Section1
; 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}
StrCpy $0 "Software\Mozilla\${BrandFullNameInternal}\${AppVersion} (${AB_CD})\Main"
${WriteRegStr2} $TmpVal "$0" "Install Directory" "$INSTDIR" 0
${WriteRegStr2} $TmpVal "$0" "PathToExe" "$INSTDIR\${FileMainEXE}" 0
${WriteRegStr2} $TmpVal "$0" "Program Folder Path" "$SMPROGRAMS\$StartMenuDir" 0
${WriteRegDWORD2} $TmpVal "$0" "Create Quick Launch Shortcut" $AddQuickLaunchSC 0
${WriteRegDWORD2} $TmpVal "$0" "Create Desktop Shortcut" $AddDesktopSC 0
; 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
StrCpy $0 "Software\Mozilla\${BrandFullNameInternal}\${AppVersion} (${AB_CD})\Uninstall"
${WriteRegStr2} $TmpVal "$0" "Uninstall Log Folder" "$INSTDIR\uninstall" 0
${WriteRegStr2} $TmpVal "$0" "Description" "${BrandFullNameInternal} (${AppVersion})" 0
${FixClassKeys}
StrCpy $0 "Software\Mozilla\${BrandFullNameInternal}\${AppVersion} (${AB_CD})"
${WriteRegStr2} $TmpVal "$0" "" "${AppVersion} (${AB_CD})" 0
; 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}
StrCpy $0 "Software\Mozilla\${BrandFullNameInternal} ${AppVersion}\bin"
${WriteRegStr2} $TmpVal "$0" "PathToExe" "$INSTDIR\${FileMainEXE}" 0
; Set the Start Menu Internet and Vista Registered App HKLM registry keys.
${SetClientsMail}
StrCpy $0 "Software\Mozilla\${BrandFullNameInternal} ${AppVersion}\extensions"
${WriteRegStr2} $TmpVal "$0" "Components" "$INSTDIR\components" 0
${WriteRegStr2} $TmpVal "$0" "Plugins" "$INSTDIR\plugins" 0
; If we are writing to HKLM and create the quick launch and the desktop
; shortcuts set IconsVisible to 1 otherwise to 0.
${If} $AddQuickLaunchSC == 1
${OrIf} $AddDesktopSC == 1
StrCpy $0 "Software\Clients\Mail\${BrandFullNameInternal}\InstallInfo"
WriteRegDWORD HKLM "$0" "IconsVisible" 1
${Else}
WriteRegDWORD HKLM "$0" "IconsVisible" 0
${EndIf}
${EndIf}
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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Add the Mail registry keys
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
GetFullPathName /SHORT $ShortPathNameToExe "$INSTDIR\${FileMainEXE}"
StrCpy $0 "Software\Clients\Mail\${BrandFullNameInternal}"
${WriteRegStr2} $TmpVal "$0" "" "${BrandFullNameInternal}" 0
GetFullPathName /SHORT $1 "$INSTDIR\mozMapi32.dll"
${WriteRegStr2} $TmpVal "$0" "DLLPath" "$1" 0
StrCpy $0 "Software\Clients\Mail\${BrandFullNameInternal}\DefaultIcon"
StrCpy $1 "$\"$INSTDIR\${FileMainEXE}$\",0"
${WriteRegStr2} $TmpVal "$0" "" "$1" 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
StrCpy $0 "Software\Clients\Mail\${BrandFullNameInternal}\InstallInfo"
; the old installer didn't pass in 'mail' here...
StrCpy $1 "$\"$INSTDIR\uninstall\uninst.exe$\" /ua $\"${AppVersion} (${AB_CD})$\" /hs mail"
${WriteRegStr2} $TmpVal "$0" "HideIconsCommand" "$1" 0
${WriteRegDWORD2} $TmpVal "$0" "IconsVisible" 1 0
StrCpy $1 "$\"$INSTDIR\${FileMainEXE}$\" -silent -setDefaultMail"
${WriteRegStr2} $TmpVal "$0" "ReinstallCommand" "$1" 0
StrCpy $1 "$\"$INSTDIR\uninstall\uninst.exe$\" /ua $\"${AppVersion} (${AB_CD})$\" /ss mail"
${WriteRegStr2} $TmpVal "$0" "ShowIconsCommand" "$1" 0
; shell/open/command
StrCpy $0 "Software\Clients\Mail\${BrandFullNameInternal}\shell\open\command"
${WriteRegStr2} $TmpVal "$0" "" "$ShortPathNameToExe" 0
; shell/properties/command
StrCpy $0 "Software\Clients\Mail\${BrandFullNameInternal}\shell\properties"
${WriteRegStr2} $TmpVal "$0" "" "$(OPTIONS)" 0
StrCpy $0 "Software\Clients\Mail\${BrandFullNameInternal}\shell\properties\command"
${WriteRegStr2} $TmpVal "$0" "" "$ShortPathNameToExe -options" 0
; protocols/mailto
StrCpy $0 "Software\Clients\Mail\${BrandFullNameInternal}\protocols\mailto"
${WriteRegStr2} $TmpVal "$0" "" "URL:MailTo Protocol" 0
${WriteRegStr2} $TmpVal "$0" "URL Protocol" "" 0
StrCpy $0 "Software\Clients\Mail\${BrandFullNameInternal}\protocols\mailto\DefaultIcon"
StrCpy $1 "$\"$ShortPathNameToExe$\",0"
${WriteRegStr2} $TmpVal "$0" "" "$1" 0
StrCpy $0 "Software\Clients\Mail\${BrandFullNameInternal}\protocols\mailto\shell\open\command"
StrCpy $1 "$ShortPathNameToExe -compose $\"%1$\""
${WriteRegStr2} $TmpVal "$0" "" "$1" 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Add the News registry keys
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
StrCpy $0 "Software\Clients\News\${BrandFullNameInternal}"
${WriteRegStr2} $TmpVal "$0" "" "${BrandFullNameInternal}" 0
StrCpy $0 "Software\Clients\News\${BrandFullNameInternal}\DefaultIcon"
StrCpy $1 "$\"$INSTDIR\${FileMainEXE}$\",0"
${WriteRegStr2} $TmpVal "$0" "" "$1" 0
; shell/open/command
StrCpy $0 "Software\Clients\News\${BrandFullNameInternal}\shell\open\command"
; 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
; protocols/news
StrCpy $0 "Software\Clients\News\${BrandFullNameInternal}\protocols\news"
${WriteRegStr2} $TmpVal "$0" "" "URL:News Protocol" 0
${WriteRegStr2} $TmpVal "$0" "URL Protocol" "" 0
StrCpy $0 "Software\Clients\News\${BrandFullNameInternal}\protocols\news\DefaultIcon"
StrCpy $1 "$\"$INSTDIR\${FileMainEXE}$\",0"
${WriteRegStr2} $TmpVal "$0" "" "$1" 0
StrCpy $0 "Software\Clients\News\${BrandFullNameInternal}\protocols\news\shell\open\command"
StrCpy $1 "$INSTDIR\${FileMainEXE} -mail $\"%1$\""
${WriteRegStr2} $TmpVal "$0" "" "$1" 0
${WriteRegStr2} $TmpVal "$0" "Path" "$INSTDIR" 0
; protocols/nntp
StrCpy $0 "Software\Clients\News\${BrandFullNameInternal}\protocols\nntp"
${WriteRegStr2} $TmpVal "$0" "" "URL:NNTP Protocol" 0
${WriteRegStr2} $TmpVal "$0" "URL Protocol" "" 0
StrCpy $0 "Software\Clients\News\${BrandFullNameInternal}\protocols\nntp\DefaultIcon"
StrCpy $1 "$\"$INSTDIR\${FileMainEXE}$\",0"
${WriteRegStr2} $TmpVal "$0" "" "$1" 0
StrCpy $0 "Software\Clients\News\${BrandFullNameInternal}\protocols\nntp\shell\open\command"
StrCpy $1 "$INSTDIR\${FileMainEXE} -mail $\"%1$\""
${WriteRegStr2} $TmpVal "$0" "" "$1" 0
; protocols/nntp
StrCpy $0 "Software\Clients\News\${BrandFullNameInternal}\protocols\snews"
${WriteRegStr2} $TmpVal "$0" "" "URL:Snews Protocol" 0
${WriteRegStr2} $TmpVal "$0" "URL Protocol" "" 0
StrCpy $0 "Software\Clients\News\${BrandFullNameInternal}\protocols\snews\DefaultIcon"
StrCpy $1 "$\"$INSTDIR\${FileMainEXE}$\",0"
${WriteRegStr2} $TmpVal "$0" "" "$1" 0
StrCpy $0 "Software\Clients\News\${BrandFullNameInternal}\protocols\snews\shell\open\command"
StrCpy $1 "$INSTDIR\${FileMainEXE} -mail $\"%1$\""
${WriteRegStr2} $TmpVal "$0" "" "$1" 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; End of protocol registration
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Write the uninstall registry keys
StrCpy $0 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${BrandFullNameInternal} (${AppVersion})"
StrCpy $1 "$INSTDIR\uninstall\uninst.exe"
${WriteRegStr2} $TmpVal "$0" "Comments" "${BrandFullNameInternal}" 0
${WriteRegStr2} $TmpVal "$0" "DisplayIcon" "$INSTDIR\${FileMainEXE},0" 0
${WriteRegStr2} $TmpVal "$0" "DisplayName" "${BrandFullNameInternal} (${AppVersion})" 0
${WriteRegStr2} $TmpVal "$0" "DisplayVersion" "${AppVersion} (${AB_CD})" 0
${WriteRegStr2} $TmpVal "$0" "InstallLocation" "$INSTDIR" 0
${WriteRegStr2} $TmpVal "$0" "Publisher" "Mozilla" 0
${WriteRegStr2} $TmpVal "$0" "UninstallString" "$1" 0
${WriteRegStr2} $TmpVal "$0" "URLInfoAbout" "${URLInfoAbout}" 0
${WriteRegStr2} $TmpVal "$0" "URLUpdateInfo" "${URLUpdateInfo}" 0
${WriteRegDWORD2} $TmpVal "$0" "NoModify" 1 0
${WriteRegDWORD2} $TmpVal "$0" "NoRepair" 1 0
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
; Create Start Menu shortcuts
@ -709,12 +613,16 @@ FunctionEnd
Function CopyFile
StrCpy $R3 $R8 "" $R2
retry:
ClearErrors
${If} $R6 == ""
${Unless} ${FileExists} "$R1$R3\$R7"
ClearErrors
CreateDirectory "$R1$R3\$R7"
${If} ${Errors}
${LogMsg} "** ERROR Creating Directory: $R1$R3\$R7 **"
${DisplayCopyErrMsg} "$R7"
GoTo retry
${Else}
${LogMsg} "Created Directory: $R1$R3\$R7"
${EndIf}
@ -725,25 +633,32 @@ Function CopyFile
CreateDirectory "$R1$R3"
${If} ${Errors}
${LogMsg} "** ERROR Creating Directory: $R1$R3 **"
${DisplayCopyErrMsg} "$R3"
GoTo retry
${Else}
${LogMsg} "Created Directory: $R1$R3"
${EndIf}
${EndUnless}
${If} ${FileExists} "$R1$R3\$R7"
Delete "$R1$R3\$R7"
${If} ${Errors}
${DisplayCopyErrMsg} "$R7"
GoTo retry
${EndIf}
${EndIf}
ClearErrors
CopyFiles /SILENT $R9 "$R1$R3"
${If} ${Errors}
; XXXrstrong - what should we do if there is an error installing a file?
${LogMsg} "** ERROR Installing File: $R1$R3\$R7 **"
${DisplayCopyErrMsg} "$R7"
GoTo retry
${Else}
${LogMsg} "Installed File: $R1$R3\$R7"
${EndIf}
; If the file is installed into the installation directory remove the
; installation directory's path from the file path when writing to the
; uninstall.log so it will be a relative path. This allows the same
; uninst.exe to be used with zip builds if we supply an uninstall.log.
; helper.exe to be used with zip builds if we supply an uninstall.log.
${WordReplace} "$R1$R3\$R7" "$INSTDIR" "" "+" $R3
${LogUninstall} "File: $R3"
${EndIf}
@ -1049,6 +964,7 @@ Function .onInit
ReadINIStr $0 $R1 "Install" "CloseAppNoPrompt"
${If} $0 == "true"
; Try to close the app if the exe is in use.
ClearErrors
${If} ${FileExists} "$INSTDIR\${FileMainEXE}"
${DeleteFile} "$INSTDIR\${FileMainEXE}"
@ -1056,7 +972,18 @@ Function .onInit
${If} ${Errors}
ClearErrors
${CloseApp} "false" ""
ClearErrors
${DeleteFile} "$INSTDIR\${FileMainEXE}"
; If unsuccessful try one more time and if it still fails Quit
${If} ${Errors}
ClearErrors
${CloseApp} "false" ""
ClearErrors
${DeleteFile} "$INSTDIR\${FileMainEXE}"
${If} ${Errors}
Quit
${EndIf}
${EndIf}
${EndIf}
${EndIf}

Просмотреть файл

@ -0,0 +1,435 @@
# ***** 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>
# Scott MacGregor <mscott@mozilla.org>
#
# 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
SetShellVarContext all
${SetClientsMail}
; Remove registry entries for non-existent apps and for apps that point to our
; install location in the Software\Mozilla key.
SetShellVarContext current ; Set SHCTX to HKCU
${RegCleanMain} "Software\Mozilla"
SetShellVarContext all ; Set SHCTX to HKLM
${RegCleanMain} "Software\Mozilla"
; Remove uninstall entries that point to our install location
${RegCleanUninstall}
; Add Software\Mozilla\ registry entries
${SetAppKeys}
${SetUninstallKeys}
${FixClassKeys}
!macroend
!define PostUpdate "!insertmacro PostUpdate"
!macro SetAsDefaultAppUser
SetShellVarContext current
${SetHandlers}
!macroend
!define SetAsDefaultAppUser "!insertmacro SetAsDefaultAppUser"
!macro SetAsDefaultAppGlobal
SetShellVarContext all
${SetHandlers}
${SetClientsMail}
WriteRegStr HKLM "Software\Clients\Mail" "" "${BrandFullNameInternal}"
${ShowShortcuts}
!macroend
!define SetAsDefaultAppGlobal "!insertmacro SetAsDefaultAppGlobal"
!macro HideShortcuts
StrCpy $R1 "Software\Clients\Mail\${BrandFullNameInternal}\InstallInfo"
WriteRegDWORD HKLM $R1 "IconsVisible" 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 $0
${If} $0 == ""
ShellLink::GetShortCutTarget "$DESKTOP\${BrandFullName}.lnk"
Pop $0
; Needs to handle short paths
${If} $0 == "$INSTDIR\${FileMainEXE}"
Delete "$DESKTOP\${BrandFullName}.lnk"
${EndIf}
${EndIf}
${EndIf}
${If} ${FileExists} "$QUICKLAUNCH\${BrandFullName}.lnk"
ShellLink::GetShortCutArgs "$QUICKLAUNCH\${BrandFullName}.lnk"
Pop $0
${If} $0 == ""
ShellLink::GetShortCutTarget "$QUICKLAUNCH\${BrandFullName}.lnk"
Pop $0
; Needs to handle short paths
${If} $0 == "$INSTDIR\${FileMainEXE}"
Delete "$QUICKLAUNCH\${BrandFullName}.lnk"
${EndIf}
${EndIf}
${EndIf}
!macroend
!define HideShortcuts "!insertmacro HideShortcuts"
!macro ShowShortcuts
StrCpy $R1 "Software\Clients\Mail\${BrandFullNameInternal}\InstallInfo"
WriteRegDWORD HKLM $R1 "IconsVisible" 1
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
GetFullPathName $8 "$INSTDIR\${FileMainEXE}"
StrCpy $0 "SOFTWARE\Classes"
StrCpy $2 "$\"$8$\" -mail $\"%1$\""
StrCpy $3 "$\"$8$\" -compose $\"%1$\""
; Associate the file handlers with ThunderbirdEML
WriteRegStr SHCTX "$0\.eml" "" "ThunderbirdEML"
; An empty string is used for the 5th param because ThunderbirdEML is not a
; protocol handler
${AddHandlerValues} "$0\ThunderbirdEML" "$2" "$8,1" "${AppRegNameMail} Document" "" ""
${AddHandlerValues} "$0\Thunderbird.Url.mailto" "$3" "$8,0" "${AppRegNameMail} URL" "true" ""
${AddHandlerValues} "$0\Thunderbird.Url.news" "$2" "$8,0" "${AppRegNameNews} URL" "true" ""
; An empty string is used for the 4th & 5th params because the following
; protocol handlers already have a display name and additional keys required
; for a protocol handler.
${AddHandlerValues} "$0\mailto" "$3" "$8,0" "${AppRegNameMail} URL" "true" ""
${AddHandlerValues} "$0\news" "$2" "$8,0" "${AppRegNameMail} URL" "true" ""
${AddHandlerValues} "$0\nntp" "$2" "$8,0" "${AppRegNameMail} URL" "true" ""
${AddHandlerValues} "$0\snews" "$2" "$8,0" "${AppRegNameMail} URL" "true" ""
!macroend
!define SetHandlers "!insertmacro SetHandlers"
; XXXrstrong - there are several values that will be overwritten by and
; overwrite other installs of the same application.
!macro SetClientsMail
GetFullPathName $8 "$INSTDIR\${FileMainEXE}"
GetFullPathName $7 "$INSTDIR\uninstall\helper.exe"
GetFullPathName $6 "$INSTDIR\mozMapi32.dll"
StrCpy $0 "Software\Clients\Mail\${BrandFullNameInternal}"
; Remove existing keys so we only have our settings
DeleteRegKey HKLM "$0"
WriteRegStr HKLM "$0" "" "${BrandFullNameInternal}"
WriteRegStr HKLM "$0\DefaultIcon" "" "$8,0"
WriteRegStr HKLM "$0" "DLLPath" "$6"
; MapiProxy.dll can exist in multiple installs of the application. Registration
; occurs as follows with the last action to occur being the one that wins:
; On install and software update when helper.exe runs with the /PostUpdate
; argument. On setting the application as the system's default application
; using Window's "Set program access and defaults".
!ifndef NO_LOG
${LogHeader} "DLL Registration"
!endif
ClearErrors
RegDLL "$INSTDIR\MapiProxy.dll"
!ifndef NO_LOG
${If} ${Errors}
${LogMsg} "** ERROR Registering: $INSTDIR\MapiProxy.dll **"
${Else}
${LogUninstall} "DLLReg: \MapiProxy.dll"
${LogMsg} "Registered: $INSTDIR\MapiProxy.dll"
${EndIf}
!endif
StrCpy $1 "Software\Classes\CLSID\{29F458BE-8866-11D5-A3DD-00B0D0F3BAA7}"
WriteRegStr HKLM "$1\LocalServer32" "" "$\"$8$\" /MAPIStartup"
WriteRegStr HKLM "$1\ProgID" "" "MozillaMapi.1"
WriteRegStr HKLM "$1\VersionIndependentProgID" "" "MozillaMAPI"
StrCpy $1 "SOFTWARE\Classes"
WriteRegStr HKLM "$1\MozillaMapi" "" "Mozilla MAPI"
WriteRegStr HKLM "$1\MozillaMapi\CLSID" "" "{29F458BE-8866-11D5-A3DD-00B0D0F3BAA7}"
WriteRegStr HKLM "$1\MozillaMapi\CurVer" "" "MozillaMapi.1"
WriteRegStr HKLM "$1\MozillaMapi.1" "" "Mozilla MAPI"
WriteRegStr HKLM "$1\MozillaMapi.1\CLSID" "" "{29F458BE-8866-11D5-A3DD-00B0D0F3BAA7}"
; 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"
; Mail shell/open/command
WriteRegStr HKLM "$0\shell\open\command" "" "$\"$8$\" -mail"
; options
WriteRegStr HKLM "$0\shell\properties" "" "$(CONTEXT_OPTIONS)"
WriteRegStr HKLM "$0\shell\properties\command" "" "$\"$8$\" -options"
; safemode
WriteRegStr HKLM "$0\shell\safemode" "" "$(CONTEXT_SAFE_MODE)"
WriteRegStr HKLM "$0\shell\safemode\command" "" "$\"$8$\" -safe-mode"
; Protocols
StrCpy $1 "$\"$8$\" -compose $\"%1$\""
${AddHandlerValues} "$0\Protocols\mailto" "$1" "$8,0" "${AppRegNameMail} URL" "true" ""
; Vista Capabilities registry keys
WriteRegStr HKLM "$0\Capabilities" "ApplicationDescription" "$(REG_APP_DESC)"
WriteRegStr HKLM "$0\Capabilities" "ApplicationIcon" "$8,0"
WriteRegStr HKLM "$0\Capabilities" "ApplicationName" "${AppRegNameMail}"
WriteRegStr HKLM "$0\Capabilities\FileAssociations" ".eml" "ThunderbirdEML"
WriteRegStr HKLM "$0\Capabilities\StartMenu" "Mail" "${BrandFullNameInternal}"
WriteRegStr HKLM "$0\Capabilities\URLAssociations" "mailto" "Thunderbird.Url.mailto"
; Vista Registered Application
WriteRegStr HKLM "Software\RegisteredApplications" "${AppRegNameMail}" "$0\Capabilities"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; News
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
StrCpy $0 "Software\Clients\News\${BrandFullNameInternal}"
; Remove existing keys so we only have our settings
DeleteRegKey HKLM "$0"
WriteRegStr HKLM "$0" "" "${BrandFullNameInternal}"
WriteRegStr HKLM "$0\DefaultIcon" "" "$8,0"
WriteRegStr HKLM "$0" "DLLPath" "$6"
; Mail shell/open/command
WriteRegStr HKLM "$0\shell\open\command" "" "$\"$8$\" -mail"
; Vista Capabilities registry keys
WriteRegStr HKLM "$0\Capabilities" "ApplicationDescription" "$(REG_APP_DESC)"
WriteRegStr HKLM "$0\Capabilities" "ApplicationIcon" "$8,0"
WriteRegStr HKLM "$0\Capabilities" "ApplicationName" "${AppRegNameNews}"
WriteRegStr HKLM "$0\Capabilities\URLAssociations" "nntp" "Thunderbird.Url.news"
WriteRegStr HKLM "$0\Capabilities\URLAssociations" "news" "Thunderbird.Url.news"
WriteRegStr HKLM "$0\Capabilities\URLAssociations" "snews" "Thunderbird.Url.news"
; Protocols
StrCpy $1 "$\"$8$\" -mail $\"%1$\""
${AddHandlerValues} "$0\Protocols\nntp" "$1" "$8,0" "${AppRegNameNews} URL" "true" ""
${AddHandlerValues} "$0\Protocols\news" "$1" "$8,0" "${AppRegNameNews} URL" "true" ""
${AddHandlerValues} "$0\Protocols\snews" "$1" "$8,0" "${AppRegNameNews} URL" "true" ""
; Vista Registered Application
WriteRegStr HKLM "Software\RegisteredApplications" "${AppRegNameNews}" "$0\Capabilities"
!macroend
!define SetClientsMail "!insertmacro SetClientsMail"
!macro SetAppKeys
StrCpy $0 "Software\Mozilla\${BrandFullNameInternal}\${AppVersion} (${AB_CD})\Main"
${WriteRegStr2} $TmpVal "$0" "Install Directory" "$INSTDIR" 0
${WriteRegStr2} $TmpVal "$0" "PathToExe" "$INSTDIR\${FileMainEXE}" 0
${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
${If} $1 == ""
ShellLink::GetShortCutTarget "$DESKTOP\${BrandFullName}.lnk"
Pop $1
; Needs to handle short paths
${If} $1 == "$INSTDIR\${FileMainEXE}"
${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.
${If} $TmpVal == "HKCU"
SetShellVarContext current
${Else}
SetShellVarContext all
${EndIf}
${If} ${FileExists} "$QUICKLAUNCH\${BrandFullName}.lnk"
ShellLink::GetShortCutArgs "$QUICKLAUNCH\${BrandFullName}.lnk"
Pop $1
${If} $1 == ""
ShellLink::GetShortCutTarget "$QUICKLAUNCH\${BrandFullName}.lnk"
Pop $1
; Needs to handle short paths
${If} $1 == "$INSTDIR\${FileMainEXE}"
${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"
${WriteRegStr2} $TmpVal "$0" "Uninstall Log Folder" "$INSTDIR\uninstall" 0
${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"
${WriteRegStr2} $TmpVal "$0" "PathToExe" "$INSTDIR\${FileMainEXE}" 0
StrCpy $0 "Software\Mozilla\${BrandFullNameInternal} ${AppVersion}\extensions"
${WriteRegStr2} $TmpVal "$0" "Components" "$INSTDIR\components" 0
${WriteRegStr2} $TmpVal "$0" "Plugins" "$INSTDIR\plugins" 0
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
; Write the uninstall registry keys
StrCpy $0 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${BrandFullNameInternal} (${AppVersion})"
GetFullPathName $8 "$INSTDIR\${FileMainEXE}"
GetFullPathName $7 "$INSTDIR\uninstall\helper.exe"
${WriteRegStr2} $TmpVal "$0" "Comments" "${BrandFullNameInternal}" 0
${WriteRegStr2} $TmpVal "$0" "DisplayIcon" "$8,0" 0
${WriteRegStr2} $TmpVal "$0" "DisplayName" "${BrandFullNameInternal} (${AppVersion})" 0
${WriteRegStr2} $TmpVal "$0" "DisplayVersion" "${AppVersion} (${AB_CD})" 0
${WriteRegStr2} $TmpVal "$0" "InstallLocation" "$INSTDIR" 0
${WriteRegStr2} $TmpVal "$0" "Publisher" "Mozilla" 0
${WriteRegStr2} $TmpVal "$0" "UninstallString" "$7" 0
${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
StrCpy $0 "SOFTWARE\Classes"
GetFullPathName $8 "$INSTDIR\${FileMainEXE}"
StrCpy $1 "$\"$8$\" -compose $\"%1$\""
${AddHandlerValues} "$0\Thunderbird.Url.mailto" "$1" "$8,0" "${AppRegNameMail} URL" "true" ""
ReadRegStr $2 SHCTX "$0\mailto\shell\open\command" ""
${GetPathFromString} "$2" $3
GetFullPathName $2 "$3"
ClearErrors
${WordFind} "$2" "${FileMainEXE}" "E+1{" $R1
${Unless} ${Errors}
${AddHandlerValues} "$0\mailto" "$1" "$8,0" "" "" ""
${EndUnless}
StrCpy $1 "$\"$8$\" $\"%1$\""
${AddHandlerValues} "$0\ThunderbirdEML" "$1" "$8,0" "${AppRegNameMail} Document" "" ""
StrCpy $1 "$\"$8$\" -mail $\"%1$\""
${AddHandlerValues} "$0\Thunderbird.Url.news" "$1" "$8,0" "${AppRegNameNews} URL" "true" ""
ReadRegStr $2 SHCTX "$0\news\shell\open\command" ""
${GetPathFromString} "$2" $3
GetFullPathName $2 "$3"
ClearErrors
${WordFind} "$2" "${FileMainEXE}" "E+1{" $R1
${Unless} ${Errors}
${AddHandlerValues} "$0\news" "$1" "$8,0" "" "" ""
${EndUnless}
ReadRegStr $2 SHCTX "$0\snews\shell\open\command" ""
${GetPathFromString} "$2" $3
GetFullPathName $2 "$3"
ClearErrors
${WordFind} "$2" "${FileMainEXE}" "E+1{" $R1
${Unless} ${Errors}
${AddHandlerValues} "$0\snews" "$1" "$8,0" "" "" ""
${EndUnless}
ReadRegStr $2 SHCTX "$0\nntp\shell\open\command" ""
${GetPathFromString} "$2" $3
GetFullPathName $2 "$3"
ClearErrors
${WordFind} "$2" "${FileMainEXE}" "E+1{" $R1
${Unless} ${Errors}
${AddHandlerValues} "$0\nntp" "$1" "$8,0" "" "" ""
${EndUnless}
; remove DI and SOC from the .eml class if it exists
ReadRegStr $2 SHCTX "$0\.eml\shell\open\command" ""
${GetPathFromString} "$2" $3
GetFullPathName $2 "$3"
ClearErrors
${WordFind} "$2" "${FileMainEXE}" "E+1{" $R1
${Unless} ${Errors}
DeleteRegKey HKLM "$0\.eml\shell\open\command"
${EndUnless}
ReadRegStr $2 SHCTX "$0\.eml\DefaultIcon" ""
${GetPathFromString} "$2" $3
GetFullPathName $2 "$3"
ClearErrors
${WordFind} "$2" "${FileMainEXE}" "E+1{" $R1
${Unless} ${Errors}
DeleteRegKey HKLM "$0\.eml\DefaultIcon"
${EndUnless}
!macroend
!define FixClassKeys "!insertmacro FixClassKeys"

Просмотреть файл

@ -49,6 +49,9 @@ CRCCheck on
!addplugindir ./
; prevents compiling of the reg write logging.
!define NO_LOG
Var TmpVal
; Other included files may depend upon these includes!
@ -60,7 +63,11 @@ Var TmpVal
!include WordFunc.nsh
!include MUI.nsh
!insertmacro GetOptions
!insertmacro GetParameters
!insertmacro WordFind
!insertmacro WordReplace
!insertmacro un.LineFind
!insertmacro un.TrimNewLines
@ -75,13 +82,21 @@ Var TmpVal
; post update cleanup.
VIAddVersionKey "FileDescription" "${BrandShortName} Helper"
!insertmacro GetPathFromString
!insertmacro AddHandlerValues
!insertmacro RegCleanMain
!insertmacro RegCleanUninstall
!insertmacro WriteRegStr2
!insertmacro WriteRegDWORD2
!insertmacro un.RegCleanMain
!insertmacro un.RegCleanUninstall
!insertmacro un.CloseApp
!insertmacro un.GetSecondInstallPath
!include shared.nsh
Name "${BrandFullName}"
OutFile "uninst.exe"
OutFile "helper.exe"
InstallDirRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${BrandFullNameInternal} (${AppVersion})" "InstallLocation"
InstallDir "$PROGRAMFILES\${BrandFullName}"
ShowUnInstDetails nevershow
@ -170,18 +185,22 @@ Section "Uninstall"
${GetParentDir}
Pop $R1
; Only remove the Clients\Mail key if it refers to this install location.
; The Clients\Mail registry key is independent of the default app for the OS
; settings. The XPInstall base un-installer always removes this key if it is
; uninstalling the default app and it will always replace the keys when
; installing even if there is another install of Firefox that is set as the
; default app. Now the key is always updated on install but it is only
; removed if it refers to this install location.
${If} $INSTDIR == $R1
; Only remove the Clients\Mail and Clients\News key if it refers to this
; install location. The Clients\Mail & Clients\News keys are independent
; of the default app for the OS settings. The XPInstall base un-installer
; always removes these keys if it is uninstalling the default app and it
; will always replace the keys when installing even if there is another
; install of Thunderbird that is set as the
; default app. Now the keys are always updated on install but are only
; removed if they refers to this install location.
${If} "$INSTDIR" == "$R1"
; XXXrstrong - if there is another installation of the same app ideally we
; would just modify these values. The GetSecondInstallPath macro could be
; made to provide enough information to do this.
DeleteRegKey HKLM "Software\Clients\Mail\${BrandFullNameInternal}"
DeleteRegKey HKLM "Software\Clients\News\${BrandFullNameInternal}"
DeleteRegValue HKLM "Software\RegisteredApplications" "${AppRegNameMail}"
DeleteRegValue HKLM "Software\RegisteredApplications" "${AppRegNameNews}"
${EndIf}
StrCpy $0 "Software\Microsoft\Windows\CurrentVersion\App Paths\${FileMainEXE}"
@ -196,7 +215,7 @@ Section "Uninstall"
Push $R0
${GetParentDir}
Pop $R1
${If} $INSTDIR == $R1
${If} "$INSTDIR" == "$R1"
WriteRegStr HKLM "$0" "" "$R9"
Push $R9
${GetParentDir}
@ -368,8 +387,14 @@ Function un.preInstFiles
ClearErrors
${un.CloseApp} "true" $(WARN_APP_RUNNING_UNINSTALL)
; Delete the app exe to prevent launching the app while we are uninstalling.
${DeleteFile} "$INSTDIR\${FileMainEXE}"
ClearErrors
${DeleteFile} "$INSTDIR\${FileMainEXE}"
${If} ${Errors}
ClearErrors
${un.CloseApp} "true" $(WARN_APP_RUNNING_UNINSTALL)
ClearErrors
${DeleteFile} "$INSTDIR\${FileMainEXE}"
${EndIf}
${EndIf}
FunctionEnd
@ -395,61 +420,57 @@ Function .onInit
${EndUnless}
${GetParameters} $R0
StrCpy $R1 "Software\Clients\Mail\${BrandFullNameInternal}\InstallInfo"
SetShellVarContext all ; Set $DESKTOP to All Users
; Hide icons - initiated from Set Program Access and Defaults
${If} $R0 == '/ua "${AppVersion} (${AB_CD})" /hs mail'
WriteRegDWORD HKLM $R1 "IconsVisible" 0
${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
${If} $0 == ""
ShellLink::GetShortCutTarget "$DESKTOP\${BrandFullName}.lnk"
Pop $0
${If} $0 == "$INSTDIR\${FileMainEXE}"
Delete "$DESKTOP\${BrandFullName}.lnk"
${EndIf}
${EndIf}
${EndIf}
${If} ${FileExists} "$QUICKLAUNCH\${BrandFullName}.lnk"
ShellLink::GetShortCutArgs "$QUICKLAUNCH\${BrandFullName}.lnk"
Pop $0
${If} $0 == ""
ShellLink::GetShortCutTarget "$QUICKLAUNCH\${BrandFullName}.lnk"
Pop $0
${If} $0 == "$INSTDIR\${FileMainEXE}"
Delete "$QUICKLAUNCH\${BrandFullName}.lnk"
${EndIf}
${EndIf}
${EndIf}
Abort
${EndIf}
; Show icons - initiated from Set Program Access and Defaults
${If} $R0 == '/ua "${AppVersion} (${AB_CD})" /ss mail'
WriteRegDWORD HKLM $R1 "IconsVisible" 1
${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"
${Switch} $R0
${Case} "/HideShortcuts"
${HideShortcuts}
StrCpy $R1 "true"
${Break}
${Case} "/ShowShortcuts"
${ShowShortcuts}
StrCpy $R1 "true"
${Break}
${Case} "/SetAsDefaultAppUser"
${SetAsDefaultAppUser}
StrCpy $R1 "true"
${Break}
${Case} "/SetAsDefaultAppGlobal"
${SetAsDefaultAppGlobal}
StrCpy $R1 "true"
${Break}
${Default}
ClearErrors
${Unless} "$R0" == ""
${WordReplace} "$R0" "$\"" "" "+" $R0
ClearErrors
${GetOptions} "$R0" "/PostUpdate" $R2
${Unless} ${Errors}
${PostUpdate}
ClearErrors
${GetOptions} "$R0" "/UninstallLog=" $R2
${Unless} ${Errors}
${Unless} "$R2" == ""
GetFullPathName $R3 "$R2"
${If} ${FileExists} "$R3"
Delete "$INSTDIR\uninstall\*wizard*"
Delete "$INSTDIR\uninstall\uninstall.log"
CopyFiles /SILENT "$R3" "$INSTDIR\uninstall\"
Push $R3
${GetParentDir}
Pop $R4
Delete "$R3"
RmDir "$R4"
${EndIf}
${EndUnless}
${EndUnless}
StrCpy $R1 "true"
${EndUnless}
${EndUnless}
${EndUnless}
${Unless} ${FileExists} "$QUICKLAUNCH\${BrandFullName}.lnk"
CreateShortCut "$QUICKLAUNCH\${BrandFullName}.lnk" "$INSTDIR\${FileMainEXE}" "" "$INSTDIR\${FileMainEXE}" 0
ShellLink::SetShortCutWorkingDirectory "$QUICKLAUNCH\${BrandFullName}.lnk" "$INSTDIR"
${EndUnless}
Abort
${Break}
${EndSwitch}
${If} $R1 == "true"
System::Call "shell32::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)"
Quit
${EndIf}
; If we made it this far then this installer is being used as an uninstaller.

Просмотреть файл

@ -9,7 +9,7 @@ bin\chrome\@AB_CD@.jar
bin\chrome\@AB_CD@.manifest
bin\chrome\mail-locales.manifest
bin\dictionaries\*
bin\uninstall\uninst.exe
bin\uninstall\helper.exe
bin\updater.ini
[xpcom]

Просмотреть файл

@ -132,7 +132,7 @@ endif
$(MAKE) -C ../installer/windows CONFIG_DIR=l10ngen l10ngen/setup.exe l10ngen/7zSD.sfx
cp ../installer/windows/l10ngen/setup.exe l10n-stage
$(NSINSTALL) -D l10n-stage/localized/uninstall
cp ../installer/windows/l10ngen/uninst.exe l10n-stage/localized/uninstall
cp ../installer/windows/l10ngen/helper.exe l10n-stage/localized/uninstall
rm -f app.7z
cd l10n-stage && \
$(CYGWIN_WRAPPER) 7z a -r -t7z ../app.7z -mx -m0=BCJ2 -m1=LZMA:d24 -m2=LZMA:d19 -m3=LZMA:d19 -mb0:1 -mb0s1:2 -mb0s2:3
@ -169,7 +169,7 @@ repackage-zip: $(ZIP_IN)
ifeq (WINNT,$(OS_ARCH))
$(RM) -r $(STAGEDIST)/uninstall
$(NSINSTALL) -D $(STAGEDIST)/uninstall
cp ../installer/windows/l10ngen/uninst.exe $(STAGEDIST)/uninstall
cp ../installer/windows/l10ngen/helper.exe $(STAGEDIST)/uninstall
endif
$(RM) -r $(DIST)/xpi-stage/locale-$(AB_CD)/chrome/$(AB_CD)
cd $(DIST)/xpi-stage/locale-$(AB_CD) && \

Просмотреть файл

@ -55,7 +55,8 @@ DOMI_TITLE=DOM Inspector
DOMI_TEXT=Inspects the structure and properties of a window and its contents.
QFA_TITLE=Quality Feedback Agent
QFA_TEXT=Sends information about program crashes to Mozilla.
OPTIONS=$(^NameDA) &Options
CONTEXT_OPTIONS=${BrandShortName} &Options
CONTEXT_SAFE_MODE=${BrandShortName} &Safe Mode
SAFE_MODE=Safe Mode
OPTIONS_PAGE_TITLE=Setup Type
OPTIONS_PAGE_SUBTITLE=Choose setup options

Просмотреть файл

@ -1671,10 +1671,14 @@ Exch $R9 ; exchange the new $R9 value with the top of the stack
StrCmp $R3 "" 0 +3 ; Only add EditFlags if a value doesn't exist
DeleteRegValue SHCTX "$R4" "EditFlags"
WriteRegDWord SHCTX "$R4" "EditFlags" 0x00000002
StrCmp "$R9" "true" 0 +13
StrCmp "$R6" "" +2 0
WriteRegStr SHCTX "$R4\DefaultIcon" "" "$R6"
WriteRegStr SHCTX "$R4\shell\open\command" "" "$R5"
StrCmp "$R5" "" +2 0
WriteRegStr SHCTX "$R4\shell\open\command" "" "$R5"
StrCmp "$R9" "true" 0 +11
WriteRegStr SHCTX "$R4\shell\open\ddeexec" "" "$\"%1$\",,0,0,,,,"
WriteRegStr SHCTX "$R4\shell\open\ddeexec" "NoActivateHandler" ""
WriteRegStr SHCTX "$R4\shell\open\ddeexec\Application" "" "${DDEApplication}"
@ -1747,6 +1751,134 @@ Exch $R9 ; exchange the new $R9 value with the top of the stack
!endif
!macroend
/**
* Returns the path found within a passed in string. The path is quoted or not
* with the exception of an unquoted non 8dot3 path without arguments that is
* also not a DefaultIcon path, is a 8dot3 path or not, has command line
* arguments, or is a registry DefaultIcon path (e.g. <path to binary>,# where #
* is the icon's resuorce id). The string does not need to be a valid path or
* exist. It is up to the caller to pass in a string of one of the forms noted
* above and to verify existence if necessary.
*
* IMPORTANT! $R9 will be overwritten by this macro with the return value so
* protect yourself!
*
* Examples:
* In: C:\PROGRA~1\MOZILL~1\FIREFOX.EXE -url "%1" -requestPending
* In: C:\PROGRA~1\MOZILL~1\FIREFOX.EXE,0
* In: C:\PROGRA~1\MOZILL~1\FIREFOX.EXE
* In: "C:\PROGRA~1\MOZILL~1\FIREFOX.EXE"
* In: "C:\PROGRA~1\MOZILL~1\FIREFOX.EXE" -url "%1" -requestPending
* Out: C:\PROGRA~1\MOZILL~1\FIREFOX.EXE
*
* In: "C:\Program Files\Mozilla Firefox\firefox.exe" -url "%1" -requestPending
* In: C:\Program Files\Mozilla Firefox\firefox.exe,0
* In: "C:\Program Files\Mozilla Firefox\firefox.exe"
* Out: C:\Program Files\Mozilla Firefox\firefox.exe
*
* @param _STRING
* The string containing the path
* @param _RESULT
* The register to store the path to.
*
* $R6 = counter for the outer loop's EnumRegKey
* $R7 = value returned from ReadRegStr
* $R8 = _STRING
* $R9 = _RESULT
*/
!macro GetPathFromString
!ifndef ${_MOZFUNC_UN}GetPathFromString
!verbose push
!verbose ${_MOZFUNC_VERBOSE}
!define ${_MOZFUNC_UN}GetPathFromString "!insertmacro ${_MOZFUNC_UN}GetPathFromStringCall"
Function ${_MOZFUNC_UN}GetPathFromString
Exch $R8
Push $R7
Push $R6
ClearErrors
StrCpy $R9 $R8
StrCpy $R6 0 ; Set the counter to 0.
ClearErrors
; Handle quoted paths with arguments.
StrCpy $R7 $R9 1 ; Copy the first char.
StrCmp $R7 '"' +2 +1 ; Is it a "?
StrCmp $R7 "'" +1 +9 ; Is it a '?
StrCpy $R9 $R9 "" 1 ; Remove the first char.
IntOp $R6 $R6 + 1 ; Increment the counter.
StrCpy $R7 $R9 1 $R6 ; Starting from the counter copy the next char.
StrCmp $R7 "" end ; Are there no more chars?
StrCmp $R7 '"' +2 +1 ; Is it a " char?
StrCmp $R7 "'" +1 -4 ; Is it a ' char?
StrCpy $R9 $R9 $R6 ; Copy chars up to the counter.
GoTo end
; Handle DefaultIcon paths. DefaultIcon paths are not quoted and end with
; a , and a number.
IntOp $R6 $R6 - 1 ; Decrement the counter.
StrCpy $R7 $R9 1 $R6 ; Copy one char from the end minus the counter.
StrCmp $R7 '' +4 ; Are there no more chars?
StrCmp $R7 ',' +1 -3 ; Is it a , char?
StrCpy $R9 $R9 $R6 ; Copy chars up to the end minus the counter.
GoTo end
; Handle unquoted paths with arguments. An unquoted path with arguments
; must be an 8dot3 path.
StrCpy $R6 -1 ; Set the counter to -1 so it will start at 0.
IntOp $R6 $R6 + 1 ; Increment the counter.
StrCpy $R7 $R9 1 $R6 ; Starting from the counter copy the next char.
StrCmp $R7 "" end ; Are there no more chars?
StrCmp $R7 " " +1 -3 ; Is it a space char?
StrCpy $R9 $R9 $R6 ; Copy chars up to the counter.
end:
Pop $R6
Pop $R7
Exch $R8
Push $R9
FunctionEnd
!verbose pop
!endif
!macroend
!macro GetPathFromStringCall _STRING _RESULT
!verbose push
!verbose ${_MOZFUNC_VERBOSE}
Push "${_STRING}"
Call GetPathFromString
Pop ${_RESULT}
!verbose pop
!macroend
!macro un.GetPathFromStringCall _STRING _RESULT
!verbose push
!verbose ${_MOZFUNC_VERBOSE}
Push "${_STRING}"
Call un.GetPathFromString
Pop ${_RESULT}
!verbose pop
!macroend
!macro un.GetPathFromString
!ifndef un.GetPathFromString
!verbose push
!verbose ${_MOZFUNC_VERBOSE}
!undef _MOZFUNC_UN
!define _MOZFUNC_UN "un."
!insertmacro GetPathFromString
!undef _MOZFUNC_UN
!define _MOZFUNC_UN
!verbose pop
!endif
!macroend
/**
* Displays a error message when a file can't be copied.
*

Просмотреть файл

@ -80,8 +80,8 @@ uninstaller::
$(INSTALL) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/setup.ico $(CONFIG_DIR)
cd $(CONFIG_DIR) && makensis.exe uninstaller.nsi
$(NSINSTALL) -D $(DIST)/bin/uninstall
ifdef MOZ_PHOENIX
cp $(CONFIG_DIR)/helper.exe $(DIST)/bin/uninstall
else
ifdef MOZ_SUNBIRD
cp $(CONFIG_DIR)/uninst.exe $(DIST)/bin/uninstall
else
cp $(CONFIG_DIR)/helper.exe $(DIST)/bin/uninstall
endif

Просмотреть файл

@ -535,23 +535,27 @@ function haveOldInstall(key, brandFullName, version) {
function checkRegistry()
{
// XXX todo
// this is firefox specific
// figure out what to do about tbird and sunbird, etc
LOG("checkRegistry");
var result = false;
try {
var key = new RegKey();
key.open(RegKey.prototype.ROOT_KEY_CLASSES_ROOT, "FirefoxHTML\\shell\\open\\command", key.ACCESS_READ);
var commandKey = key.readStringValue("");
LOG("commandKey = " + commandKey);
// if "-requestPending" is not found, we need to do the cleanup
result = (commandKey.indexOf("-requestPending") == -1);
} catch (e) {
LOG("failed to open command key for FirefoxHTML: " + e);
// Firefox is the only toolkit app that needs to do this.
// return false for other applications.
var app = Components.classes["@mozilla.org/xre/app-info;1"].
getService(Components.interfaces.nsIXULAppInfo);
if (app.name == "Firefox") {
try {
var key = new RegKey();
key.open(RegKey.prototype.ROOT_KEY_CLASSES_ROOT, "FirefoxHTML\\shell\\open\\command", key.ACCESS_READ);
var commandKey = key.readStringValue("");
LOG("commandKey = " + commandKey);
// if "-requestPending" is not found, we need to do the cleanup
result = (commandKey.indexOf("-requestPending") == -1);
} catch (e) {
LOG("failed to open command key for FirefoxHTML: " + e);
}
key.close();
}
key.close();
return result;
}

Просмотреть файл

@ -1188,12 +1188,10 @@ UpdateService.prototype = {
LOG("UpdateService", "_postUpdateProcessing: Install Succeeded, Showing UI");
prompter.showUpdateInstalled(update);
#ifdef MOZ_PHOENIX
// for now, this is firefox only.
#ifdef MOZ_SUNBIRD
// we need to fix both nsPostUpdateWin.js and
// the uninstaller to work for thunderbird and sunbird
//
// the uninstaller to work for sunbird
#else
// Perform platform-specific post-update processing.
if (POST_UPDATE_CONTRACTID in Components.classes) {
Components.classes[POST_UPDATE_CONTRACTID].