How to Create a MSIX/APPX Package
This article discusses how to create a package to distribute a MSIX (new Windows Installer) or APPX (Universal Windows Platform app) file.
A video is included at the end of this article, on how to Use Tanium to Deploy MSIX and APPX Packages.
First, you need to make sure you have your signed and trusted MSIX or APPX file. For more information on these file formats, please refer to this article about the Packaging Process.
Next, you will need to create a Deploy package. In this scenario, I will be packaging an app called "FakeApp" from TestApp. Any resemblance to living and release software is purely coincidental.
To learn how to create a package, please refer to this Community post on how to do this.
Process
Package Files
-
You will need to upload your MSIX or APPX file to the Tanium Package.
General Information
-
This information can be what you like, according to the program you're installing.
-
Keep in mind that the description and Self-Service Display Name is seen by end users in Self Service.
Deploy Operations
-
I don't have a previous version to update, so I will just use Install and Remove in my example.
System Requirements
-
This app does not take hardly any space to install or memory to run, so I left the disk space and RAM requirements at 0.
-
The app is compiled for 64-bit, so I want to insure that is selected.
-
The app supports Windows 10 only.
-
For your deployments, make sure you understand the system requirements and minimum operating system it will run on.
Requirements
-
This application runs in Windows 10 1709 and later, so for this I added a WMI query to insure the Windows build number was equal to or greater than 16299 (Windows 10 1709).
Deploy Operation
-
Install
-
Display Name is what you want it to be, the Command Timeout is dependant on how long the app will take to install. Be generous, if it takes 5 minutes, give it 10-15 to be safe.
-
We will be running as the Active User, even though the app installs into C:\Program Files. This is how Microsoft provisions these apps.
-
The command line in this case is:
powershell.exe -ExecutionPolicy Bypass -command "& {&'add-appxpackage' -Path .\FakeApp_1.0.4.msix}" -
The syntax can be a bit difficult to run a single cmdlet. Use caution in testing.
-
Note that the .\ is the relative path to the downloaded file from Deploy.
-
Remove
-
The same rules apply for the Display Name and Command Timeout
-
We are again running as Active User
-
This is my removal command:
powershell.exe -ExecutionPolicy Bypass -command "& {&'get-appxpackage' | ? {$_.Name -like "*FakeApp*"} | Remove-AppXPackage}" -
Again, be careful of the syntax of your command line.
Install Verification
-
This can be a bit difficult to do, but one way to verify the app is installed is to look for the file path existing.
-
The app will install into
%ProgramFiles%\WindowsApps\and then a naming convention like this:-AppName_AppVersion_Architecture__Hash -
From there, the app installs into a Virtual File System, where you will find the executable as per the example below. Always install your app manually first and understand how it installs and where. This will make detecting the installation much easier and lessen your testing time.
Once you're ready, click Update Package** **and you will be ready to deploy your MSIX/APPX package.
Quick Troubleshooting Notes
Three of the most common problems I have seen with these deployments are within code signing and install verification. The deploy.log on the endpoint will be your guide for this.
-
If your file is not properly signed, you will see an error like this in the deploy.log:
Add-AppxPackage : Deployment failed with HRESULT: 0x800B010A, A certificate chain could not be built to a trusted root" -
If your install verification isn't properly detecting the file, you will see an error like this in the deploy.log:
"applicability does not match operation outcome" -
Assuming the application installed properly, check the Install Verification and make sure that it aligns with the installed application.
-
The command doesn't execute properly. Again, this syntax can be a bit tricky, follow the examples above in the Install and Remove Operations.
Video: Use Tanium to Deploy MSIX and APPX Packages