From e80beccfe44446ce760635081e2475cb5b350774 Mon Sep 17 00:00:00 2001 From: K4sum1 Date: Mon, 24 Mar 2025 14:21:31 -0700 Subject: [PATCH] Revert "Issue #1229 - Remove fallback for $INSTDIR" This reverts commit c87432ab7e40ac646c311beebaa1e7b92a724280. --- toolkit/mozapps/installer/windows/nsis/common.nsh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/toolkit/mozapps/installer/windows/nsis/common.nsh b/toolkit/mozapps/installer/windows/nsis/common.nsh index 0016b7eeb5..44b59a5002 100644 --- a/toolkit/mozapps/installer/windows/nsis/common.nsh +++ b/toolkit/mozapps/installer/windows/nsis/common.nsh @@ -5587,6 +5587,21 @@ StrCpy $INSTDIR "$R9" !endif + ; If the user doesn't have write access to the installation directory set + ; the installation directory to a subdirectory of the All Users application + ; directory and if the user can't write to that location set the installation + ; directory to a subdirectory of the users local application directory + ; (e.g. non-roaming). + ${CanWriteToInstallDir} $R9 + StrCmp "$R9" "false" +1 finish_check_install_dir + + SetShellVarContext all ; Set SHCTX to All Users + StrCpy $INSTDIR "$APPDATA\${BrandFullName}\" + ${CanWriteToInstallDir} $R9 + StrCmp "$R9" "false" +2 +1 + StrCpy $INSTDIR "$LOCALAPPDATA\${BrandFullName}\" + + finish_check_install_dir: IfFileExists "$INSTDIR" +3 +1 Pop $R9 Return