From fc9aafd7eff3a4b86932e3816041362ecf1bf14e Mon Sep 17 00:00:00 2001 From: Bruce Date: Sun, 12 Apr 2026 16:29:16 +0800 Subject: [PATCH] Update the solution for Arm Build update. --- settings/main.cpp | 17 +++++++++++++++++ shared/html/settings/update.html | 15 +++++++++++---- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/settings/main.cpp b/settings/main.cpp index a64d494..f072704 100644 --- a/settings/main.cpp +++ b/settings/main.cpp @@ -418,6 +418,15 @@ public ref class _I_System return (error == ERROR_OLD_WIN_VERSION) ? FALSE : FALSE; } } + property int ProcessorArchitecture + { + int get () + { + SYSTEM_INFO si; + GetNativeSystemInfo (&si); + return si.wProcessorArchitecture; + } + } }; public ref class _I_System2: public _I_System { @@ -1208,6 +1217,14 @@ public ref class MainHtmlWnd: public System::Windows::Forms::Form, public IScrip th->Start (); } bool Kill (String ^filename, bool allproc, bool onlyname) { return KillProcessByFilePath (MPStringToStdW (filename), allproc, onlyname); } + bool Start (String ^filename, String ^args) + { + LPCWSTR lpArgs = (args && args->Length) ? MPStringToPtrW (args) : nullptr; + HINSTANCE result = ShellExecuteW (nullptr, L"open", MPStringToStdW (filename).c_str (), lpArgs, nullptr, SW_SHOWNORMAL); + if (reinterpret_cast (result) <= 32) return false; + return true; + } + bool Open (String ^url) { return Start (url, nullptr); } }; [ComVisible (true)] ref class _I_ResourcePri diff --git a/shared/html/settings/update.html b/shared/html/settings/update.html index 16c3af1..61617b9 100644 --- a/shared/html/settings/update.html +++ b/shared/html/settings/update.html @@ -372,12 +372,11 @@ try { WinJS.xhr({ url: "https://api.github.com/repos/modernw/App-Installer-For-Windows-8.x-Reset/releases/latest" - }).done(function(resp) { + }).then(function(resp) { // console.log("success", resp); var json = JSON.parse(resp.responseText); window.fetchedJson = json; // console.log(json); - self.disabled = false; newVersionVersion.textContent = json.name; newVersionVersion.setAttribute("data-version", json.tag_name); window.newver = json.tag_name; @@ -396,7 +395,6 @@ break; } } - window.parent.setDisabledForOperation(false); if (compareVersion(window.currver, window.newver) >= 0) { checkUpdateText.textContent = getPublicRes(114); checkUpdateBtn.textContent = getPublicRes(115); @@ -419,8 +417,10 @@ progress.style.display = "none"; docLink.style.display = ""; docLink.href = json.documentation_url; - self.disabled = false; + WinJS.Promise.wrap(); + }).done(function() { window.parent.setDisabledForOperation(false); + self.disabled = false; }); } catch (error) { // console.log("error", error); @@ -432,6 +432,13 @@ window.parent.setDisabledForOperation(false); } } else if (checkUpdateBtn.getAttribute("data-action") == "download") { + switch (external.System.processorArchitecture) { + case 5: + external.Process.open(newVersionUrl.href); + self.disabled = false; + window.parent.setDisabledForOperation(false); + return; + } var storage = Bridge.External.Storage; var path = storage.path; stopProcess = true;