diff --git a/browser/installer/windows/nsis/installer.nsi b/browser/installer/windows/nsis/installer.nsi index 0e509bdb51a..047c3edcc88 100755 --- a/browser/installer/windows/nsis/installer.nsi +++ b/browser/installer/windows/nsis/installer.nsi @@ -312,12 +312,12 @@ Section "-Application" APP_IDX ${UpdateProtocolHandlers} ClearErrors - WriteRegStr HKLM "Software\Mozilla\InstallerTest" "InstallerTest" "Test" + WriteRegStr HKLM "Software\Mozilla" "${BrandShortName}InstallerTest" "Write Test" ${If} ${Errors} StrCpy $TmpVal "HKCU" ; used primarily for logging ${Else} SetShellVarContext all ; Set SHCTX to HKLM - DeleteRegKey HKLM "Software\Mozilla\InstallerTest" + DeleteRegValue HKLM "Software\Mozilla" "${BrandShortName}InstallerTest" StrCpy $TmpVal "HKLM" ; used primarily for logging ${RegCleanMain} "Software\Mozilla" ${RegCleanUninstall} diff --git a/browser/installer/windows/nsis/shared.nsh b/browser/installer/windows/nsis/shared.nsh index 966aae64a6f..2600c098477 100755 --- a/browser/installer/windows/nsis/shared.nsh +++ b/browser/installer/windows/nsis/shared.nsh @@ -46,19 +46,32 @@ ${UpdateProtocolHandlers} ClearErrors - WriteRegStr HKLM "Software\Mozilla\InstallerTest" "InstallerTest" "Test" + WriteRegStr HKLM "Software\Mozilla" "${BrandShortName}InstallerTest" "Write Test" ${If} ${Errors} StrCpy $TmpVal "HKCU" ; used primarily for logging ${Else} SetShellVarContext all ; Set SHCTX to all users (e.g. HKLM) - DeleteRegKey HKLM "Software\Mozilla\InstallerTest" + DeleteRegValue HKLM "Software\Mozilla" "${BrandShortName}InstallerTest" StrCpy $TmpVal "HKLM" ; used primarily for logging ${RegCleanMain} "Software\Mozilla" ${RegCleanUninstall} - ${SetStartMenuInternet} - ${FixShellIconHandler} - ${SetUninstallKeys} ${UpdateProtocolHandlers} + ${FixShellIconHandler} + + ; Only update the Clients\StartMenuInternet registry key values if they + ; don't exist or this installation is the same as the one set in those keys. + ${StrFilter} "${FileMainEXE}" "+" "" "" $1 + ReadRegStr $0 HKLM "Software\Clients\StartMenuInternet\$1\DefaultIcon" "" + ${GetPathFromString} "$0" $0 + ${GetParent} "$0" $0 + ${If} ${FileExists} "$0" + ${GetLongPath} "$0" $0 + ${EndIf} + ${If} "$0" == "$INSTDIR" + ${SetStartMenuInternet} + ${EndIf} + + ${SetUninstallKeys} ReadRegStr $0 HKLM "Software\mozilla.org\Mozilla" "CurrentVersion" ${If} "$0" != "${GREVersion}" diff --git a/browser/installer/windows/nsis/uninstaller.nsi b/browser/installer/windows/nsis/uninstaller.nsi index e700f5125e3..f91b38a9b97 100755 --- a/browser/installer/windows/nsis/uninstaller.nsi +++ b/browser/installer/windows/nsis/uninstaller.nsi @@ -221,12 +221,12 @@ Section "Uninstall" ${un.DeleteShortcuts} ClearErrors - WriteRegStr HKLM "Software\Mozilla\InstallerTest" "InstallerTest" "Test" + WriteRegStr HKLM "Software\Mozilla" "${BrandShortName}InstallerTest" "Write Test" ${If} ${Errors} StrCpy $TmpVal "HKCU" ; used primarily for logging ${Else} SetShellVarContext all ; Set SHCTX to HKLM - DeleteRegKey HKLM "Software\Mozilla\InstallerTest" + DeleteRegValue HKLM "Software\Mozilla" "${BrandShortName}InstallerTest" StrCpy $TmpVal "HKLM" ; used primarily for logging ${un.RegCleanMain} "Software\Mozilla" ${un.RegCleanUninstall}