在 WIX 安装开始时部署并运行应用程序
我试图在 MSI 安装开始时使用 WIX 部署和运行应用程序(C# 控制台应用程序),但遇到一些困难。
应用程序需要在任何 Web 服务器操作发生之前、文件从 MSI 复制到目标位置之后运行。
我可以让应用程序运行,但前提是我在运行 MSI 之前已将应用程序实际复制到目录中。如果我不这样做,我会收到与 MSI 日志中不存在的应用程序相关的错误。所以基本上我认为这与我正在使用的启动顺序有关我需要确保应用程序在运行之前存在。
想知道你们中的一位好心人是否可以帮助我。
要求是应用程序必须作为 WIX MSI 执行的第一件事运行(实际上是在任何 Web 服务部分发生之前)。
Wix的相关位如下。
<CustomAction Id='LaunchUpdaterRunFirst' FileKey='serverUpdaterRunFirstExe' ExeCommand='' Return='ignore' />
……
<InstallExecuteSequence>
<Custom Action='CA_BlockOlderVersionInstall' After='FindRelatedProducts'>NEWERVERSIONDETECTED</Custom>
<RemoveExistingProducts After="InstallInitialize" />
<Custom Action='LaunchUpdaterRunFirst' After='InstallInitialize' />
<Custom Action='LaunchInstaller' After='InstallFinalize'><![CDATA[ REMOVE <> "ALL" and UILevel <> 2]]></Custom>
</InstallExecuteSequence>
任何
<Component Id="ServerInstaller" DiskId="1" Guid="9662EC72-1774-4d22-9F41-AD98A5DCD729">
<File Id="serverUpdaterRunFirstExe" Name="MyCompany.Server.Updater.RunFirst.exe" Source="$(var.SOURCEPATH)\MyCompany.Server.Updater.RunFirst.exe" />
<File Id="serverUpdaterRunFirstExeConfig" Name="MyCompany.Server.Updater.RunFirst.exe.config" Source="$(var.SOURCEPATH)\MyCompany.Server.Updater.RunFirst.exe.config" />
帮助或参考都非常感谢。
I'm trying to deploy and run an application (C# console app) at the beginning of the MSI install with WIX but having some difficulty.
The application needs to run before any of the webserver actions happen but after the files have been copied from the MSI to the target location.
I can get the app to run but only if I have actually copied the application in the directory before I run the MSI. If I don't do that, I get an error relating to the app not existing in the MSI logs. So basically I think it has to do with the launch sequence I am using I need to ensure that the app exists before it is run.
Wondering if one of you good folks could help me out.
The requirement is that the application must run as the first thing the WIX MSI does, (well actually before any of the webservice parts happen).
The relevant bits of the Wix are as follows.
<CustomAction Id='LaunchUpdaterRunFirst' FileKey='serverUpdaterRunFirstExe' ExeCommand='' Return='ignore' />
...
<InstallExecuteSequence>
<Custom Action='CA_BlockOlderVersionInstall' After='FindRelatedProducts'>NEWERVERSIONDETECTED</Custom>
<RemoveExistingProducts After="InstallInitialize" />
<Custom Action='LaunchUpdaterRunFirst' After='InstallInitialize' />
<Custom Action='LaunchInstaller' After='InstallFinalize'><![CDATA[ REMOVE <> "ALL" and UILevel <> 2]]></Custom>
</InstallExecuteSequence>
...
<Component Id="ServerInstaller" DiskId="1" Guid="9662EC72-1774-4d22-9F41-AD98A5DCD729">
<File Id="serverUpdaterRunFirstExe" Name="MyCompany.Server.Updater.RunFirst.exe" Source="$(var.SOURCEPATH)\MyCompany.Server.Updater.RunFirst.exe" />
<File Id="serverUpdaterRunFirstExeConfig" Name="MyCompany.Server.Updater.RunFirst.exe.config" Source="$(var.SOURCEPATH)\MyCompany.Server.Updater.RunFirst.exe.config" />
Any help or references greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不要将可执行文件添加到要安装的文件列表中,而是尝试将其作为二进制文件输入,即
Instead of adding the executable file to the list of files to be installed try entering it as a Binary file ie
请参阅 WiX InstallExecuteSequence。您当前使用
但此时文件尚未复制。所以我认为你必须使用以下之一:
See the WiX InstallExecuteSequence. You currently use
But at that moment the files are not copied yet. So I think you must use one of the following: