迁移安装程序主要升级中的属性



在主要升级工作流程中,是否有任何方法可以查看/迁移属性从正在删除的安装到新安装?

这应该不太重要,但这是我的背景。我使用MigrateFeatureStates是为了防止用户在重大升级期间重新创建服务。我看到的问题是,如果用户为服务功能指定了自定义文件夹位置,则升级失败,因为当文件安装到默认位置时,服务仍然使用自定义路径。

服务安装/控制
<ServiceInstall Id="MyServiceInstall" Name="MyService" DisplayName="MyService" Account="[user]" Password="[pass]" Type="ownProcess" Start="auto" ErrorControl="normal" />
<ServiceControl Id="MyServiceControl" Name="MyService" Wait="yes" Start="install" Stop="both" Remove="uninstall" />

安装顺序
<MigrateFeatureStates Sequence="1001" />
<RemoveExistingProducts Sequence="1020" />
<StopServices Sequence="1700" />
<DeleteServices Sequence="1750"><![CDATA[(NOT UPGRADINGPRODUCTCODE)]]></DeleteServices>
<InstallServices Sequence="5800"><![CDATA[NOT(MIGRATE)]]</InstallServices>
<StartServices Sequence="5900" />

如果您从头开始,您将使用WiX remember属性模式,但如果第一个产品已经发布,则为时已晚。

如果安装文件夹保存在注册表中,您可以使用WiX注册表搜索恢复它。否则,您可以使用WiX组件搜索。您可以使用服务可执行文件的组件id,搜索将恢复其路径。您将在自定义操作中使用它来将安装文件夹设置到该位置。

如果您正在使用WiX主升级元素,那么如果您正在升级,它将设置一个名为WIX_UPGRADE_DETECTED的属性,因此如果设置了该属性,您可以禁用浏览对话框。

相关内容

最新更新