ref:4f39fc116294abf8241bcd30e1b1e23d371e6e7b

fix(windows/installer): PATH update reg add /f option ordering (#5584)

SHA: 4f39fc116294abf8241bcd30e1b1e23d371e6e7b
Author: Dave Lane <42013603+ReenigneArcher@users.noreply.github.com>
Date: 2026-08-30 22:37
Parents: f53f0f9
1 files changed +5 -3
Type
src_assets/windows/misc/path/update-path.bat +5 −3
@@ -46,7 +46,9 @@
rem Only update if path was changed
if "!NEW_PATH!" neq "!CURRENT_PATH!" (
rem Set the new path in the registry
reg add "%KEY_NAME%" /v "%VALUE_NAME%" /t REG_EXPAND_SZ /d "!NEW_PATH!" /f
rem Some localized systems may unexpectedly ignore /f at the end of the command.
rem Keep it before /d so the installer never waits for overwrite confirmation.
reg add "%KEY_NAME%" /v "%VALUE_NAME%" /t REG_EXPAND_SZ /f /d "!NEW_PATH!"
if !ERRORLEVEL!==0 (
echo Successfully added Sunshine directories to PATH
) else (
@@ -94,8 +96,8 @@
rem Only update if path was changed
if "!CHANGES_MADE!"=="1" (
rem Set the new path in the registry
rem Windows systems running Chinese may unexpectedly ignore the /f option at the end of the command.
rem This issue only occurs with the remove command.
rem Some localized systems may unexpectedly ignore /f at the end of the command.
rem Keep it before /d so the installer never waits for overwrite confirmation.
reg add "%KEY_NAME%" /v "%VALUE_NAME%" /t REG_EXPAND_SZ /f /d "!CURRENT_PATH!"
if !ERRORLEVEL!==0 (
echo Successfully removed Sunshine directories from PATH