gpt4 book ai didi

wix - 如何更改 NGen 在 WiX MSI 包中运行时显示的文本

转载 作者:行者123 更新时间:2023-12-04 22:37:01 37 4
gpt4 key购买 nike

我们在安装过程中使用 NGen 来优化应用程序的启动时间。

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
...
<File Id="File.$(var.ProjectName.TargetName).exe" Source="$(var.ProjectName.TargetPath)" KeyPath="yes">
<netfx:NativeImage Id="ngen.File.$(var.ProjectName.TargetName)" Platform="$(var.NgenPlatform)" Priority="0" AppBaseDirectory="INSTALLLOCATION"/>
</File>
...
</Wix>

在安装生成的 MSI 时,与其他步骤相比,“删除备份文件”步骤花费了非常长的时间。深入研究,我们发现当时 NGen 正在运行。

我们怎么能在那里写点别的东西,比如“我们现在在你的应用程序每次启动时为你节省了很多时间”?

最佳答案

实际上有更好的方法,因为 NetFx WiX 扩展中有两个操作 NetFxExecuteNativeImageCommitInstall(在启用回滚的情况下调用)和 NetFxExecuteNativeImageInstall(在禁用回滚的情况下)。

<UI>
<ProgressText Action="NetFxExecuteNativeImageInstall">Speeding up your application</ProgressText>
</UI>
<InstallExecuteSequence>
<Custom Action="NetFxExecuteNativeImageCommitInstall" After="NetFxExecuteNativeImageUninstall">0</Custom>
<Custom Action="NetFxExecuteNativeImageInstall" After="NetFxExecuteNativeImageCommitInstall" />
</InstallExecuteSequence>

关于wix - 如何更改 NGen 在 WiX MSI 包中运行时显示的文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34177239/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com