Provisioning support for .appinstaller?

Copper Contributor

We are in an enterprise environment and would like to use the .appinstaller file to install a UWP app provisioned for all users to keep our in-house app up to date.

The reason we need the app provisioned for all users is the need to be on shared devices.

  1. Is provisioning an MSIXBUNDLE through .appinstaller possible?

  2. If so, how would you run the command line through SCCM to do the initial install so that it can poll the correct location?

  3. If not, can the package installed directly via MSIXBUNDLE through SCCM with code in the app performed to activate the appinstaller API? Is there an example of this somewhere that I am missing?

Thank you in advance for your time

7 Replies

Hi @tjmullen2,


If I understand your request correctly, you wish to provision an app for all users, and make use of an auto-update feature, to prevent the need for re-deploying the application to client devices. If this is your desire, then the following options should be considered:

  1. Option 1 (Custom Installer):
    1. Create a PowerShell script, with the following cmdlets:
      Add-AppxProvisionedPackage -SkipLicense -Online -PackagePath .\FileName.msixbundle
      Add-AppxPackage -AppInstallerFile .\FileName.appinstaller​
    2. Create a new application in Microsoft Endpoint Configuration Manager (ConfigMgr) with the "Scripted Installer" deployment type. Use the previously created script to install the app.

  2. Option 2 (Force Provisioning):
    1. Create a PowerShell script leveraging this API, with the following cmdlets:
      ## Sets the Variable values 
      $AppInstallerLocation = "C:\Users\MSIX\Desktop\AppInstallers\HeadTraxPkg_x64.appinstaller" 
      [xml]$AppInstallerContent = [xml]$(Get-Content $AppInstallerLocation)
      
      ## Installs the AppxPackage
      Add-AppxPackage -AppInstallerFile $AppInstallerLocation
      
      ## Forces the App to be Provisioned
      $PackageFamilyName = $(Get-AppxPackage -Name $($AppInstallerContent.AppInstaller.MainPackage.Name) -Publisher $($AppInstallerContent.AppInstaller.MainPackage.Publisher)).PackageFamilyName
      $PackageManager = new-object windows.management.deployment.packagemanager
      
      $PackageManager.ProvisionPackageForAllUsersAsync($PackageFamilyName)​

       

       

    2. Create a new application in Microsoft Endpoint Configuration Manager (ConfigMgr) with the "Scripted Installer" deployment type. Use the previously created script to install the app.

  3. Option 3 (Microsoft Store for Business):
    1. Create a Microsoft Developer account for your developers.
    2. Link their Developer Accounts to your Private Microsoft Store for Business (MSfB) instance.
    3. The Developers submit their new or updated apps to your organizations the MSfB instance.
    4. Link your organizations Intune or ConfigMgr to your instance of MSfB.
    5. Retrieve an online / offline version of your app for delivery to client devices, then push the install to client devices.

Option 3 will allow you to create a private instance of your business app for distribution only to users within your enterprise environment. Devices will connect into the store on a set frequency and will retrieve any new updates. This solution does not require the device to be within your network to receive updates. ConfigMgr inventory reports will allow for software version validation.

 

Answers to your question in-order:

  1. Currently, the Add-AppxProvisionedPackage does not support the provisioning of apps using a *.appinstaller file. Fortunately the *.appinstaller file does support the installation of *.msixbundle installers.
  2. Installing an *.appinstaller file type can be performed by running the following PowerShell cmdlet: Add-AppxPackage -AppInstaller FileName.appinstaller. This install string can be delivered through using the Microsoft Endpoint Configuration Manager (ConfigMgr) by creating an application with the "Scripted Installer" deployment type.
  3. ConfigMgr does support the installation of *.msixbundle installers, by creating an Application with either the "Scripted Installer" or "Windows App Package" deployment types. The second option doesn't require an install string as it'll automatically be applied. I am unaware of any way to then activate the appinstaller API.

 

I hope that you found this information useful.

 

Thank you,

Roy

@Roy_MacLachlan 

Thank you for your reply on this topic - I encountered a similar issue requiring provisioning support for appinstaller, in order to be able to downgrade a provisioned package.

I tried using options 1 & 2 - 

  1. Option 1

    fails installing the lower-version package with Add-AppxProvisionedPackage with a "file already exists" error

  2.  

    Option 2
    fails installing the lower-version package with Add-AppxPackage, with the following error
    "Add-AppxPackage : Deployment failed with HRESULT: 0x80070005, Access is denied."

It is described more fully in this question

So my question is - how can I install a lower version of a provisioned msix package, without uninstalling the existing one, from command line?

Thank you!

 

@kerenor 
To make Option 2 work, try running PowerShell in elevated mode i.e. Run as Administrator before running the command: 

Add-AppxPackage -AppInstaller FileName.appinstaller -Path 

-Fiza
PM, MSIX Team

 

@fizaazmi 

Thanks
This was done in elevated mode. It also successfully installed a package of a higher version - just the lower version failed. Meaning (in some pseudo-code for clarity, I hope):

 

 

Add-AppxPackage -AppInstallerFile version_1.0.0.0.appinstaller # Works fine
$PackageManager.ProvisionPackageForAllUsersAsync($PackageFamilyName) # Works fine​

# Upgrade
Add-AppxPackage -AppInstallerFile version_1.0.5.0.appinstaller # Works fine
$PackageManager.ProvisionPackageForAllUsersAsync($PackageFamilyName) # Works fine​

# Downgrade
Add-AppxPackage -AppInstallerFile version_1.0.3.0.appinstaller # Fails as described

 

While there is an option to replace a package with a lower version, I don't believe you can do so with a provisioned package (Version 1). But you could use a powershell script to look for any version of the app other than the one you now want, remove it if installed, then provision the version you need.

@TIMOTHY MANGAN 

Thank you for your response.

I see you've mentioned it's likely not possible with a provisioned package version 1 - not sure what the versioning here means? and whether it's possible to use a different version?

Thanks

 

I was referring to Option 1 of Roy's response.