How to configure Auto update in MAUI application ?
Hi,
Consider we have developed a MAUI application.
For deployment of this MAUI application in multiple machine we created a setup file / package following this link - [https://github.com/dotnet/docs-maui/blob/main/docs/windows/deployment/publish-visual-studio-folder.md
Is there any way for Auto updating application which can happen during application start?
We tried the app installer concept
- Create an App Installer file with Visual Studio.
- Configure update settings in the App Installer file
We have created this AppInstaller file manually and kept it in shared folder.
<?xml version="1.0" encoding="utf-8"?>
<AppInstaller
xmlns="http://schemas.microsoft.com/appx/appinstaller/2021"
Version="1.0.0"
Uri="Shared Folder path\Mauiinstaller.appinstaller" >
<MainPackage
Name="MauiApp1"
Publisher="CN=Some value"
Version="1.0.0.2"
ProcessorArchitecture="x64"
Uri="Shared folder path\MAUI\MauiApp1_0.0.2.0_Debug_Test\MauiApp1_0.0.2.0_Debug_Test.msix" />
<UpdateSettings>
<OnLaunch
HoursBetweenUpdateChecks="12" />
</UpdateSettings>
</AppInstaller>
When we distribute this app installer file, there are 2 types of error noticed in different machines.
Error 1 - In some of the machines
Error 2 - In Some of the machines
How to configure Auto update in MAUI and how to resolve this issues. ?
.NET MAUI
-
Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 26,626 Reputation points • Microsoft Vendor
2023-03-09T07:17:54.0033333+00:00 From the doc-Publish a .NET MAUI app to a folder for Windows - .NET MAUI | Microsoft Learn,(the step5 and step6), you don't need to create this AppInstaller file manually. You can test if it works.
-
Sanket Vinod Solanki 30 Reputation points
2023-03-09T08:23:34.5333333+00:00 Hi,
I think you have misunderstood my query.
If the MAUI application version 1.0.0.0 is installed currently in users machine, After that when we create version 1.0.0.1 then user's application should be automatically updated on the application start.
Auto update of application should happen from users end when they try to start the application.
If I publish MAUI application at installer location (enabling automatic updates) and if I try to open the msix file this is the error
And If I turn off the automatic updates then Install.ps1 file is generated and then installation is possible using Install.ps1 file.
-
Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 26,626 Reputation points • Microsoft Vendor
2023-03-13T08:45:32.2833333+00:00 You said it doesn't work in some of the machines, it will work in some other machines, right? Are there any special settings in those machines? Or some special environment configuration?
-
Sanket Vinod Solanki 30 Reputation points
2023-03-13T08:52:23.3633333+00:00 No It does not work in any of the machines, There are two different types of error coming, please check both the screenshot in previous comment
-
Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 26,626 Reputation points • Microsoft Vendor
2023-03-14T02:10:31.0266667+00:00 What happens if you don’t create your own app installer file but instead follow the directions of Publish a .NET MAUI app to a folder for Windows - .NET MAUI | Microsoft Learn exactly? Will it automatically update when a new version is set?
-
Sanket Vinod Solanki 30 Reputation points
2023-03-15T08:22:55.03+00:00 Same thing which I mentioned in my previous comment.
App gets published in the installer location but during installation of app using msix , it throws error.
Let us know how can we resolve this issue.
-
Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 26,626 Reputation points • Microsoft Vendor
2023-03-16T02:17:06.32+00:00 For further investigation, I need to confirm if this error just occurs in your project and your machines. Do you have the same issue when you try to publish an empty template MAUI project (follow the official doc without app installer file)? Can you share the detailed environment information (your machine system version, .NET version, VS version and so on) with me so that I can reproduce the issue?
-
Sanket Vinod Solanki 30 Reputation points
2023-03-16T03:31:33.7333333+00:00 Hi, this error also occurs with published package of empty template MAUI project.
We have followed the official doc without app installer file but error still occurs during installation of app using msix file which is generated.
Please find the environment information below:
System VersionEdition Windows 11 Pro
Version 21H2
OS build 22000.1574
Experience Windows Feature Experience Pack 1000.22000.1574.0
Processor Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz 3.19 GHz
Installed RAM 16.0 GB (15.7 GB usable)
System type 64-bit operating system, x64-based processor.Net Version : Dotnet 7 ( Microsoft .NET SDK 7.0.101)
Visual Studio version : Visual studio 2022 17.5 Enterprise Edition
-
Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 26,626 Reputation points • Microsoft Vendor
2023-03-17T02:26:30.31+00:00 Hi @Sanket Vinod Solanki
MAUI doesn't have anything to do with the actual deployment, which (in the Windows case) will occur the same as any other WinUI deployment. You have followed the doc to publish the app and create the msix. In fact, you don't need to click on msix update package to update your app. Your app will check the auto update folder for any new packages every time the app starts or every X days.( At step6, it shows the settings of how often the app should check for updates.)
You could check if your app will auto update. If you have any other issues, please feel free to post here. -
Sanket Vinod Solanki 30 Reputation points
2023-03-17T03:32:55.1633333+00:00 But this errors are coming when we are trying to install the app for the first time.
-
李华明 10 Reputation points
2023-03-18T16:17:35.6133333+00:00 @Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) Hi Wenyan . I have same issue . I look at the MS Learn and publish my MAUI app. But I only get a msix and no appinstall file .Do you know why.
Thanks a lot ~
-
李华明 10 Reputation points
2023-03-18T18:16:22.6933333+00:00 @Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) Hi, update I follow your steps and I see that
It tell me when I publish it will overwrites the old version , but actually when I publish , they are like this
there are two versions and not overwrite . Why?
And now when I open the 0.0.5.0 version app, it dose not auto update.Thanks a lot~
-
Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 26,626 Reputation points • Microsoft Vendor
2023-04-07T02:00:50.2666667+00:00 We have tested this function and found the MSIX for .NET MAUI is working as expected and what is documented is still accurate. As I am unable to replicate the issue you are experiencing, it is recommended to open a support ticket for this. Please contact our paid phone support at MS Support. You will get 1:1 support on that. In addition, I have to say that .NET MAUI currently only allows publishing an MSIX package. You can't yet publish a Windows executable file for distribution. Please refer to Publish a .NET MAUI app to a folder for Windows - .NET MAUI | Microsoft Learn
-
Sanket Vinod Solanki 30 Reputation points
2023-07-14T06:16:04.27+00:00 Can you let us know what scenario did you try ?
-
David Parkes 0 Reputation points
2023-07-27T10:57:38.0166667+00:00 @Sanket Vinod Solanki Have you come across a solution to this? I have exactly the same issue: The installed Maui App doesn't update to the newest published version.
-
David Parkes 0 Reputation points
2023-07-27T11:03:11.05+00:00 @Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.)
This is from the docs link you posted:
"If you chose the option to enable automatic updates for your package, then select the Next button. If you didn't select automatic updates, the button reads Create, select it, and skip the next step.
The next dialog displayed is the Configure update settings dialog. This is where you configure the installer location for your app, and how often the app should check for updates.
Whenever you publish an updated version of the app, it overwrites the previous version of the app at the Installer location. When users run your app, and based on how often your app checks for updates, the app checks this location for an updated version, and if found, installs it."
This is not true, the previous version does not get over written. The app does not auto update to the newest version.
-
David Kendall 11 Reputation points
2023-08-21T20:35:11.39+00:00 I can confirm that this does not work correctly. When you have the installer deployed to a web page it does NOT check for an update. It runs fine, but it must be uninstalled to update it and reinstalled.
-
Sanket Vinod Solanki 30 Reputation points
2023-08-22T03:59:33.1733333+00:00 Hi, @Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.)
Your comments date 7-Apr-23, can you let us know what steps you have followed.
-
Chris Johansson 0 Reputation points
2023-08-29T20:01:29.09+00:00 When creating this https://learn.microsoft.com/en-us/dotnet/maui/windows/deployment/publish-visual-studio-folder?view=net-maui-7.0#current-limitations%22https://learn.microsoft.com/en-us/dotnet/maui/windows/deployment/publish-visual-studio-folder?view=net-maui-7.0#current-limitations%22 It did not auto update nor create the appinstaller. I also tried to create my own and it didn't work, got an error cannot open the package...
-
Mateusz Szreder 0 Reputation points
2023-09-19T15:42:06.3833333+00:00 Hi, is there any update on that matter? I have encountered the same situation as described above by others
-
Sanket Vinod Solanki 30 Reputation points
2023-11-18T04:52:55.5933333+00:00 Hi @Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) Please update.
-
Dan Lawrence 0 Reputation points
2024-01-08T14:04:54.3933333+00:00 @Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) Please provide an update on how to get the auto update to work. the auto update is NOT working when i deployed the package it to a webpage as mentioned in the documentation.
Sign in to comment