MSIX update on launch fails with "Unable to install because the following apps need to be closed"

Copper Contributor

I have a WPF app deployed with MSIX. The .appinstaller is set to update silently on launch (no user prompt):

 

<UpdateSettings>
    <OnLaunch HoursBetweenUpdateChecks="0" />
    <ForceUpdateFromAnyVersion>true</ForceUpdateFromAnyVersion>
</UpdateSettings>

Installation works, but after releasing a new version, then starting the app, the update fails with the following message in the event log:

 

AppX Deployment operation failed for package 8b7d5c25-92aa-4962-9e74-93b9685ce2ca-test_2021.1013.1518.1578_neutral_~_002e9dkagpm7g with error 0x80073D02. The specific error text for this failure is: error 0x80073D02: Unable to install because the following apps need to be closed 8b7d5c25-92aa-4962-9e74-93b9685ce2ca-test_2021.1013.1509.1577_x64__002e9dkagpm7g.

 

If I close the app, and then re-start it, the update finishes without problems.

The weird thing about the error is that it seems to refer to the same app that is being updated as the app that needs to be closed..?

 

8b7d5c25-92aa-4962-9e74-93b9685ce2ca-test_2021.1013.1509.1577_x64__002e9dkagpm7g

 

is the app with the old version number '2021.1013.1509.1577'

while

 

8b7d5c25-92aa-4962-9e74-93b9685ce2ca-test_2021.1013.1518.1578

is the new version '2021.1013.1518.1578'

 

Why does the update fail with this weird error?

 

3 Replies
I have read somewhere that the update is only supposed to happen the next time you launch the app. The first time it will be the old version. So maybe this is working as designed...
I do not see errors in event log, but from my experience the update always takes at least two re-lanuches before it updates. First re-launch nothing ever happens, even if I reboot my test machine before.

@MichalKala1991 

Generally, one can update an app (assuming it is not running) in a single try.


Normally, I would expect that with the appinstaller posted, if you triggered the upgrade by a change to the back-end appinstaller file followed by the user launching the app, the installation will be held off and will occur after this app session closes down in the background (which is nice),. Thus you see the new version on second launch.

 

There is an additional option as part of the 2nd version of the schema for the appinstaller file to block the "activation" (i.e. launch) of the app by the user when it detects the update and prompt the user as to if they want the update.  If affirmative, the update happens immediately and the user can then launch the upgraded app..  You'd add both ShowPrompt="true" and UpdateBlocksActivation="true".

 

The doc on this option is https://docs.microsoft.com/en-us/uwp/schemas/appinstallerschema/element-onlaunch   and you need to reference this version of the schema using 

    xmlns="http://schemas.microsoft.com/appx/appinstaller/2017/2

 

If you don't like the user seeing the prompt, and they never log out, you can also consider using the AutomaticBackgroundTask option of the schema which will look for updates every 8 hours whether or not the user is running the app.