MSIX - PackageName vs Application ID

Written by Alex Marin · April 17th, 2019

The Deceiving Resemblance

If we check the official Microsoft documentation about PackageName and appID, we can see that in theory, there aren’t so many differences between them.

As the docs mention, the Package name can be a string between 3 and 50 characters in length that consists of alpha-numeric, period (.), and dash characters(-).

ImportantThe Package name is not the same as the Display Name that appears in Add/Remove programs.

The application ID is a unique identifier for an application inside of the package. You can have more than one application in a package.

The Application ID is an ASCII string between 1 and 64 characters in length according to Microsoft.

We can see that it’s a little bit different. The AppID contains ONLY ALPHA-NUMERIC characters. However, we have noticed that you can still use a period (.) when you create an AppID. You cannot use dash characters (-).

To get an Application ID you can use the Powershell command

(Get-AppxPackage "PACKAGENAME" | Get-AppxPackageManifest).package.applications.application.id

For example, we can see that the Package Name for iTunes is AppleInc.iTunes, and it contains tree applications (each with it own unique appID):

  1. iTunes - that also appears in the start menu
  2. AppleInc.Defaults - hidden
  3. AppleInc.MDCrashReporter - hidden

Why Does It Matter?

Think of it as a regular MSI. You have a package name, but that package contains multiple shortcuts. If you want to run the main executable from the command line, of course, you don’t call the MSI, right?

The same goes for AppId’s. Microsoft offers a Powershell cmdlet that lets you run an executable inside the container of an application, based on the AppID and its PackageFamilyName.

If we look at the example above with iTunes, we can see that we can invoke a command like:

Invoke-CommandInDesktopPackage -AppId "iTunes" -PackageFamilyName "AppleInc.iTunes_nzyj5cx40ttqa" -Command "regedit.exe"
      

This opens up Regedit for us from the iTunes container. Unlike APP-V, with MSIX you cannot see the registry from outside the container.

You can also just simply open up an .exe from your package according to Microsoft with the example:

Invoke-CommandInDesktopPackage -AppId "AppPackage1" -PackageFamilyName "29270sandstorm.AppPackage1_gah1vdar1nn7a" -Command "demo.exe"

The command invokes demo.exe that can be found in '29270sandstorm.AppPackage1_gah1vdar1nn7a' app package under the 'AppPackage1' Application element.

Comments: