Horcrux7
Horcrux7

Reputation: 24477

How to define a CustomAction with a long command line in WIX?

I have define a custom action in my wxs file:

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

and I receive the warning:

warning LGHT1076 : ICE03: String overflow (greater than length permitted in column); Table: CustomAction, Column: Target, Key(s):

What is the right solution to define an action with a long command line?

Upvotes: 3

Views: 1541

Answers (2)

Horcrux7
Horcrux7

Reputation: 24477

After many time I have find a solution. I split the command line into multiple properties.

<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>

Upvotes: 7

Christopher Painter
Christopher Painter

Reputation: 55600

Assign the long command line to a property and then use [PROPERTY] in the custom action. Although EXE custom actions in general are frowned upon. If you must do it use the WiX Quiet Execute Custom Action feature.

Upvotes: 2

Related Questions