Search code examples
uwpcertificatewindows-10-universalsigningappx

Ways to Distribute and Install a Win10 Application


What are the ways to distribute and install an Win10 Appxpackage without using the Microsoft-Store?

I have a customer who wants me to create a "Exe-File" to let him distribute the app internally in his company.

So I made an Appxpackage withe the inbuilt tools of Visual Studio.

which contains:

  • Add-AppDevPackage.ps1
  • appname.appx
  • appname.cer

Problem: To install the app I had to run the .ps1 File in the PowerShell then install the certificate (.cer) to be able to install the Package. And I think that is to much for the Customer to "only" install the App.

I then Created a AppxPackage with "MakeAppX.exe" and signed it with SignTool.

But still the Certificate needs to be Installed first.

I also know that Microsoft has the Business Option that allows to Distribute the app to Chosen workers, but this is kinda not an Option for the customer...

So my questions are:

  • Is there another way to Distribute the App?
  • Is it possible to Automate the Process? (Script to install Certificate and then Appx)
  • Can I install the App without installing the certificate first?

Solution

  • Is there another way to Distribute the App?

    The end user can install the package by simply double clicking the appx/appxbundle file. This experience is much like installing an MSI/EXE. This invokes App Installer which is built in the system.

    It can also be hosted on an intranet website and installed from the web (I have tried this approach before but I didn't succeed maybe because the device I tried didn't get the latest update.)

    Is it possible to Automate the Process?

    Installing appx actually boils down to two PowerShell commands,

    Import-Module Appx;
    Add-AppxPackage appname.appx;
    

    You can call PowerShell commands from C#, instead of running the .ps1 file. so the end user won't see the scary PowerShell CLI.

    Note: You need to install the dependencies before installing appname.appx, which are also appx package, and located in the subfolders. So write the program to call Add-AppxPackage for each appx, first the dependencies, then the app.

    Can I install the App without installing the certificate first?

    No. And this is the hard part.

    In order to install your app, the end user must install the app's certificate to express that they trust you - only apps from trusted source can be installed. And this process needs user's explicit consent, I don't think you can silently install a certificate using a script or something.

    In a corporation environment, devices may have already some certificates installed. If your app is signed with the one of these certificate, then your app is considered to be from trusted source, and you can skip the step of installing the certificate altogether. But I think it is unrealistic to ask your customer to provide such a certificate for code signing since it is a severe breach to the information security of his organization.