visual-studioasp.net-blazormsix.net-maui

APP INSTALLER FILE not generated when publishing .Net Maui Application using MSIX


Trying to publish .Net Maui Application using MSIX, but the 'APP INSTALLER FILE' (.appinstaller) and all of it's content isn't generated. I am using the Visual studio method (including SideLoading) of publishing where you right click on the project and press Publish.

Using Windows 10. My App's TargetPlatformMinVersion:

<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>

Here are the steps I followed:

Right clicked on the project and select publish then the following images are from the wizard.

enter image description here

enter image description here

enter image description here

enter image description here

The result:

enter image description here

In the last slide The Bundle is set to No and the required Operating System in blank, I dont know if this is the issue, but if it is how do I fix this.

Then I press Copy And Close, but no installer file and MSIX bundle files have been generated in C:\Dev\Installer. It is empty, but there should be a bundle and an installer file which I can use to push updated to the app that users have installed.

Generated Settings in my project:

<GenerateAppInstallerFile>True</GenerateAppInstallerFile>
        <AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
        <PackageCertificateKeyFile>..._TemporaryKey.pfx</PackageCertificateKeyFile>
        <AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
        <AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
        <AppxSymbolPackageEnabled>False</AppxSymbolPackageEnabled>
        <GenerateTestArtifacts>True</GenerateTestArtifacts>
        <AppInstallerUri>C:\Dev\Installer</AppInstallerUri>
        <HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>

Solution

  • EDIT

    It turns out some users had issues with installing the apps, we had to include Dependencies to the app installer. You can find them inside the Dependencies folder within the generated package folder.

    Here is the updated version:

    <?xml version="1.0" encoding="utf-8"?>
    <AppInstaller
        xmlns="http://schemas.microsoft.com/appx/appinstaller/2017/2"
        Version="1.0.0.0"
        Uri="uri where this file is stored (including the file name), i.e. the installer location" >
    
        <MainPackage
            Name="Application GUID found in project's properties"
            Publisher="This has to match exactly what is the subject in your second screenshot, e.g. CN=John Doe"
            Version="Your package version"
            ProcessorArchitecture="x64"
            Uri="The location of the generated MSIX file of the latest version" />
    
        <Dependencies>
            <Package
                Name="Microsoft.WindowsAppRuntime.1.1"
                Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"
                ProcessorArchitecture="x64"
                Uri="yourlocation/Dependencies/x64/Microsoft.WindowsAppRuntime.1.1.msix"
                Version="1005.616.1651.0" />
        </Dependencies>
    
        <UpdateSettings>
            <OnLaunch 
                HoursBetweenUpdateChecks="0" />
            <AutomaticBackgroundTask />
        </UpdateSettings>
    </AppInstaller>
    

    ORIGINAL:

    I'm having the exact same issue. I followed the publish wizard and both the .appinstaller file and index.html file are not generated, while the folder containing the MSIX file and all the other content is being generated as expected.

    I am starting to think this is a bug from Visual Studio, so I'm hoping a new release will fix this.

    For now, I managed to make it work by creating my own .appinstaller file and put it into the installer location. I know this is not a definitive solution as it requires me to manually update the .appinstaller file every time a new version is deployed. At least I am able to get client apps to update automatically though.

    Here's an example of the file:

    <?xml version="1.0" encoding="utf-8"?>
    <AppInstaller
        xmlns="http://schemas.microsoft.com/appx/appinstaller/2017/2"
        Version="1.0.0.0"
        Uri="uri where this file is stored (including the file name), i.e. the installer location" >
    
        <MainPackage
            Name="Application GUID found in project's properties"
            Publisher="This has to match exactly what is the subject in your second screenshot, e.g. CN=John Doe"
            Version="Your package version"
            ProcessorArchitecture="x64"
            Uri="The location of the generated MSIX file of the latest version" />
    
        <UpdateSettings>
            <OnLaunch 
                HoursBetweenUpdateChecks="0" />
            <AutomaticBackgroundTask />
        </UpdateSettings>
    </AppInstaller>
    

    Once I am ready to deploy a new version, I follow the same publish wizard to generate the folder containing the MSIX file and then I need to manually update the code above with the correct version and MSIX URI.

    NOTE: I tested this on the .NET MAUI Blazor default application as I only wanted to figure out how to deploy and push updates, more complex applications might need additional information in the app installer file.