author | Matt Howell <mhowell@mozilla.com> |
Tue, 31 Oct 2017 12:18:25 -0700 | |
changeset 389677 | b910a12076247284644a00029522a9743219eeff |
parent 389676 | 5e19d7125bbb46e4b51d15f1634dd99d3d3243bd |
child 389678 | fa8eaa164af801cda6637c1ab7bdcc4d6c29f1ce |
push id | 32789 |
push user | archaeopteryx@coole-files.de |
push date | Wed, 01 Nov 2017 21:55:42 +0000 |
treeherder | mozilla-central@e81094853e1d [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | rstrong |
bugs | 1413295 |
milestone | 58.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/browser/installer/windows/nsis/installer.nsi +++ b/browser/installer/windows/nsis/installer.nsi @@ -458,19 +458,19 @@ Section "-Application" APP_IDX ; exists in the shortcuts_log.ini and the SMPROGRAMS. The installer's shortcut ; creation code will create the shortcut in the root of the Start Menu ; Programs directory. ${RemoveStartMenuDir} ; Always add the application's shortcuts to the shortcuts log ini file. The ; DeleteShortcuts macro will do the right thing on uninstall if the ; shortcuts don't exist. - ${LogStartMenuShortcut} "${BrandFullName}.lnk" - ${LogQuickLaunchShortcut} "${BrandFullName}.lnk" - ${LogDesktopShortcut} "${BrandFullName}.lnk" + ${LogStartMenuShortcut} "${BrandShortName}.lnk" + ${LogQuickLaunchShortcut} "${BrandShortName}.lnk" + ${LogDesktopShortcut} "${BrandShortName}.lnk" ; Best effort to update the Win7 taskbar and start menu shortcut app model ; id's. The possible contexts are current user / system and the user that ; elevated the installer. Call FixShortcutAppModelIDs ; If the current context is all also perform Win7 taskbar and start menu link ; maintenance for the current user context. ${If} $TmpVal == "HKLM" @@ -490,27 +490,27 @@ Section "-Application" APP_IDX UAC::ExecCodeSegment $0 ${EndUnless} ; UAC only allows elevating to an Admin account so there is no need to add ; the Start Menu or Desktop shortcuts from the original unelevated process ; since this will either add it for the user if unelevated or All Users if ; elevated. ${If} $AddStartMenuSC == 1 - CreateShortCut "$SMPROGRAMS\${BrandFullName}.lnk" "$INSTDIR\${FileMainEXE}" - ${If} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk" - ShellLink::SetShortCutWorkingDirectory "$SMPROGRAMS\${BrandFullName}.lnk" \ + CreateShortCut "$SMPROGRAMS\${BrandShortName}.lnk" "$INSTDIR\${FileMainEXE}" + ${If} ${FileExists} "$SMPROGRAMS\${BrandShortName}.lnk" + ShellLink::SetShortCutWorkingDirectory "$SMPROGRAMS\${BrandShortName}.lnk" \ "$INSTDIR" ${If} ${AtLeastWin7} ${AndIf} "$AppUserModelID" != "" - ApplicationID::Set "$SMPROGRAMS\${BrandFullName}.lnk" "$AppUserModelID" "true" + ApplicationID::Set "$SMPROGRAMS\${BrandShortName}.lnk" "$AppUserModelID" "true" ${EndIf} - ${LogMsg} "Added Shortcut: $SMPROGRAMS\${BrandFullName}.lnk" + ${LogMsg} "Added Shortcut: $SMPROGRAMS\${BrandShortName}.lnk" ${Else} - ${LogMsg} "** ERROR Adding Shortcut: $SMPROGRAMS\${BrandFullName}.lnk" + ${LogMsg} "** ERROR Adding Shortcut: $SMPROGRAMS\${BrandShortName}.lnk" ${EndIf} ${EndIf} ; Update lastwritetime of the Start Menu shortcut to clear the tile cache. ; Do this for both shell contexts in case the user has shortcuts in multiple ; locations, then restore the previous context at the end. ${If} ${AtLeastWin8} SetShellVarContext all @@ -520,45 +520,45 @@ Section "-Application" APP_IDX ${If} $TmpVal == "HKLM" SetShellVarContext all ${ElseIf} $TmpVal == "HKCU" SetShellVarContext current ${EndIf} ${EndIf} ${If} $AddDesktopSC == 1 - CreateShortCut "$DESKTOP\${BrandFullName}.lnk" "$INSTDIR\${FileMainEXE}" - ${If} ${FileExists} "$DESKTOP\${BrandFullName}.lnk" - ShellLink::SetShortCutWorkingDirectory "$DESKTOP\${BrandFullName}.lnk" \ + CreateShortCut "$DESKTOP\${BrandShortName}.lnk" "$INSTDIR\${FileMainEXE}" + ${If} ${FileExists} "$DESKTOP\${BrandShortName}.lnk" + ShellLink::SetShortCutWorkingDirectory "$DESKTOP\${BrandShortName}.lnk" \ "$INSTDIR" ${If} ${AtLeastWin7} ${AndIf} "$AppUserModelID" != "" - ApplicationID::Set "$DESKTOP\${BrandFullName}.lnk" "$AppUserModelID" "true" + ApplicationID::Set "$DESKTOP\${BrandShortName}.lnk" "$AppUserModelID" "true" ${EndIf} - ${LogMsg} "Added Shortcut: $DESKTOP\${BrandFullName}.lnk" + ${LogMsg} "Added Shortcut: $DESKTOP\${BrandShortName}.lnk" ${Else} - ${LogMsg} "** ERROR Adding Shortcut: $DESKTOP\${BrandFullName}.lnk" + ${LogMsg} "** ERROR Adding Shortcut: $DESKTOP\${BrandShortName}.lnk" ${EndIf} ${EndIf} ; If elevated the Quick Launch shortcut must be added from the unelevated ; original process. ${If} $AddQuickLaunchSC == 1 ${Unless} ${AtLeastWin7} ClearErrors ${GetParameters} $0 ${GetOptions} "$0" "/UAC:" $0 ${If} ${Errors} Call AddQuickLaunchShortcut - ${LogMsg} "Added Shortcut: $QUICKLAUNCH\${BrandFullName}.lnk" + ${LogMsg} "Added Shortcut: $QUICKLAUNCH\${BrandShortName}.lnk" ${Else} ; It is not possible to add a log entry from the unelevated process so ; add the log entry without the path since there is no simple way to ; know the correct full path. - ${LogMsg} "Added Quick Launch Shortcut: ${BrandFullName}.lnk" + ${LogMsg} "Added Quick Launch Shortcut: ${BrandShortName}.lnk" GetFunctionAddress $0 AddQuickLaunchShortcut UAC::ExecCodeSegment $0 ${EndIf} ${EndUnless} ${EndIf} !ifdef MOZ_MAINTENANCE_SERVICE ${If} $TmpVal == "HKLM" @@ -739,19 +739,19 @@ FunctionEnd Function AbortSurveySummary ExecShell "open" "${AbortSurveyURL}step5" FunctionEnd ################################################################################ # Helper Functions Function AddQuickLaunchShortcut - CreateShortCut "$QUICKLAUNCH\${BrandFullName}.lnk" "$INSTDIR\${FileMainEXE}" - ${If} ${FileExists} "$QUICKLAUNCH\${BrandFullName}.lnk" - ShellLink::SetShortCutWorkingDirectory "$QUICKLAUNCH\${BrandFullName}.lnk" \ + CreateShortCut "$QUICKLAUNCH\${BrandShortName}.lnk" "$INSTDIR\${FileMainEXE}" + ${If} ${FileExists} "$QUICKLAUNCH\${BrandShortName}.lnk" + ShellLink::SetShortCutWorkingDirectory "$QUICKLAUNCH\${BrandShortName}.lnk" \ "$INSTDIR" ${EndIf} FunctionEnd Function CheckExistingInstall ; If there is a pending file copy from a previous upgrade don't allow ; installing until after the system has rebooted. IfFileExists "$INSTDIR\${FileMainEXE}.moz-upgrade" +1 +4
--- a/browser/installer/windows/nsis/shared.nsh +++ b/browser/installer/windows/nsis/shared.nsh @@ -32,68 +32,67 @@ SetShellVarContext current ; Set SHCTX to the current user (e.g. HKCU) ${RegCleanMain} "Software\Mozilla" ${RegCleanUninstall} ${UpdateProtocolHandlers} ; setup the application model id registration value ${InitHashAppModelId} "$INSTDIR" "Software\Mozilla\${AppName}\TaskBarIDs" - ; Win7 taskbar and start menu link maintenance - Call FixShortcutAppModelIDs - ClearErrors WriteRegStr HKLM "Software\Mozilla" "${BrandShortName}InstallerTest" "Write Test" ${If} ${Errors} StrCpy $TmpVal "HKCU" ${Else} SetShellVarContext all ; Set SHCTX to all users (e.g. HKLM) DeleteRegValue HKLM "Software\Mozilla" "${BrandShortName}InstallerTest" StrCpy $TmpVal "HKLM" ${RegCleanMain} "Software\Mozilla" ${RegCleanUninstall} ${UpdateProtocolHandlers} ${FixShellIconHandler} "HKLM" ${SetAppLSPCategories} ${LSP_CATEGORIES} - ; Win7 taskbar and start menu link maintenance - Call FixShortcutAppModelIDs - ; Add the Firewall entries after an update Call AddFirewallEntries ReadRegStr $0 HKLM "Software\mozilla.org\Mozilla" "CurrentVersion" ${If} "$0" != "${GREVersion}" WriteRegStr HKLM "Software\mozilla.org\Mozilla" "CurrentVersion" "${GREVersion}" ${EndIf} ${EndIf} ; Migrate the application's Start Menu directory to a single shortcut in the ; root of the Start Menu Programs directory. ${MigrateStartMenuShortcut} - ; Update lastwritetime of the Start Menu shortcut to clear the tile cache. - ; Do this for both shell contexts in case the user has shortcuts in multiple - ; locations, then restore the previous context at the end. - ${If} ${AtLeastWin8} - SetShellVarContext all - ${TouchStartMenuShortcut} - SetShellVarContext current - ${TouchStartMenuShortcut} - ${If} $TmpVal == "HKLM" - SetShellVarContext all - ${ElseIf} $TmpVal == "HKCU" - SetShellVarContext current - ${EndIf} - ${EndIf} - ; Adds a pinned Task Bar shortcut (see MigrateTaskBarShortcut for details). ${MigrateTaskBarShortcut} + ; Update the name/icon/AppModelID of our shortcuts as needed, then update the + ; lastwritetime of the Start Menu shortcut to clear the tile icon cache. + ; Do this for both shell contexts in case the user has shortcuts in multiple + ; locations, then restore the previous context at the end. + SetShellVarContext all ${UpdateShortcutBranding} + ${If} ${AtLeastWin8} + ${TouchStartMenuShortcut} + ${EndIf} + Call FixShortcutAppModelIDs + SetShellVarContext current + ${UpdateShortcutBranding} + ${If} ${AtLeastWin8} + ${TouchStartMenuShortcut} + ${EndIf} + Call FixShortcutAppModelIDs + ${If} $TmpVal == "HKLM" + SetShellVarContext all + ${ElseIf} $TmpVal == "HKCU" + SetShellVarContext current + ${EndIf} ${RemoveDeprecatedKeys} ${Set32to64DidMigrateReg} ${SetAppKeys} ${FixClassKeys} ${SetUninstallKeys} ${If} $TmpVal == "HKLM" @@ -160,20 +159,21 @@ nsExec::Exec "$\"$INSTDIR\maintenanceservice_installer.exe$\"" ${EndIf} ${EndIf} !endif !macroend !define PostUpdate "!insertmacro PostUpdate" ; Update the last modified time on the Start Menu shortcut, so that its icon -; gets refreshed. Should be called on Win8+ after MigrateStartMenuShortcut. +; gets refreshed. Should be called on Win8+ after MigrateStartMenuShortcut +; and UpdateShortcutBranding. !macro TouchStartMenuShortcut - ${If} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk" - FileOpen $0 "$SMPROGRAMS\${BrandFullName}.lnk" a + ${If} ${FileExists} "$SMPROGRAMS\${BrandShortName}.lnk" + FileOpen $0 "$SMPROGRAMS\${BrandShortName}.lnk" a ${IfNot} ${Errors} System::Call '*(i, i) p .r1' System::Call 'kernel32::GetSystemTimeAsFileTime(p r1)' System::Call 'kernel32::SetFileTime(p r0, i 0, i 0, p r1) i .r2' System::Free $1 FileClose $0 ${EndIf} ${EndIf} @@ -203,61 +203,61 @@ StrCpy $R1 "Software\Clients\StartMenuInternet\$0\InstallInfo" ${EndIf} WriteRegDWORD HKLM "$R1" "IconsVisible" 0 ${If} ${AtLeastWin8} WriteRegDWORD HKCU "$R1" "IconsVisible" 0 ${EndIf} SetShellVarContext all ; Set $DESKTOP to All Users - ${Unless} ${FileExists} "$DESKTOP\${BrandFullName}.lnk" + ${Unless} ${FileExists} "$DESKTOP\${BrandShortName}.lnk" SetShellVarContext current ; Set $DESKTOP to the current user's desktop ${EndUnless} - ${If} ${FileExists} "$DESKTOP\${BrandFullName}.lnk" - ShellLink::GetShortCutArgs "$DESKTOP\${BrandFullName}.lnk" + ${If} ${FileExists} "$DESKTOP\${BrandShortName}.lnk" + ShellLink::GetShortCutArgs "$DESKTOP\${BrandShortName}.lnk" Pop $0 ${If} "$0" == "" - ShellLink::GetShortCutTarget "$DESKTOP\${BrandFullName}.lnk" + ShellLink::GetShortCutTarget "$DESKTOP\${BrandShortName}.lnk" Pop $0 ${GetLongPath} "$0" $0 ${If} "$0" == "$INSTDIR\${FileMainEXE}" - Delete "$DESKTOP\${BrandFullName}.lnk" + Delete "$DESKTOP\${BrandShortName}.lnk" ${EndIf} ${EndIf} ${EndIf} SetShellVarContext all ; Set $SMPROGRAMS to All Users - ${Unless} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk" + ${Unless} ${FileExists} "$SMPROGRAMS\${BrandShortName}.lnk" SetShellVarContext current ; Set $SMPROGRAMS to the current user's Start ; Menu Programs directory ${EndUnless} - ${If} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk" - ShellLink::GetShortCutArgs "$SMPROGRAMS\${BrandFullName}.lnk" + ${If} ${FileExists} "$SMPROGRAMS\${BrandShortName}.lnk" + ShellLink::GetShortCutArgs "$SMPROGRAMS\${BrandShortName}.lnk" Pop $0 ${If} "$0" == "" - ShellLink::GetShortCutTarget "$SMPROGRAMS\${BrandFullName}.lnk" + ShellLink::GetShortCutTarget "$SMPROGRAMS\${BrandShortName}.lnk" Pop $0 ${GetLongPath} "$0" $0 ${If} "$0" == "$INSTDIR\${FileMainEXE}" - Delete "$SMPROGRAMS\${BrandFullName}.lnk" + Delete "$SMPROGRAMS\${BrandShortName}.lnk" ${EndIf} ${EndIf} ${EndIf} - ${If} ${FileExists} "$QUICKLAUNCH\${BrandFullName}.lnk" - ShellLink::GetShortCutArgs "$QUICKLAUNCH\${BrandFullName}.lnk" + ${If} ${FileExists} "$QUICKLAUNCH\${BrandShortName}.lnk" + ShellLink::GetShortCutArgs "$QUICKLAUNCH\${BrandShortName}.lnk" Pop $0 ${If} "$0" == "" - ShellLink::GetShortCutTarget "$QUICKLAUNCH\${BrandFullName}.lnk" + ShellLink::GetShortCutTarget "$QUICKLAUNCH\${BrandShortName}.lnk" Pop $0 ${GetLongPath} "$0" $0 ${If} "$0" == "$INSTDIR\${FileMainEXE}" - Delete "$QUICKLAUNCH\${BrandFullName}.lnk" + Delete "$QUICKLAUNCH\${BrandShortName}.lnk" ${EndIf} ${EndIf} ${EndIf} !macroend !define HideShortcuts "!insertmacro HideShortcuts" ; Adds shortcuts for this installation. This should also add the application ; to Open With for the file types the application handles (bug 370480). @@ -270,84 +270,86 @@ StrCpy $R1 "Software\Clients\StartMenuInternet\$0\InstallInfo" ${EndIf} WriteRegDWORD HKLM "$R1" "IconsVisible" 1 ${If} ${AtLeastWin8} WriteRegDWORD HKCU "$R1" "IconsVisible" 1 ${EndIf} SetShellVarContext all ; Set $DESKTOP to All Users - ${Unless} ${FileExists} "$DESKTOP\${BrandFullName}.lnk" - CreateShortCut "$DESKTOP\${BrandFullName}.lnk" "$INSTDIR\${FileMainEXE}" - ${If} ${FileExists} "$DESKTOP\${BrandFullName}.lnk" - ShellLink::SetShortCutWorkingDirectory "$DESKTOP\${BrandFullName}.lnk" "$INSTDIR" + ${Unless} ${FileExists} "$DESKTOP\${BrandShortName}.lnk" + CreateShortCut "$DESKTOP\${BrandShortName}.lnk" "$INSTDIR\${FileMainEXE}" + ${If} ${FileExists} "$DESKTOP\${BrandShortName}.lnk" + ShellLink::SetShortCutWorkingDirectory "$DESKTOP\${BrandShortName}.lnk" "$INSTDIR" ${If} ${AtLeastWin7} ${AndIf} "$AppUserModelID" != "" - ApplicationID::Set "$DESKTOP\${BrandFullName}.lnk" "$AppUserModelID" "true" + ApplicationID::Set "$DESKTOP\${BrandShortName}.lnk" "$AppUserModelID" "true" ${EndIf} ${Else} SetShellVarContext current ; Set $DESKTOP to the current user's desktop - ${Unless} ${FileExists} "$DESKTOP\${BrandFullName}.lnk" - CreateShortCut "$DESKTOP\${BrandFullName}.lnk" "$INSTDIR\${FileMainEXE}" - ${If} ${FileExists} "$DESKTOP\${BrandFullName}.lnk" - ShellLink::SetShortCutWorkingDirectory "$DESKTOP\${BrandFullName}.lnk" \ + ${Unless} ${FileExists} "$DESKTOP\${BrandShortName}.lnk" + CreateShortCut "$DESKTOP\${BrandShortName}.lnk" "$INSTDIR\${FileMainEXE}" + ${If} ${FileExists} "$DESKTOP\${BrandShortName}.lnk" + ShellLink::SetShortCutWorkingDirectory "$DESKTOP\${BrandShortName}.lnk" \ "$INSTDIR" ${If} ${AtLeastWin7} ${AndIf} "$AppUserModelID" != "" - ApplicationID::Set "$DESKTOP\${BrandFullName}.lnk" "$AppUserModelID" "true" + ApplicationID::Set "$DESKTOP\${BrandShortName}.lnk" "$AppUserModelID" "true" ${EndIf} ${EndIf} ${EndUnless} ${EndIf} ${EndUnless} SetShellVarContext all ; Set $SMPROGRAMS to All Users - ${Unless} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk" - CreateShortCut "$SMPROGRAMS\${BrandFullName}.lnk" "$INSTDIR\${FileMainEXE}" - ${If} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk" - ShellLink::SetShortCutWorkingDirectory "$SMPROGRAMS\${BrandFullName}.lnk" \ + ${Unless} ${FileExists} "$SMPROGRAMS\${BrandShortName}.lnk" + CreateShortCut "$SMPROGRAMS\${BrandShortName}.lnk" "$INSTDIR\${FileMainEXE}" + ${If} ${FileExists} "$SMPROGRAMS\${BrandShortName}.lnk" + ShellLink::SetShortCutWorkingDirectory "$SMPROGRAMS\${BrandShortName}.lnk" \ "$INSTDIR" ${If} ${AtLeastWin7} ${AndIf} "$AppUserModelID" != "" - ApplicationID::Set "$SMPROGRAMS\${BrandFullName}.lnk" "$AppUserModelID" "true" + ApplicationID::Set "$SMPROGRAMS\${BrandShortName}.lnk" "$AppUserModelID" "true" ${EndIf} ${Else} SetShellVarContext current ; Set $SMPROGRAMS to the current user's Start ; Menu Programs directory - ${Unless} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk" - CreateShortCut "$SMPROGRAMS\${BrandFullName}.lnk" "$INSTDIR\${FileMainEXE}" - ${If} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk" - ShellLink::SetShortCutWorkingDirectory "$SMPROGRAMS\${BrandFullName}.lnk" \ + ${Unless} ${FileExists} "$SMPROGRAMS\${BrandShortName}.lnk" + CreateShortCut "$SMPROGRAMS\${BrandShortName}.lnk" "$INSTDIR\${FileMainEXE}" + ${If} ${FileExists} "$SMPROGRAMS\${BrandShortName}.lnk" + ShellLink::SetShortCutWorkingDirectory "$SMPROGRAMS\${BrandShortName}.lnk" \ "$INSTDIR" ${If} ${AtLeastWin7} ${AndIf} "$AppUserModelID" != "" - ApplicationID::Set "$SMPROGRAMS\${BrandFullName}.lnk" "$AppUserModelID" "true" + ApplicationID::Set "$SMPROGRAMS\${BrandShortName}.lnk" "$AppUserModelID" "true" ${EndIf} ${EndIf} ${EndUnless} ${EndIf} ${EndUnless} ; Windows 7 doesn't use the QuickLaunch directory ${Unless} ${AtLeastWin7} - ${AndUnless} ${FileExists} "$QUICKLAUNCH\${BrandFullName}.lnk" - CreateShortCut "$QUICKLAUNCH\${BrandFullName}.lnk" \ + ${AndUnless} ${FileExists} "$QUICKLAUNCH\${BrandShortName}.lnk" + CreateShortCut "$QUICKLAUNCH\${BrandShortName}.lnk" \ "$INSTDIR\${FileMainEXE}" - ${If} ${FileExists} "$QUICKLAUNCH\${BrandFullName}.lnk" - ShellLink::SetShortCutWorkingDirectory "$QUICKLAUNCH\${BrandFullName}.lnk" \ + ${If} ${FileExists} "$QUICKLAUNCH\${BrandShortName}.lnk" + ShellLink::SetShortCutWorkingDirectory "$QUICKLAUNCH\${BrandShortName}.lnk" \ "$INSTDIR" ${EndIf} ${EndUnless} !macroend !define ShowShortcuts "!insertmacro ShowShortcuts" ; Update the branding information on all shortcuts our installer created, -; in case the branding has changed between updates. +; to convert from BrandFullName (which is what we used to name shortcuts) +; to BrandShortName (which is what we now name shortcuts). Also update the +; icon if it's been changed. ; This should only be called sometime after both MigrateStartMenuShortcut -; and MigrateTaskBarShurtcut +; and MigrateTaskBarShurtcut, and it assumes SHCTX is set correctly. !macro UpdateShortcutBranding ${GetLongPath} "$INSTDIR\uninstall\${SHORTCUTS_LOG}" $R9 ${If} ${FileExists} "$R9" ClearErrors ; The entries in the shortcut log are numbered, but we never actually ; create more than one shortcut (or log entry) in each location. ReadINIStr $R8 "$R9" "STARTMENU" "Shortcut0" ${IfNot} ${Errors} @@ -365,26 +367,26 @@ ${ElseIf} $R6 == "$INSTDIR\firefox.ico" ${AndIfNot} ${FileExists} "$INSTDIR\firefox.ico" StrCpy $R5 "1" ${Else} StrCpy $R5 "0" ${EndIf} ${If} $R5 == "1" - ${OrIf} $R8 != "${BrandFullName}.lnk" + ${OrIf} $R8 != "${BrandShortName}.lnk" Delete "$SMPROGRAMS\$R8" ${If} ${FileExists} "$INSTDIR\firefox.ico" - CreateShortcut "$SMPROGRAMS\${BrandFullName}.lnk" \ + CreateShortcut "$SMPROGRAMS\${BrandShortName}.lnk" \ "$INSTDIR\${FileMainEXE}" "" "$INSTDIR\firefox.ico" ${Else} - CreateShortcut "$SMPROGRAMS\${BrandFullName}.lnk" \ + CreateShortcut "$SMPROGRAMS\${BrandShortName}.lnk" \ "$INSTDIR\${FileMainEXE}" ${EndIf} - WriteINIStr "$R9" "STARTMENU" "Shortcut0" "${BrandFullName}.lnk" + WriteINIStr "$R9" "STARTMENU" "Shortcut0" "${BrandShortName}.lnk" ${EndIf} ${EndIf} ${EndIf} ${EndIf} ClearErrors ReadINIStr $R8 "$R9" "DESKTOP" "Shortcut0" ${IfNot} ${Errors} @@ -402,26 +404,26 @@ ${ElseIf} $R6 == "$INSTDIR\firefox.ico" ${AndIfNot} ${FileExists} "$INSTDIR\firefox.ico" StrCpy $R5 "1" ${Else} StrCpy $R5 "0" ${EndIf} ${If} $R5 == "1" - ${OrIf} $R8 != "${BrandFullName}.lnk" + ${OrIf} $R8 != "${BrandShortName}.lnk" Delete "$DESKTOP\$R8" ${If} ${FileExists} "$INSTDIR\firefox.ico" - CreateShortcut "$DESKTOP\${BrandFullName}.lnk" \ + CreateShortcut "$DESKTOP\${BrandShortName}.lnk" \ "$INSTDIR\${FileMainEXE}" "" "$INSTDIR\firefox.ico" ${Else} - CreateShortcut "$DESKTOP\${BrandFullName}.lnk" \ + CreateShortcut "$DESKTOP\${BrandShortName}.lnk" \ "$INSTDIR\${FileMainEXE}" ${EndIf} - WriteINIStr "$R9" "DESKTOP" "Shortcut0" "${BrandFullName}.lnk" + WriteINIStr "$R9" "DESKTOP" "Shortcut0" "${BrandShortName}.lnk" ${EndIf} ${EndIf} ${EndIf} ${EndIf} ClearErrors ReadINIStr $R8 "$R9" "QUICKLAUNCH" "Shortcut0" ${IfNot} ${Errors} @@ -1286,35 +1288,35 @@ ${If} ${FileExists} "$0" ClearErrors ReadINIStr $5 "$0" "SMPROGRAMS" "RelativePathToDir" ${Unless} ${Errors} ClearErrors ReadINIStr $1 "$0" "STARTMENU" "Shortcut0" ${If} ${Errors} ; The STARTMENU ini section doesn't exist. - ${LogStartMenuShortcut} "${BrandFullName}.lnk" + ${LogStartMenuShortcut} "${BrandShortName}.lnk" ${GetLongPath} "$SMPROGRAMS" $2 ${GetLongPath} "$2\$5" $1 ${If} "$1" != "" ClearErrors ReadINIStr $3 "$0" "SMPROGRAMS" "Shortcut0" ${Unless} ${Errors} ${If} ${FileExists} "$1\$3" ShellLink::GetShortCutTarget "$1\$3" Pop $4 ${If} "$INSTDIR\${FileMainEXE}" == "$4" - CreateShortCut "$SMPROGRAMS\${BrandFullName}.lnk" \ + CreateShortCut "$SMPROGRAMS\${BrandShortName}.lnk" \ "$INSTDIR\${FileMainEXE}" - ${If} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk" - ShellLink::SetShortCutWorkingDirectory "$SMPROGRAMS\${BrandFullName}.lnk" \ + ${If} ${FileExists} "$SMPROGRAMS\${BrandShortName}.lnk" + ShellLink::SetShortCutWorkingDirectory "$SMPROGRAMS\${BrandShortName}.lnk" \ "$INSTDIR" ${If} ${AtLeastWin7} ${AndIf} "$AppUserModelID" != "" - ApplicationID::Set "$SMPROGRAMS\${BrandFullName}.lnk" \ + ApplicationID::Set "$SMPROGRAMS\${BrandShortName}.lnk" \ "$AppUserModelID" "true" ${EndIf} ${EndIf} ${EndIf} ${EndIf} ${EndUnless} ${EndIf} ${EndIf} @@ -1382,19 +1384,19 @@ !macroend !define RemoveStartMenuDir "!insertmacro RemoveStartMenuDir" ; Creates the shortcuts log ini file with the appropriate entries if it doesn't ; already exist. !macro CreateShortcutsLog ${GetShortcutsLogPath} $0 ${Unless} ${FileExists} "$0" - ${LogStartMenuShortcut} "${BrandFullName}.lnk" - ${LogQuickLaunchShortcut} "${BrandFullName}.lnk" - ${LogDesktopShortcut} "${BrandFullName}.lnk" + ${LogStartMenuShortcut} "${BrandShortName}.lnk" + ${LogQuickLaunchShortcut} "${BrandShortName}.lnk" + ${LogDesktopShortcut} "${BrandShortName}.lnk" ${EndUnless} !macroend !define CreateShortcutsLog "!insertmacro CreateShortcutsLog" ; The files to check if they are in use during (un)install so the restart is ; required message is displayed. All files must be located in the $INSTDIR ; directory. !macro PushFilesToCheck
--- a/toolkit/mozapps/installer/windows/nsis/common.nsh +++ b/toolkit/mozapps/installer/windows/nsis/common.nsh @@ -3624,16 +3624,26 @@ ShellLink::GetShortCutTarget "$SMPROGRAMS\$R8" Pop $R5 ${${_MOZFUNC_UN}GetLongPath} "$R5" $R5 ${If} "$INSTDIR\${FileMainEXE}" == "$R5" Delete "$SMPROGRAMS\$R8" ${EndIf} ${EndIf} ${Loop} + ; There might also be a shortcut with a different name created by a + ; previous version of the installer. + ${If} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk" + ShellLink::GetShortCutTarget "$SMPROGRAMS\${BrandFullName}.lnk" + Pop $R5 + ${${_MOZFUNC_UN}GetLongPath} "$R5" $R5 + ${If} "$INSTDIR\${FileMainEXE}" == "$R5" + Delete "$SMPROGRAMS\${BrandFullName}.lnk" + ${EndIf} + ${EndIf} ; Delete Quick Launch shortcuts for this application StrCpy $R4 -1 ${Do} IntOp $R4 $R4 + 1 ; Increment the counter ClearErrors ReadINIStr $R8 "$R9" "QUICKLAUNCH" "Shortcut$R4" ${If} ${Errors} @@ -3644,16 +3654,26 @@ ShellLink::GetShortCutTarget "$QUICKLAUNCH\$R8" Pop $R5 ${${_MOZFUNC_UN}GetLongPath} "$R5" $R5 ${If} "$INSTDIR\${FileMainEXE}" == "$R5" Delete "$QUICKLAUNCH\$R8" ${EndIf} ${EndIf} ${Loop} + ; There might also be a shortcut with a different name created by a + ; previous version of the installer. + ${If} ${FileExists} "$QUICKLAUNCH\${BrandFullName}.lnk" + ShellLink::GetShortCutTarget "$QUICKLAUNCH\${BrandFullName}.lnk" + Pop $R5 + ${${_MOZFUNC_UN}GetLongPath} "$R5" $R5 + ${If} "$INSTDIR\${FileMainEXE}" == "$R5" + Delete "$QUICKLAUNCH\${BrandFullName}.lnk" + ${EndIf} + ${EndIf} ; Delete Desktop shortcuts for this application StrCpy $R4 -1 ${Do} IntOp $R4 $R4 + 1 ; Increment the counter ClearErrors ReadINIStr $R8 "$R9" "DESKTOP" "Shortcut$R4" ${If} ${Errors} @@ -3664,16 +3684,26 @@ ShellLink::GetShortCutTarget "$DESKTOP\$R8" Pop $R5 ${${_MOZFUNC_UN}GetLongPath} "$R5" $R5 ${If} "$INSTDIR\${FileMainEXE}" == "$R5" Delete "$DESKTOP\$R8" ${EndIf} ${EndIf} ${Loop} + ; There might also be a shortcut with a different name created by a + ; previous version of the installer. + ${If} ${FileExists} "$DESKTOP\${BrandFullName}.lnk" + ShellLink::GetShortCutTarget "$DESKTOP\${BrandFullName}.lnk" + Pop $R5 + ${${_MOZFUNC_UN}GetLongPath} "$R5" $R5 + ${If} "$INSTDIR\${FileMainEXE}" == "$R5" + Delete "$DESKTOP\${BrandFullName}.lnk" + ${EndIf} + ${EndIf} ${${_MOZFUNC_UN}GetLongPath} "$SMPROGRAMS" $R6 ; Delete Start Menu Programs shortcuts for this application ClearErrors ReadINIStr $R7 "$R9" "SMPROGRAMS" "RelativePathToDir" ${${_MOZFUNC_UN}GetLongPath} "$R6\$R7" $R7 ${Unless} "$R7" == ""