File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,8 +42,12 @@ namespace
4242 ERROR_INSTALL_CONTINUE = -4
4343 };
4444
45- // Command line constants
46- constexpr size_t MAX_CMD_LINE_LENGTH = 4096 ;
45+ // Command line constants. Sized to hold the Windows command-line maximum (CreateProcess limit
46+ // is 32767 wchar_t, see CreateProcessW docs). The auto-update flow serializes the sequencer
47+ // snapshot through this buffer (CInstallManager::_MaybeSwitchToTempExe -> ShellExecuteNonBlocking
48+ // -> Process C lpCmdLine), so a smaller cap silently truncates restored state and breaks the
49+ // INSTALL_ROOT carry that prevents U01 in temp-launched processes.
50+ constexpr size_t MAX_CMD_LINE_LENGTH = 32768 ;
4751
4852 // Report log IDs
4953 constexpr int LOG_ID_END = 1044 ;
Original file line number Diff line number Diff line change @@ -679,7 +679,10 @@ bool IsTemporaryUpdateLaunchPath(const SString& strLaunchPath)
679679 if (!strLaunchPath.ContainsI (" \\ upcache\\ " ))
680680 return false ;
681681
682- return ExtractFilename (strLaunchPath).ContainsI (" _tmp_" );
682+ // The auto-update flow creates the extraction directory in Install.cpp::CheckOnRestartCommand
683+ // as MakeUniquePath("...\\upcache\\_<archiveName>_tmp_"), so the leaf always begins with '_'.
684+ const SString strLeaf = ExtractFilename (strLaunchPath);
685+ return strLeaf.BeginsWith (" _" ) && strLeaf.ContainsI (" _tmp_" );
683686}
684687
685688void SetMTASAPathSource (bool bReadFromRegistry)
Original file line number Diff line number Diff line change @@ -405,7 +405,10 @@ static bool IsTemporaryUpdateLaunchPath(const SString& strLaunchPath)
405405 if (!strLaunchPath.ContainsI (" \\ upcache\\ " ))
406406 return false ;
407407
408- return ExtractFilename (strLaunchPath).ContainsI (" _tmp_" );
408+ // The auto-update flow creates the extraction directory in Install.cpp::CheckOnRestartCommand
409+ // as MakeUniquePath("...\\upcache\\_<archiveName>_tmp_"), so the leaf always begins with '_'.
410+ const SString strLeaf = ExtractFilename (strLaunchPath);
411+ return strLeaf.BeginsWith (" _" ) && strLeaf.ContainsI (" _tmp_" );
409412}
410413
411414// Read Last Run Location from a specific registry view. viewFlag should be one of
You can’t perform that action at this time.
0 commit comments