From ef9e5b0112d7b00733209d01ebd164f8b0ac4395 Mon Sep 17 00:00:00 2001 From: LocalIdentity Date: Sun, 26 Oct 2025 08:58:28 +1100 Subject: [PATCH] Remove CMD flash on updating runtime files When we update runtime files, SpawnProcess flashes a cmd windows quickly on the users screen before disappearing. This PR is reliant on the SG PR to work --- src/HeadlessWrapper.lua | 3 +++ src/Launch.lua | 13 ++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/HeadlessWrapper.lua b/src/HeadlessWrapper.lua index 6f7ae1e28..840ceb0f2 100644 --- a/src/HeadlessWrapper.lua +++ b/src/HeadlessWrapper.lua @@ -152,6 +152,9 @@ function ConPrintTable(tbl, noRecurse) end function ConExecute(cmd) end function ConClear() end function SpawnProcess(cmdName, args) end +function SpawnProcessHidden(cmdName, args) + return SpawnProcess(cmdName, args) +end function OpenURL(url) end function SetProfiling(isEnabled) end function Restart() end diff --git a/src/Launch.lua b/src/Launch.lua index 505a42b9e..f77eb3f87 100644 --- a/src/Launch.lua +++ b/src/Launch.lua @@ -312,11 +312,22 @@ function launch:DownloadPage(url, callback, params) end end +function launch:StartRuntimeUpdateProcess() + local runtimePath = GetRuntimePath() + local args = "UpdateApply.lua Update/opFileRuntime.txt" + if isWindows and SpawnProcessHidden then + SpawnProcessHidden(runtimePath.."/Update", args) + else + SpawnProcess(runtimePath.."/Update", args) + end + return true +end + function launch:ApplyUpdate(mode) if mode == "basic" then -- Need to revert to the basic environment to fully apply the update LoadModule("UpdateApply", "Update/opFile.txt") - SpawnProcess(GetRuntimePath()..'/Update', 'UpdateApply.lua Update/opFileRuntime.txt') + self:StartRuntimeUpdateProcess() Exit() elseif mode == "normal" then -- Update can be applied while normal environment is running