Distribute UWP apps outside Microsoft Store

11/4/2019

Distribute UWP apps outside Microsoft Store

Microsoft Store is the worst app store.  There are also other reasons for distributing UWP apps outside Microsoft Store.

The steps to do it:

  1. Obtain a code signing certificate.
  2. Follow the instructions from the certificate authority (CA) to get the certificate file.  It may have extension .p12.  Make a copy of this file and change the extension to .pfx that is used by Visual Studio.
  3. For cross-platform projects, the UWP project's Assets folder must have the logo images (it is usually sufficient if the shared folder has them). 
  4. Right-click UWP app in VS Solution Explorer> Publish > Create App Packages... > Select "Sideloading" and "Enable automatic updates"> Remove the default certification > Select From File... > Select the certificate .pfx file > Next >  Generate app bundle: Always, select release versions of x86, x64, ARM for Architecture > Select every "1" Weeks. A VS bug does not allow the update checking interval greater than 1 week.  >  Create. 
  5. Modify index.html by by removing 'ms-appinstaller:?source=' to deal with a Microsoft bug (e.g., change <a href='ms-appinstaller:?source=https://www.mydomain.com/download/myapp.appinstaller'> to <a href='https://www.mydomain.com/download/myapp.appinstaller'>).
  6. Copy a. folder My_APP_x.x.x.x_Test, b. index.html, c. My_APP.appinstaller to a directory of a web project (e.g. corresponding to URL: www.mydomain.com/download.myapp.
  7. Add a web.config file to the same folder for IIS with meme type contents for UWP app distribution.

 

It is a significant nuisance to switch the project back to the Microsoft Store version:

1. Right-click the project name > Publish > Associate App with the store...

2. Right-click the project name > Properties > Package Manifest... > Packaging > Choose Certificate > Select from file... >Select the one created automatically for the app (e.g. MY_APP.UWP_TemporaryKey.pfx)

 

To renew the code signing certificate:

  1. Order renewal.
  2. Download DeigiCertUtil
  3. Click "Create CSR" and import the attributes from the certificate to be renewed.
  4. Make sure to choose 4096 bit to avoid the error "Code Signing: ErroCode:-13 ErrorMessage: Error during placing order"
  5. Generate.
  6. Copy CSR and/or save it to a file.
  7. Go to the order list of the account on the certificate vendor's website.
  8. Click GENERATE NOW for the renewal order.
  9. Paste CSR to the form and fill out other fields.
  10. Submit
  11. Click Validation Manager in the received email to upload the driver's license and portrait with the license held near the face, and company documents (e.g., state annual reports).
  12. An email will arrive after the documents are accepted. Click the link to initiate a callback to verify the phone. An automatic phone call will take place to inform a pin number that should be entered on the callback page.
  13. Certificate is issued.
  14. Follow the instructions to install and export the certificate.