问题:
如何让MSIX appinstaller在每次生成/发布期间输出正确的设置?
上下文:
我在跑步:
19042.928
MSIX Windows目标设置如下:
MSIX安装程序项目创建无效的appinstaller文件,防止应用程序每次运行时自动检查更新。我可以在每次构建/发布之后手动更改文件,但我认为我不应该这样做,因为它看起来既自毁又错误。
一般来说,我几乎每次都会忽略创建appinstaller,但是文件会自动增加版本号。因此,我目前似乎被某种形式的手动干预困住了,要么更改schema version和UpdateSettings部分,要么更新路径中的版本。这可能与运行有关吗?我需要专业人才才能让它发挥作用吗?
Visual创建的应用程序,这是错误的:
<?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>我需要Visual创建的应用程序:
<?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>发布于 2021-04-27 17:14:17
我们解决了应用程序不检查自动更新的问题,即使启用了旁写。我们需要添加一个额外的项目到MSIX项目类型的App。这将创建一个默认的Package.appinstaller*文件名。此文件提供了appinstaller文件的配置设置,这是控制所有可用设置(包括UpdateSettings部分)所必需的。
appinstaller允许的一些附加功能是阻止用户在不更新的情况下运行应用程序。这与ClickOnce发布配置文件有关,因为它让用户可以选择跳过更新;我们无法找到防止这种情况的方法。然而,MSIX应用程序允许对此行为进行控制。
*不重命名此文件,因为构建/发布实用程序不会将其取下来并将设置应用到APPINSTALLER文件中。这似乎是一个BUG/静态文件引用。
Package.appinstaller
<?xml version="1.0" encoding="utf-8"?>
<AppInstaller Uri="{AppInstallerUri}"
Version="{Version}"
xmlns="http://schemas.microsoft.com/appx/appinstaller/2018">
<MainBundle Name="{Name}"
Version="{Version}"
Publisher="{Publisher}"
Uri="{MainPackageUri}"/>
<UpdateSettings>
<OnLaunch
HoursBetweenUpdateChecks="0"
ShowPrompt="true"
UpdateBlocksActivation="true" />
<AutomaticBackgroundTask />
<ForceUpdateFromAnyVersion>true</ForceUpdateFromAnyVersion>
</UpdateSettings>
</AppInstaller>参考资料:
附加参考资料:
https://stackoverflow.com/questions/67285329
复制相似问题