Jan 18 2022 11:23 PM
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
Mar 09 2022 01:50 AM
Mar 10 2022 03:32 PM
Mar 11 2022 02:54 AM - edited Mar 11 2022 02:55 AM
Hello Harshada,
many thanks for your reply, I already tried to implement your proposal:
var res = await pm.AddPackageByUriAsync(uri, new AddPackageOptions() { DeferRegistrationWhenPackagesAreInUse = true});
Unfortunately this will throw an exception: Object reference not set to an instance of an object.
In the background though, something is actually happening because catching this exception and restarting the app will apply the update.
Do I miss some more input?
Another thing that puzzles me is that the docs say:
"The URI of the package to add. The URI must follow the file URI scheme (file://) since the only supported URI schemes are local file paths and local network paths."
Well, I am using a URL pointing to a Azure Blob. Is this even possible?
May 23 2022 05:55 AM
May 23 2022 09:43 AM
May 27 2022 05:37 PM