在 WIX 安装开始时部署并运行应用程序

发布于 2024-09-02 08:49:26 字数 1520 浏览 3 评论 0原文

我试图在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

女中豪杰 2024-09-09 08:49:26

不要将可执行文件添加到要安装的文件列表中,而是尝试将其作为二进制文件输入,即

<Product ......>

  <Binary Id="serverUpdaterRunFirstExe" SourceFile="$(var.SOURCEPATH)\MyCompany.Server.Updater.RunFirst.exe" />

  <CustomAction Id="LaunchUpdaterRunFirst" BinaryKey="serverUpdaterRunFirstExe" />

</Product>

Instead of adding the executable file to the list of files to be installed try entering it as a Binary file ie

<Product ......>

  <Binary Id="serverUpdaterRunFirstExe" SourceFile="$(var.SOURCEPATH)\MyCompany.Server.Updater.RunFirst.exe" />

  <CustomAction Id="LaunchUpdaterRunFirst" BinaryKey="serverUpdaterRunFirstExe" />

</Product>
凤舞天涯 2024-09-09 08:49:26

请参阅 WiX InstallExecuteSequence。您当前使用

<Custom Action='LaunchUpdaterRunFirst' After='InstallInitialize' />

但此时文件尚未复制。所以我认为你必须使用以下之一:

<Custom Action='LaunchUpdaterRunFirst' After='InstallFiles' />
<Custom Action='LaunchUpdaterRunFirst' Before='ConfigureIIs' />

See the WiX InstallExecuteSequence. You currently use

<Custom Action='LaunchUpdaterRunFirst' After='InstallInitialize' />

But at that moment the files are not copied yet. So I think you must use one of the following:

<Custom Action='LaunchUpdaterRunFirst' After='InstallFiles' />
<Custom Action='LaunchUpdaterRunFirst' Before='ConfigureIIs' />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文