Chapter 13. Publishing in Windows Store

Finally, our project has reached a point where it can be shown as a standalone demo, in Microsoft Store for example.

I didn't expect it to be easy, and it sure wasn't.

I can't say that Microsoft's instructions I have used were "wrong" or "inaccurate", but sometimes they were SO complicated, not sequential and confusing (to me at least), that it led me in completely wrong directions at almost every step, such as building an MSI package, for example, when games in the Windows Store require MSIX (totally different procedure), and so on.

Here's my attempt to describe the process in a simpler, more straightforward, step-by-step way:


First thing we'll need for publishing is a Windows app developer account in a Microsoft Partner Center.

Step 1 - Developer account

  • Navigate to Partner Center Dashboard.
  • If not signed in automatically, then sign in with your usual Microsoft account.
  • if "Apps and games" not there, then Workspaces -> My access + -> Enroll in programs -> Windows Get started -> Login with personal account.
  • Programs -> Windows. Register as an app developer. For the beginning, an individual account seems good enough. Unexpectedly, it isn't free, for individuals - $19.00
  • After registration - Go to dashboard

Step 2 - Reserve your app's name

  • From dashboard, obviously, proceed to Apps and games.
  • + New product -> Game
  • Name it and Reserve product name

Important: At this point Microsoft will assign you a publisher name, starts from CN=... ("CN" stands for "common name"), located in your product name details page.


Now we need to wrap our app in a distributable format, MSIX (Windows app package format) in this case. MSIX, in it's turn, besides the app itself, will also require the app's version and app icon. So:

Step 3 - Prepare the app. App version. Name.

  • Right-click on your Project -> Properties -> Linker -> General.
  • Set Version property (I set mine to 1.0).
  • Also make sure that Configuration Properties -> General -> Target Name is set up correctly and complies with your reserved name (.exe name that will be exposed to user), in my case - TraiNscale.
  • Configuration - Release.
  • Build and run.

Step 4 - App icon

Skipping all the theory and instructions, here's a spoiler: the MSIX package builder will ask for a 400x400 PNG (512x512 will work too) and then for 620x300 PNG.

This is what I "drew":

To convert it to .ICO format you could use icoconverter.com. But it's not necessary here, since eventually MSIX package builder will generate ICO files by himself from source PNG file.


Now we are ready for

Step 5 - MSIX Installer

To see the Windows Application Packaging Project template in the 'Add New Project' menu, we need to install 'Universal Windows Platform development' workload in our Visual Studio.

  • Click the Windows button to open the "start" menu of your windows, and search for "Visual Studio Installer".
  • Start it. On the right of your Visual Studio pick Modify.
  • Checkmark 'Windows application development'.
  • Also pick optional C++ tools (on the right).
  • Modify. Install. Reload (if prompted).

Now - the Packaging Project itself.

Step 6 - Windows Application Packaging Project

  • Open your project in Visual Studio.
  • Right-click on your solution -> Add -> New project,
  • Search for "packaging",
  • Pick 'Windows Application Packaging Project' C++. Next.
  • Name it. The name will be exposed to customer, so call it accordingly. I called mine "TraiNscale-wnd-install".
  • Target and minimum platform versions look reasonable, so - Ok.
  • Set this Packaging Project as the startup project (right-click on the project, and Set as StartUp Project).
  • Set up Dependencies. Click on Packaging project to expand it's content.
  • Right-click on Dependencies and pick Add Project Reference.
  • Checkmark your desktop project. Ok.
  • Expand Dependencies -> Applications node, then right-click on your application and Set As Entry Point.
  • Right-click on Packaging project -> Build to make sure nothing is broken yet. *In case of errors, open Configuration Manager and ensure that your projects target the same platform.

Step 7 - Configure a package with the manifest designer

  • In Solution Explorer, expand the project node of your packaging project.
  • Double-click the Package.appxmanifest file to see the manifest designer.
  • Make sure that display name is correct. It should match your reserved name in a Partner Center.
  • From the Packaging tab, you can enter package display name and publisher display name.

Signing Certificate:

  • Open  Packaging tab, click Choose certificate. In my case it was easier to Create.
  • Publisher Common Name: use name assigned you by MS Partner Center (mentioned in Step 2, the one starting from CN=...).
  • No password needed. Ok, Ok.
  • It will create a .pfx file, which we will need again later.

App icons

  • Open the Visual Assets tab, pick App Icon (on the left), Name: Square44x44Logo. Source: navigate to your 400x400 (or 512x512) PNG, Generate.
  • Later builder will complain about missing StoreLogo (to display in Microsoft store). So, add it. Change name to StoreLogo, use same 400x400 (or 512x512) PNG, Generate.
  • Now builder will complain about missing SplashScreen and Wide310x150Logo. Add them too:
  • Change name to SplashScreen, same 400x400 (or 512x512) PNG, Generate.
  • Change name to Wide310x150Logo, navigate to 620x300 PNG, Generate.
  • Later builder will complain about wrong sizes for SplashLogo.scale-100 and so on. These .scale-..00 files are optional, so you can safely delete them from Images folder (on the right).
  • Save your Package.appxmanifest file after all these changes.

Step 8 - Create an app package using the packaging wizard

  • Right-click the packaging project -> Build.
  • Again, right-click the packaging project and choose Publish->Create App Packages.
  • Select Microsoft Store under a new app nameNext.
  • If can't connect, it might not be your fault, sometimes it happens, in my case it didn't work for a week...
  • When connected, pick your previously reserved name. Next.
  • Select and configure packages: Since I'm interested in x64 only, I unchecked x86 and picked Generate app bundle - Never. Create.
  • After spending some time on fixing icons issues (mentioned in Step 7) and re-publishing, finally package was successfully created.
  • Launch Window App Certification Kit - PASSED.

MSIX package is ready (no errors), so let's try to run it! Find generated MSIX file, copy it in a separate folder (just in case) and double-click it.

Location: C:/..../AppPackages/...._1.0.0.0_x64_Test/....msix

In case of “Publisher Could Not Be Verified” (which is expected) the best solution is to extract certificate from MSIX file itself and install it on your comp manually.

A very handy detailed instruction by Arjun Sha - here.

Now installation starts and even starts the app, but app crashes, because /dt data folder is not there.

Visual Studio didn't recognize /dt data folder as a part of the Project output and therefore didn't include it in the package.

I failed to find how to include it to the package in Visual Studio. Maybe in Packaging project -> right-click -> Edit Project File in <Content Include=.../> tags ? If someone knows, please tell me!


Step 9 - Adding data files to the package

The /dt data folder is a critical part of my application. Since I couldn't find a way to include it in the package in Visual Studio, I will use an additional external tool.

  • Download Microsoft's MSIX Packaging Tool from the Microsoft Store (it's a separate free app).
  • Install. Start. Open your MSIX file.
  • Open Package editor.
  • Browse to your MSIX package -> Open package.
  • Select (on the left) Package files view.
  • Find your .exe file.
  • Right-click on containing folder (in my case pw) -> Add Folder to create a new association.
  • Browse to your data folder (..x64/Release/dt in my case), Ok, Save.
  • The updated package needs to be re-signed. Go to Package information (on the left).
  • Select an Option -> Sign in with a certificate (.pfx).
  • Browse to your VS packaging project root folder and pick .pfx file (the one we created in Step 7).
  • On the same screen check and fix Package display name (should match your reserved name) and Package Description fields.
  • Save updated package, Do not increment.
  • Save as: Browse to and select your source MSIX file (the one you just edited), Save, Overwrite.
  • Close the tool.

Testing:

  • Just in case, uninstall previously installed version (the one without data files).
  • Try to run updated MSIX package.
  • Again, if “Publisher Could Not Be Verified”, the fix - in Step 8 above.
  • Run again - works!!

Step 10 - Package Upload

  • Return to Microsoft Partner Center ->Apps and games,
  • Open your previously reserved name.
  • Fill out Pricing, Properties and Age ratings pages.
  • In the Pricing section create at least 1 market. I created one with all countries included.
  • Then move to Packages.
  • Checkmark Windows 10/11
  • Upload your msix to a gray box.
  • Select a certificate - select from the list (the last one I guess), Ok.

Now - waiting for "Package acceptance validation"...

1 day later: Checked my page in Partner Center. Packages status now "validated" and "Complete".

Now we can move on to the next section:


Step 11 - Submitting the Package

Assuming that we are on our product page already:

  • Proceed to Store listing.
  • At this point the only supported language I had listed was English (United States), and Status was "incomplete".
  • So, expand it. Add description and screenshots. Save.
  • Will take care of other languages later (maybe).
  • I decided to skip Xbox Program so far.
  • Proceed to Submission Options.
  • I picked "Publish this submission as soon as it passes certification".
  • Added a few words for testers.
  • A bit confusing text-box regarding runFullTrust and restricted capabilities. I said I don't know of any. Didn't find runFullTrust option either.
  • Save.
  • And finally, we can proceed to Submit for certification.

Submitted. Now - "Waiting to be released"...

Just 1 day later: It's in Windows Store now !!


Leave a Reply

Your email address will not be published. Required fields are marked *