0

I've developed a LOB App and want to provision the package for it on a Windows 10 PC. I want use the DISM Cmdlet:

Add-AppxProvisionedPackage -Online -PackagePath ..\cordova-appx\my.appx -SkipLicense

but this cmdlet works only for the new Users, not for the existing users. Moreover, if my application version changes (forcing a new package to be deloyed), the provision doesn't update for active the users of the PC.

What's the solution? How do you do this properly?

Thanks for your help.

lg0173
  • 208
  • 2
  • 8
  • 20
  • Did you mean re-run this install will not update the app? – Sunteen Wu Sep 21 '16 at 01:46
  • If I update my appx under my repertory, is my application will update for all users (who already have) ? – lg0173 Sep 21 '16 at 08:08
  • What's kind of your appx, did you side load it to all users or current user? If all users, it may update for all. – Sunteen Wu Sep 21 '16 at 08:23
  • I have a windows 10 tablet with a users. User1 connect with his login, he is administrator and I have a install exe which launch the next command "powershell.exe Add-AppxPackage -Path '$TEMP\${PRODUCT_APPX_FILE}' -DependencyPath '$TEMP\Microsoft.WinJS.2.0.appx'" but this application is only available for this user – lg0173 Sep 21 '16 at 08:38
  • try Add-AppxPackage and not the Provisioned command – magicandre1981 Sep 21 '16 at 14:47
  • yes it works but only one one user the user connected to the tablet ... – lg0173 Sep 21 '16 at 14:57

2 Answers2

0

Add-AppxPackage add appx for the connected user at the tablet Add-AppxProvisionedPackage do available the appx for the new user but not for the existing user

Moreover if I reinstall my appx the appx is not updated

The solution is to create a scheduled task when the user logged at the tablet

Register-ScheduledJob -FilePath C:\myApp\Test.ps1 -Name Install_AppxAtLogOn -MaxResultCount 30 -ScheduledJobOption (New-ScheduledJobOption –DoNotAllowDemandStart) -Trigger (New-JobTrigger -AtLogOn)

test.ps1 verify if the appx exists and verify the version and reinstall but it doesn't work, it work only for the user which create the scheduled task

do you have a another idea for my problem ?

Thanks a lot

Bourbia Brahim
  • 14,459
  • 4
  • 39
  • 52
lg0173
  • 208
  • 2
  • 8
  • 20
0

Updating Provisioned LOB Apps

The newer version of the provisioned LOB App can only be applied by an

> Add-AppxPackage

operation (via powershell) for each user that has signed into the PC running the Windows image.

SEE MICROSOFT DOCS: https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/sideload-apps-with-dism-s14

You see, provisioning the LOB App will stage it in the image and schedule it be installed for every user of the Windows image at first logon or at the next logon, if the user account is already created. So you cannot rely on it to update the installed application, because all provisioning does, is supply the app to a user if it doesn't already have it installed.

A Possible Workaround

Remove the provisioned LOB App from the image:

> Remove-AppxProvisionedPackage -Online -PackageName MyAppxPkg

Uninstall occurrences of the old version the application from each user that has been active:

> Remove-AppxPackage MyAppxPkg

Provision it again with the new version:

> Add-AppxProvisionedPackage -Online -FolderPath C:\Appx -SkipLicense

Warning: Make sure all users are logged off of the machine (I recommend PSExec with a -s passed so it runs under SYSTEM, and that there are not more than 24 apps provisioned on the image already.