5

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>
Franco
  • 441
  • 3
  • 18
  • Logged an issue with Visual Studio Code a while back since this is a bug with them. If it is not resolved then creating your own installer file manually is an option. https://learn.microsoft.com/en-us/windows/msix/app-installer/how-to-create-appinstaller-file – Franco Mar 31 '23 at 10:11

1 Answers1

5

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.

F. Rusconi
  • 115
  • 10
  • 1
    I logged an issue with Visual Studio Code and they said it is an issue they are working on. For now creating our own .appinstaller file worked – Franco Sep 23 '22 at 11:39
  • It is also important to mention that you have to increase the AppInstaller Version. At least that is what I forgot at first and wondered why nothing happens. – lorenz albert Apr 14 '23 at 11:31
  • @Franco is there any github issue post related with your vs code issue? I would like to know if they fixed the problem. Otherwise I will have to create my own .appinstaller file like you. – OTreps Jun 01 '23 at 15:33
  • I am trying your solution here but with local files. Is this achievable? How would a URI to a local path look like? @f-rusconi I am getting Error in parsing the app package. – OTreps Jun 01 '23 at 18:02
  • 1
    For anyone looking I finally figured it out. URI should look something like this: file://C:/Users/Public/temp/XXX.msix – OTreps Jun 01 '23 at 18:18