feat: keep version check in MSIX build, point update dialog at the Store

The update check is notification-only (OrcaSlicer never auto-downloads),
so the Store build keeps checking for new versions instead of skipping
the check. What changes when packaged is the new-version dialog: the
Download button is hidden, the info text asks the user to update from
the Microsoft Store, and the hyperlink / wxID_YES action opens the Store
product page instead of the GitHub release page.
This commit is contained in:
SoftFever
2026-06-11 12:50:44 +08:00
parent 42b7bcaf0d
commit e1e6851a27
4 changed files with 32 additions and 20 deletions

View File

@@ -113,17 +113,21 @@ variables are absent (forks).
packaged, `APPMODEL_ERROR_NO_PACKAGE` ⇒ not); constant `false` on
non-Windows.
**Updater suppression (R4)** — Store apps must not self-update:
**Updater redirection (R4)** — Store apps must not self-update, but
OrcaSlicer's version check is notification-only (it never
auto-downloads), so the check itself stays enabled when packaged:
- Skip the startup auto-check (`check_new_version_sf()` call at
`GUI_App.cpp:934`) when packaged.
- The manual "Check for updates" menu action (`MainFrame.cpp:2580`)
opens the Store listing via `ms-windows-store://pdp/?PFN=<family>`,
where the package family name comes from
`GetCurrentPackageFamilyName` at runtime — no build-time ProductId
define or extra repo variable needed, and it works identically in
pre- and post-reservation builds. It never falls back to the classic
download flow.
- The startup auto-check (`check_new_version_sf()`) and the manual
"Check for updates" menu action run unchanged.
- The new-version dialog (`UpdateVersionDialog`) changes when packaged:
the Download button is hidden, the info text tells the user to update
OrcaSlicer from the Microsoft Store, and the "Check on Github"
hyperlink becomes "Open Microsoft Store", which opens the Store
listing via `ms-windows-store://pdp/?PFN=<family>`. The package
family name comes from `GetCurrentPackageFamilyName` at runtime — no
build-time ProductId define or extra repo variable needed, and it
works identically in pre- and post-reservation builds. The packaged
build never opens the GitHub release page.
**Association suppression (R3)** — the manifest owns shell integration;
runtime registry writes are virtualized and invisible:

View File

@@ -931,9 +931,7 @@ void GUI_App::post_init()
this->preset_updater->sync(http_url, language, network_ver, sys_preset ? preset_bundle : nullptr);
}
// Store builds update through the Microsoft Store, never self-update.
if (!is_running_in_msix())
this->check_new_version_sf();
this->check_new_version_sf();
const auto cloud_provider = get_printer_cloud_provider();
if (is_user_login(cloud_provider) && !app_config->get_stealth_mode()) {
// this->check_privacy_version(0);
@@ -2861,7 +2859,11 @@ bool GUI_App::on_init_inner()
switch (dialog.ShowModal())
{
case wxID_YES:
wxLaunchDefaultBrowser(version_info.url);
// Store builds get updates from the Microsoft Store, not the GitHub release page.
if (is_running_in_msix())
open_ms_store_product_page();
else
wxLaunchDefaultBrowser(version_info.url);
break;
case wxID_NO:
break;

View File

@@ -2577,10 +2577,7 @@ static wxMenu* generate_help_menu()
// Check New Version
append_menu_item(helpMenu, wxID_ANY, _L("Check for Updates"), _L("Check for Updates"),
[](wxCommandEvent&) {
if (is_running_in_msix())
open_ms_store_product_page();
else
wxGetApp().check_new_version_sf(true, 1);
wxGetApp().check_new_version_sf(true, 1);
}, "", nullptr, []() {
return true;
});

View File

@@ -5,6 +5,7 @@
#include "libslic3r/Thread.hpp"
#include "GUI.hpp"
#include "GUI_App.hpp"
#include "GUI_Utils.hpp"
#include "GUI_Preview.hpp"
#include "MainFrame.hpp"
#include "format.hpp"
@@ -252,7 +253,9 @@ UpdateVersionDialog::UpdateVersionDialog(wxWindow *parent)
m_text_up_info = new Label(this, Label::Head_14, wxEmptyString, LB_AUTO_WRAP);
m_text_up_info->SetForegroundColour(wxColour(0x26, 0x2E, 0x30));
auto github_link = new HyperLink(this, _L("Check on Github"), "", LB_AUTO_WRAP);
// Store builds get updates from the Microsoft Store: wxID_YES opens the Store
// product page there (see the EVT_SLIC3R_VERSION_ONLINE handler) instead of GitHub.
auto github_link = new HyperLink(this, is_running_in_msix() ? _L("Open Microsoft Store") : _L("Check on Github"), "", LB_AUTO_WRAP);
github_link->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
EndModal(wxID_YES);
});
@@ -309,6 +312,9 @@ UpdateVersionDialog::UpdateVersionDialog(wxWindow *parent)
EndModal(wxID_YES);
});
if (is_running_in_msix())
m_button_download->Hide();
m_button_skip_version = new Button(this, _L("Skip this Version"));
m_button_skip_version->SetStyle(ButtonStyle::Regular, ButtonType::Choice);
@@ -479,7 +485,10 @@ void UpdateVersionDialog::update_version_info(wxString release_note, wxString ve
// else {
//m_simplebook_release_note->SetMaxSize(wxSize(FromDIP(560), FromDIP(430)));
m_simplebook_release_note->SetSelection(1);
m_text_up_info->SetLabel(wxString::Format(_L("Click to download new version in default browser: %s"), version));
if (is_running_in_msix())
m_text_up_info->SetLabel(wxString::Format(_L("New version available: %s. Please update OrcaSlicer from the Microsoft Store."), version));
else
m_text_up_info->SetLabel(wxString::Format(_L("Click to download new version in default browser: %s"), version));
auto data_buf_in = release_note.utf8_str();
auto bg_color = StateColor::darkModeColorFor(wxColour("#FFFFFF")).GetAsString();
auto fg_color = StateColor::darkModeColorFor(wxColour("#262E30")).GetAsString();