Forum Discussion

Nothi1717's avatar
Nothi1717
Copper Contributor
Jan 19, 2022

Update a non store App deployed via MSIX using the PackageManager API, no ForceShurdown

I managed to create a MSIX Package for my WPF Desktop App and successfully included the Windows.Management.Deployment dependency.
My goal is to get some kind of auto update going by calling:

 

var uri = new Uri(Bootstrapping.UpdateUrl); //URL to .msix file
var res = await pm.AddPackageAsync(uri, null, DeploymentOptions.None).AsTask(new UpdateProgress(mAppState)); 

 

Using the code above, the process will just run forever, await never returns. The progress event tells me the update is startet but then progress stops.
As soon as I change the deployment options to ForceApplicationShutdown the App will be shut down without notice, which is not appropriate in my case.
I would like to start the Update, then notify the user "Update will be finished when restarting the App" (or similar) and let the user decide when to restart (saving all the work before).

Is this even possible?

 

Any ideas are welcome,
Cheers,
Nothi

 

 

Resources