Microsoft Store In-App Purchases (Add-ons) purchase dialog not triggering in PyInstaller packaged Windows App

Ali Hassan 0 Reputation points
2026-09-13T09:43:08.75+00:00

Hello,

I am facing an issue with triggering Microsoft Store In-App Purchase (Add-on) dialogs in my desktop application written in Python (packaged into executable / installer package).

Setup Details:

Language/Framework: Python

Packaging Method: PyInstaller(.exe) / Installer

Integration: Microsoft Store WinRT APIs (Windows.Services.Store.StoreContext)

App Status: Published / Uploaded on Microsoft Partner Center with configured Add-ons/IAPs.

Issue Description:

When the app is installed directly via the Microsoft Store, calling the Store API (RequestPurchaseAsync/ StoreContext) to trigger an In-App Purchase fails silently or does not execute:

  1. The Microsoft Store payment UI/dialog modal does not pop up when triggered.
  2. The Store API calls return errors or fail to initialize the payment workflow for configured Add-on IDs/Store IDs.

Troubleshooting Already Attempted:

  1. Verified that the Add-ons (In-App Products) are published and active in Microsoft Partner Center.
  2. Verified that the Store Identity in the AppxManifest / MSIX package matches the Partner Center app identity.
  3. Verified that the account logged into the Windows PC / Microsoft Store has access to the app.

Request:

Could you please help clarify:

  1. Are there specific dependencies, WinRT interop wrappers, or window handle IInitializeWithWindow requirements when calling StoreContextfrom a standalone Win32 / Python-based process?
  2. How can we properly debug Windows.Services.Store API responses in a production build installed via the Microsoft Store?

Any advice or code examples for handling Windows.Services.Store in Python / Win32 apps would be greatly appreciated!

Windows development | Windows App SDK
0 comments No comments

1 answer

Sort by: Oldest
  1. Mohammad Wasi Haider 165 Reputation points
    2026-09-14T11:15:02.67+00:00

    Hi Ali,

    Yes, for a desktop Win32 app using Windows.Services.Store, Microsoft requires the StoreContext object to be associated with your app’s window before calling methods that display Store UI. This is done through IInitializeWithWindow and the HWND of your main window. If that association is missing, RequestPurchaseAsync can fail with an invalid window handle error or the purchase UI may not appear.

    Also make sure RequestPurchaseAsync is called on the UI thread and that the application is not running elevated, because Microsoft Store in-app purchasing is not supported for elevated applications.

    For debugging, inspect the StorePurchaseResult returned from RequestPurchaseAsync, including its Status and ExtendedError properties, and also check the StoreProductQueryResult errors when retrieving the add-on. I would first confirm that your Python WinRT wrapper exposes the COM interface needed for IInitializeWithWindow and that PyInstaller is not changing the window/process context.

    Thank you, and feel free to respond back for more assistance.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.