From 153a4d3d76ff09abbcbc930050d142e6d40822d6 Mon Sep 17 00:00:00 2001 From: Rob Lemley Date: Fri, 4 Nov 2022 20:37:34 +0000 Subject: [PATCH] Bug 1799202 - Wrap use of $AddPrivateBrowsingSC with !ifdef in shared installer code. r=bhearsum Private browsing doesn't make sense for Thunderbird. Wrap the use of $AddPrivateBrowsingSC to avoid breaking the installer build. Differential Revision: https://phabricator.services.mozilla.com/D161340 --- browser/installer/windows/nsis/defines.nsi.in | 3 +++ .../mozapps/installer/windows/nsis/common.nsh | 18 +++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/browser/installer/windows/nsis/defines.nsi.in b/browser/installer/windows/nsis/defines.nsi.in index 334a73995fa7..fd39d599f53b 100644 --- a/browser/installer/windows/nsis/defines.nsi.in +++ b/browser/installer/windows/nsis/defines.nsi.in @@ -127,6 +127,9 @@ !define MOZ_OPTIONAL_EXTENSIONS !endif +# To add Private Browsing shortcut argument to setup.exe +!define MOZ_PRIVATE_BROWSING + # File details shared by both the installer and uninstaller VIProductVersion "1.0.0.0" VIAddVersionKey "ProductName" "${BrandShortName}" diff --git a/toolkit/mozapps/installer/windows/nsis/common.nsh b/toolkit/mozapps/installer/windows/nsis/common.nsh index cd30a5c4047c..f291e68c6158 100755 --- a/toolkit/mozapps/installer/windows/nsis/common.nsh +++ b/toolkit/mozapps/installer/windows/nsis/common.nsh @@ -5622,12 +5622,14 @@ StrCpy $AddStartMenuSC "1" ${EndIf} - ReadINIStr $R8 $R7 "Install" "PrivateBrowsingShortcut" - ${If} $R8 == "false" - StrCpy $AddPrivateBrowsingSC "0" - ${ElseIfNot} ${Errors} - StrCpy $AddPrivateBrowsingSC "1" - ${EndIf} + !ifdef MOZ_PRIVATE_BROWSING + ReadINIStr $R8 $R7 "Install" "PrivateBrowsingShortcut" + ${If} $R8 == "false" + StrCpy $AddPrivateBrowsingSC "0" + ${ElseIfNot} ${Errors} + StrCpy $AddPrivateBrowsingSC "1" + ${EndIf} + !endif ReadINIStr $R8 $R7 "Install" "TaskbarShortcut" ${If} $R8 == "false" @@ -5693,7 +5695,9 @@ ; We still accept the plural version for backwards compatibility, ; but the singular version takes priority. ${InstallGetOption} $R8 "StartMenuShortcut" $AddStartMenuSC - ${InstallGetOption} $R8 "PrivateBrowsingShortcut" $AddPrivateBrowsingSC + !ifdef MOZ_PRIVATE_BROWSING + ${InstallGetOption} $R8 "PrivateBrowsingShortcut" $AddPrivateBrowsingSC + !endif ${InstallGetOption} $R8 "TaskbarShortcut" $AddTaskbarSC ${InstallGetOption} $R8 "MaintenanceService" $InstallMaintenanceService ${InstallGetOption} $R8 "RegisterDefaultAgent" $RegisterDefaultAgent