Forum Discussion
Provisioning support for .appinstaller?
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:
- Option 1 (Custom Installer):
- Create a PowerShell script, with the following cmdlets:
Add-AppxProvisionedPackage -SkipLicense -Online -PackagePath .\FileName.msixbundle Add-AppxPackage -AppInstallerFile .\FileName.appinstaller - 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.
- Create a PowerShell script, with the following cmdlets:
- Option 2 (Force Provisioning):
- 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) - 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.
- Create a PowerShell script leveraging this API, with the following cmdlets:
- Option 3 (Microsoft Store for Business):
- Create a Microsoft Developer account for your developers.
- Link their Developer Accounts to your Private Microsoft Store for Business (MSfB) instance.
- The Developers submit their new or updated apps to your organizations the MSfB instance.
- Link your organizations Intune or ConfigMgr to your instance of MSfB.
- 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:
- 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.
- 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.
- 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
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 -
- Option 1 -
fails installing the lower-version package with Add-AppxProvisionedPackage with a "file already exists" error
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 https://learn.microsoft.com/en-us/answers/questions/1359804/how-to-downgrade-a-provisioned-package-(with-add-a
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!
- Fiza_AzmiSep 14, 2023
Microsoft
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- kerenorSep 14, 2023Copper Contributor
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- Sep 15, 2023While 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.