Rye bread
Rye bread

Reputation: 1811

MSIX sideloaded app is slow to start after update

I am using MSIX packaging to deploy .NET desktop applications. The app is built by Azure Pipelines and the installation package is deployed to a shared folder on a file server.

When I run the .appinstaller, the dialog opens and applies updates as it should. But then the dialog closes, and nothing happens for over 1 minute. Then the app starts.

TEST 1 - Normal user

Looking in the event log, there is first this warning:

App manifest validation warning: Declared namespace http://schemas.microsoft.com/developer/appx/2015/build is inapplicable, it will be ignored during manifest processing.

Then several messages like

error 0x5: Deleting file \?\C:\Program Files\WindowsApps\Deleted\8b7d5c25-92aa-4962-9e74-93b9685ce2ca-test_2021.1005.1225.1455_x64__002e9dkagpm7g28acfe13-edc2-4d9d-8a69-d5d9687e0573\MyApp\MyApp.exe failed.

After 1 minute there is this warning:

Warning: There were 129 additional files that failed to be deleted under the folder \?\C:\Program Files\WindowsApps\Deleted.

It seems that the process tries, and retries, to delete the old files for over 1 minute, then gives up.

How can I allow MSIX to delete the files without giving it administrator rights?

TEST 2 - Administrator user

I did a second test, this time on a different machine, and logged in as an administrator.

The update dialog finished the update and closed after 12s.

Then nothing happened for 5 minutes(!)

I believe I clicked the Start button or something, then suddenly the app started.

Examining the log did not show any warnings about failed file deletions.

Only this warning:

App manifest validation warning: Declared namespace http://schemas.microsoft.com/developer/appx/2015/build is inapplicable, it will be ignored during manifest processing.

During the 5 minutes there were no log entries at all.

These were the last 2 log entries, made after 5 minutes:

14-10-2021 10:10:12

UpdateUsingAppInstallerOperation operation on a package with main parameter 8b7d5c25-92aa-4962-9e74-93b9685ce2ca-test_2021.1013.1518.1578_x64__002e9dkagpm7g and Options 0 and 0. See http://go.microsoft.com/fwlink/?LinkId=235160 for help diagnosing app deployment issues.

14-10-2021 10:10:13

The bundle streaming reader was created successfully for bundle 8b7d5c25-92aa-4962-9e74-93b9685ce2ca-test_2021.1013.1518.1578_neutral_~_002e9dkagpm7g.Started deploymentThe bundle streaming reader was created

Conclusion

Looking at Task Manager and ProcMon, I can see that the app starts right after the update dialog closes. However, the process is a Background Process, invisible to the user.

While googling, I came across these posts describing the same problem: https://techcommunity.microsoft.com/t5/msix-deployment/app-does-not-launch-immediately-after-installation-but-after-a/m-p/1972161

https://techcommunity.microsoft.com/t5/msix-deployment/winforms-exe-in-msix-package-does-not-startup-after-auto-update/m-p/965978

Upvotes: 2

Views: 568

Answers (2)

Rye bread
Rye bread

Reputation: 1811

I never found a solution for this. My workaround is to turn off the update dialog by not including ShowPrompt="true".

Then the app seems to launch as it should even if there are updates.

However, there is a new problem - the first time the user starts the app after an update has been released, the auto-update does not happen. It only gets applied the second time the app starts. This is by design apparently...

Upvotes: 0

Bogdan Mitrache
Bogdan Mitrache

Reputation: 11023

You can't give it admin rights. MSIX installations always run per user.

This seems to sound like a machine-related problem. Are you reproducing the same behavior on other machines (try virtual machines if you don't have access to a separate physical machine).

Upvotes: 0

Related Questions