安装后如何启动可执行文件(exe 由 .msm 提供)

How to launch executable after installation (exe is delivered by .msm)

我按照 tutorial 中的说明进行了所有操作,但我的可执行文件在产品安装完成后并未启动。 我的可执行文件与 .msm 模块一起交付时存在细微差别,因此在 .msi 的 .wxs 文件中,我执行以下操作来启动应用程序:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product>
    <!-- I omit here features and elements which are irrelevant to the question-->
    <Feature Id="Configurator" Display="hidden" Level="1">
        <MergeRef Id="MergeConfigurator"/>
    </Feature>
    <UI>
        <UIRef Id="WixUI_Minimal"/>
        <Publish Dialog="ExitDialog" Control="Finish" Event="DoAction"
                 Value="LaunchConfigurator">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
    </UI>
    <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="!(loc.ExitDlgCheckBoxText)" />
    <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1"/>
    <Property Id="WixShellExecTarget" Value="[#SystemConfigurator.exe.81c0fa8f-9a8e-49d8-9dc2-ce01ca163146]" />
    <CustomAction Id="LaunchConfigurator" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
</Product>
<Fragment>
    <DirectoryRef Id="TARGETDIR">
        <Merge Id="MergeConfigurator" SourceFile="$(var.MergeModulesPath)\ConfiguratorSetup_$(var.Platform).msm" DiskId="1" Language="1033"/>
    </DirectoryRef>
</Fragment>
</Wix>

对于带有 Id=WixShellExecTarget 的 属性,我尝试在有和没有 GUID 的情况下传递值(这是我的可执行文件的 .msm 的 Package/@Id)。 我用 Orca 打开我的 .msi 并看到了我的可执行文件的确切 ID(它是 SystemConfigurator.exe.81c0fa8f-9a8e-49d8-9dc2-ce01ca163146,这就是我传递这个值的原因)。

但是有什么问题吗?

我使用 /l*v 选项记录了安装过程,其中有一部分来自日志:

Action 18:47:57: LaunchConfigurator. 
Action start 18:47:57: LaunchConfigurator.
MSI (c) (54:68) [18:47:58:106]: Invoking remote custom action. DLL: C:\Users\AAGENO~1\AppData\Local\Temp\MSIB233.tmp, Entrypoint: WixShellExec
MSI (c) (54:08) [18:47:58:106]: Cloaking enabled.
MSI (c) (54:08) [18:47:58:106]: Attempting to enable all disabled privileges before calling Install on Server
MSI (c) (54:08) [18:47:58:106]: Connected to service for CA interface.
MSI (c) (54!04) [18:47:58:476]: Note: 1: 2715 2: SystemConfigurator.Client.exe.81c0fa8f-9a8e-49d8-9dc2-ce01ca163146 
MSI (c) (54!04) [18:47:58:476]: Note: 1: 2715 2: SystemConfigurator.Client.exe.81c0fa8f-9a8e-49d8-9dc2-ce01ca163146 
Action ended 18:47:58: LaunchConfigurator. Return value 3.
MSI (c) (54:34) [18:47:58:476]: Note: 1: 2205 2:  3: Error 
MSI (c) (54:34) [18:47:58:476]: Note: 1: 2228 2:  3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 2896 
DEBUG: Error 2896:  Executing action LaunchConfigurator failed.

错误 2715 表示您使用的文件密钥实际上不在文件 table 中。假设它指的是 SystemConfigurator.exe.81c0fa8f-9a8e-49d8-9dc2-ce01ca163146 我会用 Orca 打开 MSI 文件并查看它是否是正确的值并记住 Windows 安装程序属性是大小写 -敏感所以如果它真的是大写那么使用大写。确保它也是破折号,而不是下划线。