Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在WIX中使用长命令行定义CustomAction?_Wix_Windows Installer_Custom Action - Fatal编程技术网

如何在WIX中使用长命令行定义CustomAction?

如何在WIX中使用长命令行定义CustomAction?,wix,windows-installer,custom-action,Wix,Windows Installer,Custom Action,我在wxs文件中定义了一个自定义操作: <CustomAction ExeCommand="long command line" FileKey="xyz.exe" Id="foo"/> 我收到了警告: 警告LGHT1076:ICE03:字符串溢出(大于长度 在第列中允许);表:CustomAction,列:目标,键: 使用长命令行定义操作的正确解决方案是什么?将长命令行指定给属性,然后在自定义操作中使用[property]。虽然一般来说,自定义操作是不受欢迎的。如果必

我在wxs文件中定义了一个自定义操作:

    <CustomAction ExeCommand="long command line" FileKey="xyz.exe" Id="foo"/>

我收到了警告:

警告LGHT1076:ICE03:字符串溢出(大于长度 在第列中允许);表:CustomAction,列:目标,键:


使用长命令行定义操作的正确解决方案是什么?

将长命令行指定给属性,然后在自定义操作中使用[property]。虽然一般来说,自定义操作是不受欢迎的。如果必须这样做,请使用WiX安静执行自定义操作功能。

经过多次尝试,我找到了解决方案。我将命令行拆分为多个属性

<CustomAction Id="action.prop0" Property="prop0" Value="first part with [INSTALLDIR]"/>
<CustomAction Id="action.prop" Property="prop" Value="[prop0] second part"/>
<CustomAction ExeCommand="[prop]" FileKey="service.exe" Id="myaction"/>
<InstallExecuteSequence>
  <Custom Action="action.prop0" After="InstallFiles"/>
  <Custom Action="action.prop" After="action.prop0"/>
  <Custom Action="myaction" Before="InstallFinalize"/>
</InstallExecuteSequence>


可以为您提供解决方案的想法。下面是。如果我想设置一个属性,那么我会收到:警告CNDL1077:该属性的值中包含“[INSTALLDIR]”,这是对另一个属性的非法引用。要使用另一个属性的值设置属性,请使用带有属性和值属性的CustomAction。*如果我使用CustomAction,那么我就有了最初的问题。在这种情况下,您需要在InstallExecute序列中的CostFinalize之后使用SetProperty自定义操作。然后,您必须在该属性之后使用该属性。SetProperty是类型为property的CustomAction的shourcut。有相同的长度限制。