How to implement the download of free DLC without using UI thread

Rhuan Inocêncio 0 Reputation points
2025-01-28T11:17:00.8+00:00

Hi, In a store app, is it possible to implemente do download of DLC without the need of the UI thread? I ve tried with storecontext but seems not possible. Also, is it possible to start the download of free DLC without the action of purchasing it? In my tests, I seem to be unable to download the DlC using the DownloadAndInstallStorePaxkagesAsynx() if I don’t “buy” it before, using the RequestPurchaseAsync()

Windows development | Internet Information Services
Developer technologies | Universal Windows Platform (UWP)
Windows for business | Windows Client for IT Pros | User experience | Other
{count} votes

2 answers

Sort by: Most helpful
  1. Rhuan Inocêncio 0 Reputation points
    2025-03-02T05:52:50.6266667+00:00

    Hi, so the problem is the following: We found a way to solve the problem: using the getFreeEntitlement() from appinstallmanager. But now, when we try to use the method StartProductInstallAsync(productid) it don’t work in release, only when debugging through visual studio. When we run the method from an msix, we get an out of index error. ( Just to remember, the methods are running through a service, not from an application)

    0 comments No comments

  2. Harry Vo (WICLOUD CORPORATION) 1,725 Reputation points Microsoft External Staff
    2025-09-01T03:42:43.6533333+00:00

    Hi @Rhuan Inocêncio , thank you for reaching out on Microsoft Q&A!

    is it possible to implemente do download of DLC without the need of the UI thread?

    Most methods in StoreContext class are UI‑thread only and expect an owner window (desktop apps must call InitializeWithWindow). They’re designed to present Store UI and user consent. Running them from a background service (no UI) is unsupported.

    Also, is it possible to start the download of free DLC without the action of purchasing it?

    No. Even free add‑ons require a license (entitlement) first; the supported path is to “purchase” (at $0) via RequestPurchaseAsync and then install.

    when we try to use the method StartProductInstallAsync(productid) it don’t work in release.

    Those calls live on Windows.ApplicationModel.Store.Preview.InstallControl.AppInstallManager. That surface is restricted/private; documentation and repo notes indicate access is gated, and parts of the reference even require authorization to view. It may appear to work under the debugger but fails in production MSIX because the app lacks the required capability and/or is running from a service. The “index out of range” symptom commonly happens when StartProductInstallAsync returns no items (request rejected), but the code still indexes the result.


    Here are some recommend workaround:

    • Foreground UI flow (recommended for most apps): From your packaged foreground app, call RequestPurchaseAsync(addOnStoreId) to acquire the free license, then RequestDownloadAndInstallStorePackagesAsync([...]) to install. Both must run on the UI thread (and desktop apps should InitializeWithWindow). Avoid invoking from a Windows service.
    • Silent installs: Only if Microsoft grants your account the restricted capability for Store package management, or you receive Partner Center permission for programmatic optional‑package installs.

    I hope this helps you get things back on track quickly! If my suggestions can solve your issue, feel free to interact with the system accordingly!

    Thank you!


Your answer

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