diff --git a/browser/branding/unofficial/branding.nsi b/browser/branding/unofficial/branding.nsi index 546a03639f8..1426ff4b5d3 100644 --- a/browser/branding/unofficial/branding.nsi +++ b/browser/branding/unofficial/branding.nsi @@ -34,17 +34,22 @@ # # ***** END LICENSE BLOCK ***** -# NSIS defines for nightly builds. -# The release build branding.nsi is located in other-license/branding/firefox/ +# NSIS branding defines for unofficial builds. +# The official release build branding.nsi is located in other-license/branding/firefox/ +# The nightly build branding.nsi is located in browser/installer/windows/nsis/ !define BrandShortName "Gran Paradiso" -!define BrandFullName "Gran Paradiso" -# BrandFullNameInternal is used for some registry and file system values that -# should not contain release that may be in the BrandFullName (e.g. Beta 1, etc.) +# BrandFullNameInternal is used for some registry and file system values +# instead of BrandFullName and typically should not be modified. !define BrandFullNameInternal "Gran Paradiso" !define CompanyName "mozilla.org" !define URLInfoAbout "http://www.mozilla.org" !define URLUpdateInfo "http://www.mozilla.org/projects/firefox" !define SurveyURL "https://survey.mozilla.com/1/Mozilla%20Firefox/${AppVersion}/${AB_CD}/exit.html" -# Percentage of new "Standard" installs to enable talkback for -!define RandomPercent "50" +# Everything below this line may be modified for Alpha / Beta releases. +!define BrandFullName "Gran Paradiso" + +# Add !define NO_INSTDIR_FROM_REG to prevent finding a non-default installation +# directory in the registry and using that as the default. This prevents +# Beta releases built with official branding from finding an existing install +# of an official release and defaulting to its installation directory. diff --git a/browser/installer/windows/nsis/branding.nsi b/browser/installer/windows/nsis/branding.nsi index 6a6bb78367b..8c378e58ded 100644 --- a/browser/installer/windows/nsis/branding.nsi +++ b/browser/installer/windows/nsis/branding.nsi @@ -34,17 +34,22 @@ # # ***** END LICENSE BLOCK ***** -# NSIS defines for nightly builds. -# The release build branding.nsi is located in other-license/branding/firefox/ +# NSIS branding defines for nightly builds. +# The official release build branding.nsi is located in other-license/branding/firefox/ +# The unofficial build branding.nsi is located in browser/branding/unofficial/ !define BrandShortName "Minefield" -!define BrandFullName "Minefield" -# BrandFullNameInternal is used for some registry and file system values that -# should not contain release that may be in the BrandFullName (e.g. Beta 1, etc.) +# BrandFullNameInternal is used for some registry and file system values +# instead of BrandFullName and typically should not be modified. !define BrandFullNameInternal "Minefield" !define CompanyName "mozilla.org" !define URLInfoAbout "http://www.mozilla.org" !define URLUpdateInfo "http://www.mozilla.org/projects/firefox" !define SurveyURL "https://survey.mozilla.com/1/Mozilla%20Firefox/${AppVersion}/${AB_CD}/exit.html" -# Percentage of new "Standard" installs to enable talkback for -!define RandomPercent "50" +# Everything below this line may be modified for Alpha / Beta releases. +!define BrandFullName "Minefield" + +# Add !define NO_INSTDIR_FROM_REG to prevent finding a non-default installation +# directory in the registry and using that as the default. This prevents +# Beta releases built with official branding from finding an existing install +# of an official release and defaulting to its installation directory. diff --git a/other-licenses/branding/firefox/branding.nsi b/other-licenses/branding/firefox/branding.nsi index 07af954363a..f0065cdcc75 100755 --- a/other-licenses/branding/firefox/branding.nsi +++ b/other-licenses/branding/firefox/branding.nsi @@ -34,17 +34,22 @@ # # ***** END LICENSE BLOCK ***** -# NSIS defines for release builds. +# NSIS branding defines for official release builds. # The nightly build branding.nsi is located in browser/installer/windows/nsis/ +# The unofficial build branding.nsi is located in browser/branding/unofficial/ !define BrandShortName "Firefox" -!define BrandFullName "Mozilla Firefox" -# BrandFullNameInternal is used for some registry and file system values that -# should not contain release that may be in the BrandFullName (e.g. Beta 1, etc.) +# BrandFullNameInternal is used for some registry and file system values +# instead of BrandFullName and typically should not be modified. !define BrandFullNameInternal "Mozilla Firefox" !define CompanyName "Mozilla Corporation" !define URLInfoAbout "http://${AB_CD}.www.mozilla.com/${AB_CD}/" !define URLUpdateInfo "http://${AB_CD}.www.mozilla.com/${AB_CD}/firefox/" !define SurveyURL "https://survey.mozilla.com/1/Mozilla%20Firefox/${AppVersion}/${AB_CD}/exit.html" -# Percentage of new "Standard" installs to enable talkback for -!define RandomPercent "10" +# Everything below this line may be modified for Alpha / Beta releases. +!define BrandFullName "Mozilla Firefox" + +# Add !define NO_INSTDIR_FROM_REG to prevent finding a non-default installation +# directory in the registry and using that as the default. This prevents +# Beta releases built with official branding from finding an existing install +# of an official release and defaulting to its installation directory. diff --git a/toolkit/mozapps/installer/windows/nsis/common.nsh b/toolkit/mozapps/installer/windows/nsis/common.nsh index af7dcec9b84..b32cf09c8a8 100755 --- a/toolkit/mozapps/installer/windows/nsis/common.nsh +++ b/toolkit/mozapps/installer/windows/nsis/common.nsh @@ -4261,7 +4261,10 @@ !insertmacro CanWriteToInstallDir !insertmacro CheckDiskSpace !insertmacro GetLongPath + +!ifndef NO_INSTDIR_FROM_REG !insertmacro GetSingleInstallPath +!endif !verbose push !verbose ${_MOZFUNC_VERBOSE} @@ -4270,6 +4273,7 @@ Function PreDirectoryCommon Push $R9 +!ifndef NO_INSTDIR_FROM_REG SetShellVarContext all ; Set SHCTX to HKLM ${GetSingleInstallPath} "Software\Mozilla\${BrandFullNameInternal}" $R9 @@ -4281,6 +4285,7 @@ fix_install_dir: StrCmp "$R9" "false" +2 +1 StrCpy $INSTDIR "$R9" +!endif IfFileExists "$INSTDIR" +1 check_install_dir