How to configure Auto update in MAUI application ?
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="220.127.116.11" 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. ?
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.
I think you have misunderstood my query.
If the MAUI application version 18.104.22.168 is installed currently in users machine, After that when we create version 22.214.171.124 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.
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?
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
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?
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.
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?
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:
Edition Windows 11 Pro
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
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.
But this errors are coming when we are trying to install the app for the first time.
@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 ~
@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~
Sign in to comment