Question:
How do I get the MSIX appinstaller
to output the correct settings during each build/publish?
Context:
This is a follow-up question to Why does the MSIX not automatically check for updates every time the application runs when sideloading is enabled?
I am running:
- Windows 10 20H2, OS Build 19042.928
- Visual Studio 2019 Community edition, version 16.9.4
The MSIX Windows Targeting settings are as follows:
- Target version = Windows 10, version 2004
- Min version = Windows 10, version 1809
The MSIX installer project creates an invalid appinstaller
file, which prevents the application from automatically checking for updates each time it runs. I can manually change the file after each build/publish, but I don't think I should have to do this because it seems both self-defeating and wrong.
Generally speaking, I would almost ignore creating the appinstaller
each time, but the file auto-increments the version number. So, it seems like I am currently stuck with some form of manual intervention with either changing both the schema version
and UpdateSettings
section or update the version in the paths. Could this potentially be related to running Visual Studio Community edition? Do I need to have Professional in order to get it to work?
Appinstaller that Visual Studio creates, which is wrong:
<?xml version="1.0" encoding="utf-8"?>
<AppInstaller
Uri="https://<AppService>.azurewebsites.net/<AppName>.Setup.appinstaller"
Version="<AppVersion>" xmlns="http://schemas.microsoft.com/appx/appinstaller/2017/2">
<MainBundle
Name="<SomeGuid>"
Version="<AppVersion>"
Publisher="CN=<CertificateName>"
Uri="https://<AppService>.azurewebsites.net/<AppName>.Setup_<AppVersion>_Development_Test/<AppName>.Setup_<AppVersion>_x64_Development.msixbundle" />
<UpdateSettings>
<OnLaunch
HoursBetweenUpdateChecks="0" />
</UpdateSettings>
</AppInstaller>
Appinstaller that I need Visual Studio to create:
<?xml version="1.0" encoding="utf-8"?>
<AppInstaller
Uri="https://<AppService>.azurewebsites.net/<AppName>.Setup.appinstaller"
Version="<AppVersion>" xmlns="http://schemas.microsoft.com/appx/appinstaller/2018">
<MainBundle
Name="<SomeGuid>"
Version="<AppVersion>"
Publisher="<CertificateName>"
Uri="https://<AppService>.azurewebsites.net/<AppName>.Setup_<AppVersion>_Development_Test/<AppName>.Setup_<AppVersion>_x64_Development.msixbundle" />
<UpdateSettings>
<OnLaunch
HoursBetweenUpdateChecks="0"
ShowPrompt="true"
UpdateBlocksActivation="true" />
<AutomaticBackgroundTask />
<ForceUpdateFromAnyVersion>true</ForceUpdateFromAnyVersion>
</UpdateSettings>
</AppInstaller>