Bug 1415743 - Remove unused function MigrateStartMenuShortcut from the installer, r=mhowell
authorJune Wilde <jewilde@mozilla.com>
Fri, 25 Jan 2019 17:54:56 +0000
changeset 515494 6043695f46a99e8f4c781ffbf1f2858d7c960aba
parent 515493 883b89f3a11f1416611a52cf015bcf4291739a6a
child 515495 9a008f412fd77d52636b6430c07628bfec3b8252
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmhowell
bugs1415743
milestone66.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
Bug 1415743 - Remove unused function MigrateStartMenuShortcut from the installer, r=mhowell This code hasn't been needed in quite a long time at this point and it should be removed. Differential Revision: https://phabricator.services.mozilla.com/D17657
browser/installer/windows/nsis/shared.nsh
--- a/browser/installer/windows/nsis/shared.nsh
+++ b/browser/installer/windows/nsis/shared.nsh
@@ -55,20 +55,16 @@
     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}
-
   ; 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
@@ -168,18 +164,17 @@
   ${DisableLauncherProcessByDefault}
 !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
-; and UpdateShortcutBranding.
+; gets refreshed. Should be called on Win8+ after UpdateShortcutBranding.
 !macro TouchStartMenuShortcut
   ${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
@@ -348,18 +343,17 @@
 !macroend
 !define ShowShortcuts "!insertmacro ShowShortcuts"
 
 ; Update the branding name on all shortcuts our installer created
 ; to convert from BrandFullName (which is what we used to name shortcuts)
 ; to BrandShortName (which is what we now name shortcuts). We only rename
 ; desktop and start menu shortcuts, because touching taskbar pins often
 ; (but inconsistently) triggers various broken behaviors in the shell.
-; This should only be called sometime after MigrateStartMenuShortcut,
-; and it assumes SHCTX is set correctly.
+; This assumes SHCTX is set correctly.
 !macro UpdateShortcutsBranding
   ${UpdateOneShortcutBranding} "STARTMENU" "$SMPROGRAMS"
   ${UpdateOneShortcutBranding} "DESKTOP" "$DESKTOP"
 !macroend
 !define UpdateShortcutsBranding "!insertmacro UpdateShortcutsBranding"
 
 !macro UpdateOneShortcutBranding LOG_SECTION SHORTCUT_DIR
   ; Only try to rename the shortcuts found in the shortcuts log, to avoid
@@ -1206,66 +1200,16 @@
           ${EndIf}
         ${EndUnless}
       ${EndIf}
     ${EndIf}
   ${EndIf}
 !macroend
 !define PinToTaskBar "!insertmacro PinToTaskBar"
 
-; Adds a shortcut to the root of the Start Menu Programs directory if the
-; application's Start Menu Programs directory exists with a shortcut pointing to
-; this installation directory. This will also remove the old shortcuts and the
-; application's Start Menu Programs directory by calling the RemoveStartMenuDir
-; macro.
-!macro MigrateStartMenuShortcut
-  ${GetShortcutsLogPath} $0
-  ${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} "${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\${BrandShortName}.lnk" \
-                               "$INSTDIR\${FileMainEXE}"
-                ${If} ${FileExists} "$SMPROGRAMS\${BrandShortName}.lnk"
-                  ShellLink::SetShortCutWorkingDirectory "$SMPROGRAMS\${BrandShortName}.lnk" \
-                                                         "$INSTDIR"
-                  ${If} ${AtLeastWin7}
-                  ${AndIf} "$AppUserModelID" != ""
-                    ApplicationID::Set "$SMPROGRAMS\${BrandShortName}.lnk" \
-                                       "$AppUserModelID" "true"
-                  ${EndIf}
-                ${EndIf}
-              ${EndIf}
-            ${EndIf}
-          ${EndUnless}
-        ${EndIf}
-      ${EndIf}
-      ; Remove the application's Start Menu Programs directory, shortcuts, and
-      ; ini section.
-      ${RemoveStartMenuDir}
-    ${EndUnless}
-  ${EndIf}
-!macroend
-!define MigrateStartMenuShortcut "!insertmacro MigrateStartMenuShortcut"
-
 ; Removes the application's start menu directory along with its shortcuts if
 ; they exist and if they exist creates a start menu shortcut in the root of the
 ; start menu directory (bug 598779). If the application's start menu directory
 ; is not empty after removing the shortucts the directory will not be removed
 ; since these additional items were not created by the installer (uses SHCTX).
 !macro RemoveStartMenuDir
   ${GetShortcutsLogPath} $0
   ${If} ${FileExists} "$0"