зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1354321 - Rename installer-created shortcuts on update if the branding name has changed. r=agashlin
MozReview-Commit-ID: IB74aVjhQ58 --HG-- extra : rebase_source : 7f1b27fa7319a50a82ed85f03d9ba16ce74ee181
This commit is contained in:
Родитель
d12d56b126
Коммит
62cdf603c8
|
@ -80,6 +80,8 @@
|
||||||
; Adds a pinned Task Bar shortcut (see MigrateTaskBarShortcut for details).
|
; Adds a pinned Task Bar shortcut (see MigrateTaskBarShortcut for details).
|
||||||
${MigrateTaskBarShortcut}
|
${MigrateTaskBarShortcut}
|
||||||
|
|
||||||
|
${UpdateShortcutNames}
|
||||||
|
|
||||||
${RemoveDeprecatedKeys}
|
${RemoveDeprecatedKeys}
|
||||||
|
|
||||||
${SetAppKeys}
|
${SetAppKeys}
|
||||||
|
@ -301,6 +303,65 @@
|
||||||
!macroend
|
!macroend
|
||||||
!define ShowShortcuts "!insertmacro ShowShortcuts"
|
!define ShowShortcuts "!insertmacro ShowShortcuts"
|
||||||
|
|
||||||
|
; Update the branding information on all shortcuts our installer created,
|
||||||
|
; in case the branding has changed between updates.
|
||||||
|
; This should only be called sometime after both MigrateStartMenuShortcut
|
||||||
|
; and MigrateTaskBarShurtcut
|
||||||
|
!macro UpdateShortcutNames
|
||||||
|
${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}
|
||||||
|
${If} ${FileExists} "$SMPROGRAMS\$R8"
|
||||||
|
${AndIf} $R8 != "${BrandFullName}.lnk"
|
||||||
|
ShellLink::GetShortCutTarget "$SMPROGRAMS\$R8"
|
||||||
|
Pop $R7
|
||||||
|
${GetLongPath} "$R7" $R7
|
||||||
|
${If} "$INSTDIR\${FileMainEXE}" == "$R7"
|
||||||
|
Rename "$SMPROGRAMS\$R8" "$SMPROGRAMS\${BrandFullName}.lnk"
|
||||||
|
WriteINIStr "$R9" "STARTMENU" "Shortcut0" "${BrandFullName}.lnk"
|
||||||
|
${EndIf}
|
||||||
|
${EndIf}
|
||||||
|
${EndIf}
|
||||||
|
|
||||||
|
ClearErrors
|
||||||
|
ReadINIStr $R8 "$R9" "DESKTOP" "Shortcut0"
|
||||||
|
${IfNot} ${Errors}
|
||||||
|
${If} ${FileExists} "$DESKTOP\$R8"
|
||||||
|
${AndIf} $R8 != "${BrandFullName}.lnk"
|
||||||
|
ShellLink::GetShortCutTarget "$DESKTOP\$R8"
|
||||||
|
Pop $R7
|
||||||
|
${GetLongPath} "$R7" $R7
|
||||||
|
${If} "$INSTDIR\${FileMainEXE}" == "$R7"
|
||||||
|
Rename "$DESKTOP\$R8" "$DESKTOP\${BrandFullName}.lnk"
|
||||||
|
WriteINIStr "$R9" "DESKTOP" "Shortcut0" "${BrandFullName}.lnk"
|
||||||
|
${EndIf}
|
||||||
|
${EndIf}
|
||||||
|
${EndIf}
|
||||||
|
|
||||||
|
ClearErrors
|
||||||
|
ReadINIStr $R8 "$R9" "QUICKLAUNCH" "Shortcut0"
|
||||||
|
${IfNot} ${Errors}
|
||||||
|
; "QUICKLAUNCH" actually means a taskbar pin.
|
||||||
|
${If} ${FileExists} "$QUICKLAUNCH\User Pinned\TaskBar\$R8"
|
||||||
|
${AndIf} $R8 != "${BrandFullName}.lnk"
|
||||||
|
ShellLink::GetShortCutTarget "$QUICKLAUNCH\User Pinned\TaskBar\$R8"
|
||||||
|
Pop $R7
|
||||||
|
${GetLongPath} "$R7" $R7
|
||||||
|
${If} "$INSTDIR\${FileMainEXE}" == "$R7"
|
||||||
|
Rename "$QUICKLAUNCH\User Pinned\TaskBar\$R8" \
|
||||||
|
"$QUICKLAUNCH\User Pinned\TaskBar\${BrandFullName}.lnk"
|
||||||
|
WriteINIStr "$R9" "QUICKLAUNCH" "Shortcut0" "${BrandFullName}.lnk"
|
||||||
|
${EndIf}
|
||||||
|
${EndIf}
|
||||||
|
${EndIf}
|
||||||
|
${EndIf}
|
||||||
|
!macroend
|
||||||
|
!define UpdateShortcutNames "!insertmacro UpdateShortcutNames"
|
||||||
|
|
||||||
!macro AddAssociationIfNoneExist FILE_TYPE KEY
|
!macro AddAssociationIfNoneExist FILE_TYPE KEY
|
||||||
ClearErrors
|
ClearErrors
|
||||||
EnumRegKey $7 HKCR "${FILE_TYPE}" 0
|
EnumRegKey $7 HKCR "${FILE_TYPE}" 0
|
||||||
|
|
Загрузка…
Ссылка в новой задаче