Bug 1340568 - Fix some cases of the installer generating duplicate registry keys. r=rstrong

This is followup from bug 1324617, which added a new naming scheme for registry
keys related to the default browser settings, to allow more than one installation
to participate in those settings. That patch attempted to prevent creating the
new keys for an installation which already had the old ones, but didn't go far
enough with that attempt.

Also, clean up how we use the IconsVisible registry entry, specifically to
always set it on new installs even if we don't create shortcuts, because it no
longer seems to actually do anything except control the value of the Enable
Access checkbox in the Windows 7 version of Set Program Access and Defaults.
This was, I admit, mostly done to avoid having to fix a couple places where we
were updating the IconsVisible value.

MozReview-Commit-ID: 6VHU8FlBT0M

--HG--
extra : rebase_source : 4edbd508ae125b3b0f7c6d4b9ee6a6550f316cb7
This commit is contained in:
Matt Howell 2017-02-24 09:17:22 -08:00
Родитель 19b6ae43dc
Коммит 0cf240a0d5
2 изменённых файлов: 144 добавлений и 123 удалений

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

@ -387,48 +387,12 @@ Section "-Application" APP_IDX
; For post win8, the keys below can be set in HKCU if needed.
${If} $TmpVal == "HKLM"
; Set the Start Menu Internet and Registered App HKLM registry keys.
; If we're upgrading an existing install, replacing the old registry entries
; (without a path hash) would cause the default browser to be reset.
ReadRegStr $0 HKLM "Software\Clients\StartMenuInternet\FIREFOX.EXE\DefaultIcon" ""
StrCpy $0 $0 -2
${If} $0 != "$INSTDIR\${FileMainEXE}"
${SetStartMenuInternet} "HKLM"
${FixShellIconHandler} "HKLM"
${EndIf}
; If we are writing to HKLM and create either the desktop or start menu
; shortcuts set IconsVisible to 1 otherwise to 0.
; Taskbar shortcuts imply having a start menu shortcut.
StrCpy $0 "Software\Clients\StartMenuInternet\${AppRegName}-$AppUserModelID\InstallInfo"
${If} $AddDesktopSC == 1
${OrIf} $AddStartMenuSC == 1
${OrIf} $AddTaskbarSC == 1
WriteRegDWORD HKLM "$0" "IconsVisible" 1
${Else}
WriteRegDWORD HKLM "$0" "IconsVisible" 0
${EndIf}
${SetStartMenuInternet} "HKLM"
${FixShellIconHandler} "HKLM"
${ElseIf} ${AtLeastWin8}
; Set the Start Menu Internet and Registered App HKCU registry keys.
; If we're upgrading an existing install, replacing the old registry entries
; (without a path hash) would cause the default browser to be reset.
ReadRegStr $0 HKCU "Software\Clients\StartMenuInternet\FIREFOX.EXE\DefaultIcon" ""
StrCpy $0 $0 -2
${If} $0 != "$INSTDIR\${FileMainEXE}"
${SetStartMenuInternet} "HKCU"
${FixShellIconHandler} "HKCU"
${EndIf}
; If we create either the desktop or start menu shortcuts, then
; set IconsVisible to 1 otherwise to 0.
; Taskbar shortcuts imply having a start menu shortcut.
StrCpy $0 "Software\Clients\StartMenuInternet\${AppRegName}-$AppUserModelID\InstallInfo"
${If} $AddDesktopSC == 1
${OrIf} $AddStartMenuSC == 1
${OrIf} $AddTaskbarSC == 1
WriteRegDWORD HKCU "$0" "IconsVisible" 1
${Else}
WriteRegDWORD HKCU "$0" "IconsVisible" 0
${EndIf}
${SetStartMenuInternet} "HKCU"
${FixShellIconHandler} "HKCU"
${EndIf}
!ifdef MOZ_MAINTENANCE_SERVICE

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

@ -150,8 +150,6 @@
${SetStartMenuInternet} "HKLM"
${FixShellIconHandler} "HKLM"
${ShowShortcuts}
${StrFilter} "${FileMainEXE}" "+" "" "" $R9
WriteRegStr HKLM "Software\Clients\StartMenuInternet" "" "$R9-$AppUserModelID"
!macroend
!define SetAsDefaultAppGlobal "!insertmacro SetAsDefaultAppGlobal"
@ -159,8 +157,13 @@
; application from Open With for the file types the application handles
; (bug 370480).
!macro HideShortcuts
${StrFilter} "${FileMainEXE}" "+" "" "" $0
StrCpy $R1 "Software\Clients\StartMenuInternet\$0\InstallInfo"
; Find the correct registry path to clear IconsVisible.
StrCpy $R1 "Software\Clients\StartMenuInternet\${AppRegName}-$AppUserModelID\InstallInfo"
ReadRegDWORD $0 HKLM "$R1" "ShowIconsCommand"
${If} ${Errors}
${StrFilter} "${FileMainEXE}" "+" "" "" $0
StrCpy $R1 "Software\Clients\StartMenuInternet\$0\InstallInfo"
${EndIf}
WriteRegDWORD HKLM "$R1" "IconsVisible" 0
${If} ${AtLeastWin8}
WriteRegDWORD HKCU "$R1" "IconsVisible" 0
@ -221,7 +224,13 @@
; Adds shortcuts for this installation. This should also add the application
; to Open With for the file types the application handles (bug 370480).
!macro ShowShortcuts
; Find the correct registry path to set IconsVisible.
StrCpy $R1 "Software\Clients\StartMenuInternet\${AppRegName}-$AppUserModelID\InstallInfo"
ReadRegDWORD $0 HKLM "$R1" "ShowIconsCommand"
${If} ${Errors}
${StrFilter} "${FileMainEXE}" "+" "" "" $0
StrCpy $R1 "Software\Clients\StartMenuInternet\$0\InstallInfo"
${EndIf}
WriteRegDWORD HKLM "$R1" "IconsVisible" 1
${If} ${AtLeastWin8}
WriteRegDWORD HKCU "$R1" "IconsVisible" 1
@ -292,13 +301,13 @@
!macroend
!define ShowShortcuts "!insertmacro ShowShortcuts"
!macro AddAssociationIfNoneExist FILE_TYPE
!macro AddAssociationIfNoneExist FILE_TYPE KEY
ClearErrors
EnumRegKey $7 HKCR "${FILE_TYPE}" 0
${If} ${Errors}
WriteRegStr SHCTX "SOFTWARE\Classes\${FILE_TYPE}" "" "FirefoxHTML-$AppUserModelID"
WriteRegStr SHCTX "SOFTWARE\Classes\${FILE_TYPE}" "" ${KEY}
${EndIf}
WriteRegStr SHCTX "SOFTWARE\Classes\${FILE_TYPE}\OpenWithProgids" "FirefoxHTML-$AppUserModelID" ""
WriteRegStr SHCTX "SOFTWARE\Classes\${FILE_TYPE}\OpenWithProgids" ${KEY} ""
!macroend
!define AddAssociationIfNoneExist "!insertmacro AddAssociationIfNoneExist"
@ -307,6 +316,15 @@
!macro SetHandlers
${GetLongPath} "$INSTDIR\${FileMainEXE}" $8
; See if we're using path hash suffixed registry keys for this install.
StrCpy $5 ""
${StrFilter} "${FileMainEXE}" "+" "" "" $2
ReadRegStr $0 SHCTX "Software\Clients\StartMenuInternet\$2\DefaultIcon" ""
StrCpy $0 $0 -2
${If} $0 != $8
StrCpy $5 "-$AppUserModelID"
${EndIf}
StrCpy $0 "SOFTWARE\Classes"
StrCpy $2 "$\"$8$\" -osint -url $\"%1$\""
@ -314,46 +332,46 @@
ReadRegStr $6 SHCTX "$0\.htm" ""
${WordFind} "$6" "-" "+1{" $6
${If} "$6" != "FirefoxHTML"
WriteRegStr SHCTX "$0\.htm" "" "FirefoxHTML-$AppUserModelID"
WriteRegStr SHCTX "$0\.htm" "" "FirefoxHTML$5"
${EndIf}
ReadRegStr $6 SHCTX "$0\.html" ""
${WordFind} "$6" "-" "+1{" $6
${If} "$6" != "FirefoxHTML"
WriteRegStr SHCTX "$0\.html" "" "FirefoxHTML-$AppUserModelID"
WriteRegStr SHCTX "$0\.html" "" "FirefoxHTML$5"
${EndIf}
ReadRegStr $6 SHCTX "$0\.shtml" ""
${WordFind} "$6" "-" "+1{" $6
${If} "$6" != "FirefoxHTML"
WriteRegStr SHCTX "$0\.shtml" "" "FirefoxHTML-$AppUserModelID"
WriteRegStr SHCTX "$0\.shtml" "" "FirefoxHTML$5"
${EndIf}
ReadRegStr $6 SHCTX "$0\.xht" ""
${WordFind} "$6" "-" "+1{" $6
${If} "$6" != "FirefoxHTML"
WriteRegStr SHCTX "$0\.xht" "" "FirefoxHTML-$AppUserModelID"
WriteRegStr SHCTX "$0\.xht" "" "FirefoxHTML$5"
${EndIf}
ReadRegStr $6 SHCTX "$0\.xhtml" ""
${WordFind} "$6" "-" "+1{" $6
${If} "$6" != "FirefoxHTML"
WriteRegStr SHCTX "$0\.xhtml" "" "FirefoxHTML-$AppUserModelID"
WriteRegStr SHCTX "$0\.xhtml" "" "FirefoxHTML$5"
${EndIf}
${AddAssociationIfNoneExist} ".pdf"
${AddAssociationIfNoneExist} ".oga"
${AddAssociationIfNoneExist} ".ogg"
${AddAssociationIfNoneExist} ".ogv"
${AddAssociationIfNoneExist} ".pdf"
${AddAssociationIfNoneExist} ".webm"
${AddAssociationIfNoneExist} ".pdf" "FirefoxHTML$5"
${AddAssociationIfNoneExist} ".oga" "FirefoxHTML$5"
${AddAssociationIfNoneExist} ".ogg" "FirefoxHTML$5"
${AddAssociationIfNoneExist} ".ogv" "FirefoxHTML$5"
${AddAssociationIfNoneExist} ".pdf" "FirefoxHTML$5"
${AddAssociationIfNoneExist} ".webm" "FirefoxHTML$5"
; An empty string is used for the 5th param because FirefoxHTML is not a
; protocol handler
${AddDisabledDDEHandlerValues} "FirefoxHTML-$AppUserModelID" "$2" "$8,1" \
${AddDisabledDDEHandlerValues} "FirefoxHTML$5" "$2" "$8,1" \
"${AppRegName} HTML Document" ""
${AddDisabledDDEHandlerValues} "FirefoxURL-$AppUserModelID" "$2" "$8,1" "${AppRegName} URL" \
${AddDisabledDDEHandlerValues} "FirefoxURL$5" "$2" "$8,1" "${AppRegName} URL" \
"true"
; An empty string is used for the 4th & 5th params because the following
; protocol handlers already have a display name and the additional keys
@ -386,57 +404,54 @@
${GetLongPath} "$INSTDIR\${FileMainEXE}" $8
${GetLongPath} "$INSTDIR\uninstall\helper.exe" $7
StrCpy $0 "Software\Clients\StartMenuInternet\${AppRegName}-$AppUserModelID"
; Avoid writing new keys at the hash-suffixed path if this installation
; already has keys at the old FIREFOX.EXE path. Otherwise we would create a
; second entry in Default Apps for the same installation.
${StrFilter} "${FileMainEXE}" "+" "" "" $1
ReadRegStr $0 ${RegKey} "Software\Clients\StartMenuInternet\$1\DefaultIcon" ""
StrCpy $0 $0 -2
${If} $0 != $8
StrCpy $0 "Software\Clients\StartMenuInternet\${AppRegName}-$AppUserModelID"
WriteRegStr ${RegKey} "$0" "" "${BrandFullName}"
WriteRegStr ${RegKey} "$0" "" "${BrandFullName}"
WriteRegStr ${RegKey} "$0\DefaultIcon" "" "$8,0"
WriteRegStr ${RegKey} "$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 ${RegKey} "$0\InstallInfo" "HideIconsCommand" "$\"$7$\" /HideShortcuts"
WriteRegStr ${RegKey} "$0\InstallInfo" "ShowIconsCommand" "$\"$7$\" /ShowShortcuts"
WriteRegStr ${RegKey} "$0\InstallInfo" "ReinstallCommand" "$\"$7$\" /SetAsDefaultAppGlobal"
; 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 ${RegKey} "$0\InstallInfo" "HideIconsCommand" "$\"$7$\" /HideShortcuts"
WriteRegStr ${RegKey} "$0\InstallInfo" "ShowIconsCommand" "$\"$7$\" /ShowShortcuts"
WriteRegStr ${RegKey} "$0\InstallInfo" "ReinstallCommand" "$\"$7$\" /SetAsDefaultAppGlobal"
WriteRegDWORD ${RegKey} "$0\InstallInfo" "IconsVisible" 1
ClearErrors
ReadRegDWORD $1 ${RegKey} "$0\InstallInfo" "IconsVisible"
; If the IconsVisible name value 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 ${RegKey} "$0\InstallInfo" "IconsVisible" 1
${Else}
WriteRegDWORD ${RegKey} "$0\InstallInfo" "IconsVisible" 0
${EndIf}
WriteRegStr ${RegKey} "$0\shell\open\command" "" "$\"$8$\""
WriteRegStr ${RegKey} "$0\shell\properties" "" "$(CONTEXT_OPTIONS)"
WriteRegStr ${RegKey} "$0\shell\properties\command" "" "$\"$8$\" -preferences"
WriteRegStr ${RegKey} "$0\shell\safemode" "" "$(CONTEXT_SAFE_MODE)"
WriteRegStr ${RegKey} "$0\shell\safemode\command" "" "$\"$8$\" -safe-mode"
; Capabilities registry keys
WriteRegStr ${RegKey} "$0\Capabilities" "ApplicationDescription" "$(REG_APP_DESC)"
WriteRegStr ${RegKey} "$0\Capabilities" "ApplicationIcon" "$8,0"
WriteRegStr ${RegKey} "$0\Capabilities" "ApplicationName" "${BrandShortName}"
WriteRegStr ${RegKey} "$0\Capabilities\FileAssociations" ".htm" "FirefoxHTML-$AppUserModelID"
WriteRegStr ${RegKey} "$0\Capabilities\FileAssociations" ".html" "FirefoxHTML-$AppUserModelID"
WriteRegStr ${RegKey} "$0\Capabilities\FileAssociations" ".shtml" "FirefoxHTML-$AppUserModelID"
WriteRegStr ${RegKey} "$0\Capabilities\FileAssociations" ".xht" "FirefoxHTML-$AppUserModelID"
WriteRegStr ${RegKey} "$0\Capabilities\FileAssociations" ".xhtml" "FirefoxHTML-$AppUserModelID"
WriteRegStr ${RegKey} "$0\Capabilities\StartMenu" "StartMenuInternet" "${AppRegName}-$AppUserModelID"
WriteRegStr ${RegKey} "$0\Capabilities\URLAssociations" "ftp" "FirefoxURL-$AppUserModelID"
WriteRegStr ${RegKey} "$0\Capabilities\URLAssociations" "http" "FirefoxURL-$AppUserModelID"
WriteRegStr ${RegKey} "$0\Capabilities\URLAssociations" "https" "FirefoxURL-$AppUserModelID"
; Registered Application
WriteRegStr ${RegKey} "Software\RegisteredApplications" "${AppRegName}-$AppUserModelID" "$0\Capabilities"
${EndIf}
WriteRegStr ${RegKey} "$0\shell\open\command" "" "$\"$8$\""
WriteRegStr ${RegKey} "$0\shell\properties" "" "$(CONTEXT_OPTIONS)"
WriteRegStr ${RegKey} "$0\shell\properties\command" "" "$\"$8$\" -preferences"
WriteRegStr ${RegKey} "$0\shell\safemode" "" "$(CONTEXT_SAFE_MODE)"
WriteRegStr ${RegKey} "$0\shell\safemode\command" "" "$\"$8$\" -safe-mode"
; Capabilities registry keys
WriteRegStr ${RegKey} "$0\Capabilities" "ApplicationDescription" "$(REG_APP_DESC)"
WriteRegStr ${RegKey} "$0\Capabilities" "ApplicationIcon" "$8,0"
WriteRegStr ${RegKey} "$0\Capabilities" "ApplicationName" "${BrandShortName}"
WriteRegStr ${RegKey} "$0\Capabilities\FileAssociations" ".htm" "FirefoxHTML-$AppUserModelID"
WriteRegStr ${RegKey} "$0\Capabilities\FileAssociations" ".html" "FirefoxHTML-$AppUserModelID"
WriteRegStr ${RegKey} "$0\Capabilities\FileAssociations" ".shtml" "FirefoxHTML-$AppUserModelID"
WriteRegStr ${RegKey} "$0\Capabilities\FileAssociations" ".xht" "FirefoxHTML-$AppUserModelID"
WriteRegStr ${RegKey} "$0\Capabilities\FileAssociations" ".xhtml" "FirefoxHTML-$AppUserModelID"
WriteRegStr ${RegKey} "$0\Capabilities\StartMenu" "StartMenuInternet" "${AppRegName}-$AppUserModelID"
WriteRegStr ${RegKey} "$0\Capabilities\URLAssociations" "ftp" "FirefoxURL-$AppUserModelID"
WriteRegStr ${RegKey} "$0\Capabilities\URLAssociations" "http" "FirefoxURL-$AppUserModelID"
WriteRegStr ${RegKey} "$0\Capabilities\URLAssociations" "https" "FirefoxURL-$AppUserModelID"
; Registered Application
WriteRegStr ${RegKey} "Software\RegisteredApplications" "${AppRegName}-$AppUserModelID" "$0\Capabilities"
!macroend
!define SetStartMenuInternet "!insertmacro SetStartMenuInternet"
@ -445,13 +460,21 @@
; installs (see bug 268512). The symptoms can be either an incorrect icon or no
; icon being displayed for files associated with Firefox (does not use SHCTX).
!macro FixShellIconHandler RegKey
; Find the correct key to update, either FirefoxHTML or FirefoxHTML-[PathHash]
StrCpy $3 "FirefoxHTML-$AppUserModelID"
ClearErrors
ReadRegStr $1 ${RegKey} "Software\Classes\FirefoxHTML-$AppUserModelID\ShellEx\IconHandler" ""
ReadRegStr $0 ${RegKey} "Software\Classes\$3\DefaultIcon" ""
${If} ${Errors}
StrCpy $3 "FirefoxHTML"
${EndIf}
ClearErrors
ReadRegStr $1 ${RegKey} "Software\Classes\$3\ShellEx\IconHandler" ""
${Unless} ${Errors}
ReadRegStr $1 ${RegKey} "Software\Classes\FirefoxHTML-$AppUserModelID\DefaultIcon" ""
ReadRegStr $1 ${RegKey} "Software\Classes\$3\DefaultIcon" ""
${GetLongPath} "$INSTDIR\${FileMainEXE}" $2
${If} "$1" != "$2,1"
WriteRegStr ${RegKey} "Software\Classes\FirefoxHTML-$AppUserModelID\DefaultIcon" "" "$2,1"
WriteRegStr ${RegKey} "Software\Classes\$3\DefaultIcon" "" "$2,1"
${EndIf}
${EndUnless}
!macroend
@ -606,7 +629,7 @@
DeleteRegValue HKLM "Software\Classes\${FILE_TYPE}" ""
${EndIf}
${ElseIf} "$0" == "FirefoxHTML"
; Since KHCU is set to FirefoxHTML remove FirefoxHTML as the default value
; Since HKCU is set to FirefoxHTML remove FirefoxHTML as the default value
; from HKCU if HKLM is set to a value other than an empty string.
${If} "$1" != ""
DeleteRegValue HKCU "Software\Classes\${FILE_TYPE}" ""
@ -668,12 +691,24 @@
; protocol handler.
${AddDisabledDDEHandlerValues} "FirefoxHTML-$AppUserModelID" "$2" "$8,1" \
"${AppRegName} HTML Document" ""
${Else}
${IsHandlerForInstallDir} "FirefoxHTML" $R9
${If} "$R9" == "true"
${AddDisabledDDEHandlerValues} "FirefoxHTML" "$2" "$8,1" \
"${AppRegName} HTML Document" ""
${EndIf}
${EndIf}
${IsHandlerForInstallDir} "FirefoxURL-$AppUserModelID" $R9
${If} "$R9" == "true"
${AddDisabledDDEHandlerValues} "FirefoxURL-$AppUserModelID" "$2" "$8,1" \
"${AppRegName} URL" "true"
${Else}
${IsHandlerForInstallDir} "FirefoxURL" $R9
${If} "$R9" == "true"
${AddDisabledDDEHandlerValues} "FirefoxURL" "$2" "$8,1" \
"${AppRegName} URL" "true"
${EndIf}
${EndIf}
; An empty string is used for the 4th & 5th params because the following
@ -1215,23 +1250,35 @@
Function SetAsDefaultAppUserHKCU
; Only set as the user's StartMenuInternet browser if the StartMenuInternet
; registry keys are for this install.
${StrFilter} "${FileMainEXE}" "+" "" "" $R9
StrCpy $R9 "${AppRegName}-$AppUserModelID"
ClearErrors
ReadRegStr $0 HKCU "Software\Clients\StartMenuInternet\$R9-$AppUserModelID\DefaultIcon" ""
ReadRegStr $0 HKCU "Software\Clients\StartMenuInternet\$R9\DefaultIcon" ""
${If} ${Errors}
${OrIf} ${AtMostWin2008R2}
ClearErrors
ReadRegStr $0 HKLM "Software\Clients\StartMenuInternet\$R9-$AppUserModelID\DefaultIcon" ""
ReadRegStr $0 HKLM "Software\Clients\StartMenuInternet\$R9\DefaultIcon" ""
${EndIf}
${Unless} ${Errors}
${GetPathFromString} "$0" $0
${GetParent} "$0" $0
${If} ${FileExists} "$0"
${GetLongPath} "$0" $0
${If} "$0" == "$INSTDIR"
WriteRegStr HKCU "Software\Clients\StartMenuInternet" "" "$R9-$AppUserModelID"
${EndIf}
WriteRegStr HKCU "Software\Clients\StartMenuInternet" "" "$R9"
${Else}
${StrFilter} "${FileMainEXE}" "+" "" "" $R9
ClearErrors
ReadRegStr $0 HKCU "Software\Clients\StartMenuInternet\$R9\DefaultIcon" ""
${If} ${Errors}
${OrIf} ${AtMostWin2008R2}
ClearErrors
ReadRegStr $0 HKLM "Software\Clients\StartMenuInternet\$R9\DefaultIcon" ""
${EndIf}
${Unless} ${Errors}
${GetPathFromString} "$0" $0
${GetParent} "$0" $0
${If} ${FileExists} "$0"
${GetLongPath} "$0" $0
${If} "$0" == "$INSTDIR"
WriteRegStr HKCU "Software\Clients\StartMenuInternet" "" "$R9"
${EndIf}
${EndIf}
${EndUnless}
${EndUnless}
SetShellVarContext current ; Set SHCTX to the current user (e.g. HKCU)
@ -1249,11 +1296,11 @@ Function SetAsDefaultAppUserHKCU
; file handlers set previously at the user level will associate this install
; as the default browser.
ClearErrors
ReadRegStr $0 HKLM "Software\RegisteredApplications" "${AppRegName}-$AppUserModelID"
ReadRegStr $0 HKLM "Software\RegisteredApplications" "$R9"
${Unless} ${Errors}
; This is all protected by a user choice hash in Windows 8 so it won't
; help, but it also won't hurt.
AppAssocReg::SetAppAsDefaultAll "${AppRegName}-$AppUserModelID"
AppAssocReg::SetAppAsDefaultAll "$R9"
${EndUnless}
${RemoveDeprecatedKeys}
${MigrateTaskBarShortcut}
@ -1305,7 +1352,7 @@ Function SetAsDefaultAppUser
; StartMenuInternet registry keys.
; http://support.microsoft.com/kb/297878
; Check if this install location registered as the StartMenuInternet client
; Check if this install location registered as a StartMenuInternet client
ClearErrors
ReadRegStr $0 HKCU "Software\Clients\StartMenuInternet\${AppRegName}-$AppUserModelID\DefaultIcon" ""
${If} ${Errors}
@ -1313,6 +1360,16 @@ Function SetAsDefaultAppUser
ClearErrors
ReadRegStr $0 HKLM "Software\Clients\StartMenuInternet\${AppRegName}-$AppUserModelID\DefaultIcon" ""
${EndIf}
${If} ${Errors}
${StrFilter} "${FileMainEXE}" "+" "" "" $R9
ClearErrors
ReadRegStr $0 HKCU "Software\Clients\StartMenuInternet\$R9\DefaultIcon" ""
${EndIf}
${If} ${Errors}
${OrIf} ${AtMostWin2008R2}
ClearErrors
ReadRegStr $0 HKLM "Software\Clients\StartMenuInternet\$R9\DefaultIcon" ""
${EndIf}
${Unless} ${Errors}
${GetPathFromString} "$0" $0