无法在 Wix 设置中启动 .exe [英] Unable to launch .exe in Wix setup

查看:38
本文介绍了无法在 Wix 设置中启动 .exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有 wix 设置的 C# 应用程序.我用 2 个复选框自定义了 ExitDialog(在

MyApplication.exe 的复选框工作正常,另一个没有.生成没有在本地目录中复制 uEye64_47100_WHQL.exe 并且当我检查该选项时没有追加.

我从 WiX 开始,我错过了什么?

现在我有一个带有 .exe 的组件.该文件已复制,但我无法运行它.使用 msiexec 登录我有:

<块引用>

MSI (c) (C4:B8) [12:45:35:109]: Note: 1: 2228 2: 3: Error 4: SELECT Message FROM Error WHERE <代码>错误 = 1721信息 1721.此 Windows 安装程序包存在问题.无法运行完成此安装所需的程序.请联系您的支持人员或软件包供应商.操作:SetExecUEye,位置:C:\uEye64_47100_WHQL.exe,命令:

我不明白这个错误,也不知道为什么文件在C:\(我用SourceDir来定位)

编辑 2:

创建的组件:

 <Component Id="uEye64_47100_WHQLexe" Directory="TARGETDIR" Guid="{1BD47632-42D5-4C56-B207-1E6B1005488C}"><File Id="uEye64_47100_WHQLexe" Source=".​​/Resources/uEye64_47100_WHQL.exe" KeyPath="yes" Checksum="yes" Compressed="no" Vital="no"/></组件>

和目录:

<Directory Id="TARGETDIR" Name="SourceDir"><Directory Id="ProgramMenuFolder"><Directory Id="ApplicationProgramsFolder" Name="$(var.compagny)"/></目录><Directory Id="DesktopFolder" SourceName="Desktop"/><Directory Id="ProgramFilesFolder"><Directory Id="PRODUCTFOLDER" Name="$(var.compagny)"><Directory Id="INSTALLFOLDER" Name="$(var.product)"><Directory Id="fr" Name="fr"/></目录></目录></目录></目录></片段>

如何定义 uEye64_47100_WHQLexe 仅在我的发布文件夹中复制?TARGETDIR 设置为 C:\

解决方案

你必须为你的 uEye64_47100_WHQL.exe 创建另一个组件作为你的主 .exe,如果你想复制它并运行安装.如果它仅位于Resource文件夹中,则只能在编译时作为文件源引用,因为它不会添加到安装程序本身.所以创建像

这样的组件

<File Id="uEye64_47100_WHQLexe" Source=".​​/Resources/uEye64_47100_WHQL.exe" KeyPath="yes" Checksum="yes"/></组件>

然后您可以使用 WixShellExec 在自定义操作中使用它,例如 MyApplication.exe.但我建议为两个文件定义自定义操作,例如

<CustomAction Id="RunuEye64_47100_WHQLexe" FileKey="uEye64_47100_WHQLexe" ExeCommand="" Return="ignore" Impersonate="yes"/>

因为它可以直接使用而不会弄乱 WixShellExecTarget 属性;-)

发布部分 UI 将是

Event="DoAction"值="RunuEye64_47100_WHQLexe">

I have a C# application with a wix setup. I have customized the ExitDialog with 2 checkboxes (following this), on used to run my application, the other one to run an optional install (for uEye camera).

The first checkbox is :

<!-- Set checkbox for launch my application -->
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch $(var.product)"/>    
<CustomAction Id="SetExecVR3" Property="WixShellExecTarget" Value="[#MyApplication.exe]"/>
<CustomAction Id="DoExec" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" Return ="ignore"/>    

The second :

<!-- Set checkbox for launch install uEye -->
<Property Id="WIXUI_EXITDIALOGUEYECHECKBOXTEXT" Value="Launch install uEye"/>    
<CustomAction Id="SetExecUEye" Property="WixShellExecTarget" Value="./Resources/uEye64_47100_WHQL.exe"/>

And there is my Wix UI (this helped me):

<UI>
  <UIRef Id="WixUI_Custom"/>
  <Publish Dialog="MyExitDialog"
           Control="Finish" 
           Event="DoAction" 
           Value="SetExecVR3">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
  <Publish Dialog="MyExitDialog"
           Control="Finish" 
           Event="DoAction" 
           Value="DoExec">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>

  <Publish Dialog="MyExitDialog"
           Control="Finish" 
           Event="DoAction" 
           Value="SetExecUEye">WIXUI_EXITDIALOGUEYECHECKBOX = 1 and NOT Installed</Publish>
  <Publish Dialog="MyExitDialog"
           Control="Finish" 
           Event="DoAction" 
           Value="DoExec">WIXUI_EXITDIALOGUEYECHECKBOX = 1 and NOT Installed</Publish>
</UI>

There is my Setup :

The check bock for MyApplication.exe works good, the other one didn't. The generation didn't copy uEye64_47100_WHQL.exe in local directory and when I check the option nothing append.

I'm beginning with WiX, what did I miss ?

Edit:

Now I have a component with the .exe. The file is copied but I'm unable to run it. In log with msiexec I Have :

MSI (c) (C4:B8) [12:45:35:109]: Note: 1: 2228 2: 3: Error 4: SELECT Message FROM Error WHERE Error = 1721 Info 1721.There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor. Action: SetExecUEye, location: C:\uEye64_47100_WHQL.exe, command:

I don't understand this error, and I don't know why the file is in C:\ (I used SourceDir to locate it)

Edit2:

The component created:

  <Component Id="uEye64_47100_WHQLexe" Directory="TARGETDIR" Guid="{1BD47632-42D5-4C56-B207-1E6B1005488C}">
    <File Id="uEye64_47100_WHQLexe" Source="./Resources/uEye64_47100_WHQL.exe" KeyPath="yes" Checksum="yes" Compressed="no" Vital="no"/>
  </Component>

And the directory:

<Fragment>
  <Directory Id="TARGETDIR" Name="SourceDir">
    <Directory Id="ProgramMenuFolder">
      <Directory Id="ApplicationProgramsFolder" Name="$(var.compagny)"/>
    </Directory>
    <Directory Id="DesktopFolder" SourceName="Desktop"/>
    <Directory Id="ProgramFilesFolder">
      <Directory Id="PRODUCTFOLDER" Name="$(var.compagny)">
        <Directory Id="INSTALLFOLDER" Name="$(var.product)">            
          <Directory Id="fr" Name="fr"/>   
        </Directory>
      </Directory>
    </Directory>
  </Directory>
</Fragment>

How can define uEye64_47100_WHQLexe to be copied only in my release folder ? TARGETDIR is set to C:\

解决方案

You must create another component for your uEye64_47100_WHQL.exe as for your main .exe, if you want to copy it and run on installation. If it is located only in Resource folder, it can be referenced only at the time of compilation as File source, because it is not added to installer itself. So create component like

<Component Id="uEye64_47100_WHQLexe" Directory="APPLICATIONFOLDER" Guid="*">
    <File Id="uEye64_47100_WHQLexe" Source="./Resources/uEye64_47100_WHQL.exe" KeyPath="yes" Checksum="yes" />
</Component>

and then you can use it in custom action using WixShellExec like for MyApplication.exe. But I would advise to define custom action for both files like

<CustomAction Id="RunuEye64_47100_WHQLexe" FileKey="uEye64_47100_WHQLexe" ExeCommand="" Return="ignore" Impersonate="yes" />

because it can be used directly without messing with WixShellExecTarget property ;-)

Publish part of UI will than be

Event="DoAction" 
Value="RunuEye64_47100_WHQLexe">

这篇关于无法在 Wix 设置中启动 .exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆