skip to Main Content

I have been developing a MAUI Blazor Hybrid Desktop Application for Windows. I want to configure automatic/self-updates for that application. I have followed the publish via Visual Studio Code Instructions.

Official doc link

Followed the steps as is, for the Installer location field in the publish wizard, I entered a public s3 bucket URL which will contain the future versions of the application. The URL looks like this.

https://<bucket-name>.s3.us-east-1.amazonaws.com/blazor-application

After installing the application, I generated another version with the incremented version and posted the contents of the output folder to the s3 bucket. I closed the running application and started it again, but the auto update did not seem to work.

I found that the application needs a .appinstaller file configured with the update settings, but my understanding is that the file is automatically created by visual studio when publishing. Is that correct?

Another post suggested that the application should be installed in the root folder to receive updates, but upon installation I see no options to install on a specific location.

Any help is appreciated, please point me to the correct resources.

2

Answers


  1. Chosen as BEST ANSWER

    So, the issue is with Visual Studio I hope, the *.appinstaller file is not generated.

    My issue is related to this stackoverflow question

    Microsoft docs on how to create the appinstaller file manually

    So, I generated the appinstaller file manually according to the steps in the above answer and it should work fine.

    Additionally, I deployed this package along with the appinstaller in S3 and it works like a charm, the bucket have to be public.

    Another important note is that the installation has to be done through the appinstaller file rather than the MSIX file, in order to enable auto updates.

    My version of the file looked like this if anyone is wondering,

    <?xml version="1.0" encoding="utf-8"?>
    <AppInstaller
        xmlns="http://schemas.microsoft.com/appx/appinstaller/2021"
        Version="1.0.0.0"
        Uri="s3 path to the appinstaller file" >
        
        <MainPackage
            Name=""
            Publisher=""
            Version="1.0.0.0"
            ProcessorArchitecture="x64"
            Uri="s3 path to the MSIX package" />
        
        <UpdateSettings>
            <OnLaunch 
                HoursBetweenUpdateChecks="0"
                ShowPrompt="true" />
            <AutomaticBackgroundTask />
        </UpdateSettings>
    </AppInstaller>
    

  2. Configuring automatic/self-updates for a MAUI Blazor Hybrid Desktop Application can be a bit tricky

    AppInstaller File: You are correct that the .appinstaller file is essential for automatic updates. Visual Studio should generate this file for you when you publish the application, but it’s worth checking if it exists. Look in the output folder for your application’s published files. You should see a file named .appinstaller. If it’s not there, you may need to manually create it or recheck your publish settings.

    Publish Settings: In your project settings, go to the "Publish" tab.
    Under "Installer Location," you can specify your S3 bucket URL like you did.
    Ensure that you’ve set up the correct update settings in the publish profile, including checking the "Create a .appinstaller file" option.

    File Structure in S3 Bucket: Make sure that the structure of your files in the S3 bucket matches the expected format. It should be something like this:

    - blazor-application/
        - 1.0.0/
            - <YourAppName>.msixbundle
            - <YourAppName>.appinstaller
        - 1.0.1/
            - <YourAppName>.msixbundle
            - <YourAppName>.appinstaller
        - ...
    

    Application Installation Folder: When you install the application, it’s usually installed in the default system location. However, it’s the .appinstaller file’s job to handle updates. When you launch your application, it should automatically check for updates based on the URL in the .appinstaller file.

    Testing Updates:

    • After you’ve ensured that everything is set up correctly, create a new version of your application and publish it to your S3 bucket as you did before.
    • Make sure that the version number in the .appinstaller file is incremented.
    • Close and restart your application.
    • It should automatically check for updates based on the .appinstaller file, download the new version, and prompt the user to install it.

    Troubleshooting:

    • Check for any errors in the application logs or debugging information.
    • Ensure your .appinstaller file has the correct URLs and update settings.
    • Double-check the version numbers in the .appinstaller file and the actual files in your S3 bucket.
    • Ensure that your S3 bucket and its contents are publicly accessible.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search