Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to created a UWP app with a certificate that can be sideloaded

I am trying to create a UWP app that can be sideloaded onto other PCs. My main question is: Do I need a certificate from a trusted source to sign my application?

After a lot of poking around, I learned that you can sideload/install UWP applications through the application App Installer from the Windows Store. After installing the App Installer, one can install UWP apps by double clicking on the .appxbundle file. (Not using the .ps1 file, as indicated here)

Before doing this, I would need to trust the certificate. I've created this certificate through Visual Studio. It was created by double clicking the .appxmanifest going to Packaging, selecting Choose Certificate -> Configure Cerfiticate and then Create test certificate.

I tried to install my application on two different Windows 10 machines. On one machine, the application would fail by saying that the package might conflict with another package or depends on things that aren't installed (something that isn't true) and on the other machine it would give a certificate error (even though I trusted and added the certificate to my root trusted certificates).

Do I need a certificate released by a trusted authority to get this to work? I was under the impression that my certificate should work, as long as the user trusted it, but the app doesn't seem to install.

Also, if I do need a trusted certificate, how do I create this pfx file? And where do I get it from? The Microsoft documentation doesn't seem to mention anything.

like image 971
SaiyanGirl Avatar asked Mar 24 '17 23:03

SaiyanGirl


People also ask

What is UWP certificate?

This article discusses the use of certificates in Universal Windows Platform (UWP) apps. Digital certificates are used in public key cryptography to bind a public key to a person, computer, or organization. The bound identities are most often used to authenticate one entity to another.

What can be used to deploy UWP apps?

Microsoft Visual Studio allows you to deploy and debug your Universal Windows Platform (UWP) apps on a variety of Windows 10 devices.


2 Answers

It turns out that I didn't have the dependencies installed. I added the certificate to the Local Computer (not Current User) in the Trusted Root Authorities Section. After this I was still getting the error that the package depends on things that weren't installed. This turned out to actually be true! According to the App Installer page

The App Installer does not automatically install framework dependencies. In most cases your device already has the dependencies, but there are some developer or enterprise scenarios where you need an additional framework. In this case just browse to the dependency folder with your app and install the dependency framework just like any app, using the App Installer!

The Dependencies were all located in a folder called "Dependencies" that was created by Visual Studio. After installing those, the App installed successfully!

like image 56
SaiyanGirl Avatar answered Nov 03 '22 03:11

SaiyanGirl


Make sure you add the certificate to the Trusted People store (that's not a typo -- it is People). The other error can be caused if you don't have the right Framework Packages installed or if you previously installed the app and haven't changed the version number in the manifest.

like image 20
Peter Torr - MSFT Avatar answered Nov 03 '22 04:11

Peter Torr - MSFT