From 843050a85f815f2acb774edc8686534a21a0fac0 Mon Sep 17 00:00:00 2001 From: Mike Allison Date: Mon, 28 Sep 2026 15:59:46 -0700 Subject: [PATCH] Strip the space the Store puts in front of the installer switches The first real submission got as far as updating the draft and was refused: the API returns installerParameters with a leading space, and counts it against a 40-character limit the three Inno switches meet exactly. Also corrects the wizard, which described the Store ID as twelve characters when an EXE app's is fourteen. Co-Authored-By: Claude Fable 5.1 --- changelog.d/store-submit-params.chore.md | 1 + scripts/store_api_wizard.sh | 2 +- scripts/store_submit.py | 9 ++++++++- tests/test_store_submit.py | 9 +++++++++ 4 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 changelog.d/store-submit-params.chore.md diff --git a/changelog.d/store-submit-params.chore.md b/changelog.d/store-submit-params.chore.md new file mode 100644 index 0000000..39b87dd --- /dev/null +++ b/changelog.d/store-submit-params.chore.md @@ -0,0 +1 @@ +The Store submission no longer fails on the installer switches the Store itself returned with a stray leading space. diff --git a/scripts/store_api_wizard.sh b/scripts/store_api_wizard.sh index 5988b3b..bf12ef0 100755 --- a/scripts/store_api_wizard.sh +++ b/scripts/store_api_wizard.sh @@ -281,7 +281,7 @@ pause stage "Partner Center — Cadent's product ID" open_url "$PARTNER_CENTER/apps-and-games/overview" step "Open Cadent > Product management > Product identity." -step "Copy the Store ID. For an EXE app it is twelve characters and starts" +step "Copy the Store ID. For an EXE app it is fourteen characters and starts" step " with XP." note "It is also the last path segment of the app's Store link," note "apps.microsoft.com/detail/." diff --git a/scripts/store_submit.py b/scripts/store_submit.py index 230b87b..f73aa10 100644 --- a/scripts/store_submit.py +++ b/scripts/store_submit.py @@ -284,7 +284,14 @@ def submit(client: StoreClient, url: str, *, force: bool = False, **poll) -> str return None print(f"Package URL: {package.get('packageUrl')} -> {url}") - client.call("PUT", f"{base}/packages", {"packages": [{**package, "packageUrl": url}]}) + updated = {**package, "packageUrl": url} + # The Store hands the switches back with a space in front that was never + # typed, then counts it against its own 40-character limit - which the + # three Inno switches meet exactly, so the draft it returned is one it + # refuses to take back. + if isinstance(updated.get("installerParameters"), str): + updated["installerParameters"] = updated["installerParameters"].strip() + client.call("PUT", f"{base}/packages", {"packages": [updated]}) client.call("POST", f"{base}/packages/commit") print("Waiting for the Store to fetch and scan the installer...", flush=True) diff --git a/tests/test_store_submit.py b/tests/test_store_submit.py index c515e05..f672830 100644 --- a/tests/test_store_submit.py +++ b/tests/test_store_submit.py @@ -122,6 +122,15 @@ def test_carries_the_rest_of_the_package_over_untouched(self): run(store) assert store.packages == [package(NEW_URL)] + def test_drops_the_space_the_store_puts_before_the_switches(self): + # What the API really returns, and one character over what it accepts. + padded = {**package(), "installerParameters": + " /VERYSILENT /SUPPRESSMSGBOXES /NORESTART"} + store = FakeStore(packages=[padded]) + run(store) + assert store.packages[0]["installerParameters"] == \ + "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART" + def test_sends_the_seller_id_and_token(self): store = FakeStore() run(store)