3

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?

Horcrux7
  • 23,758
  • 21
  • 98
  • 156
  • [This post](http://stackoverflow.com/questions/10089352/what-is-the-maximum-length-of-a-string) can give you an idea of a workaround. And here are [some more details](http://stackoverflow.com/questions/16460325/ice03-string-overflow-greater-than-length-permitted-in-column-table-customa). – Yan Sklyarenko Jul 08 '15 at 12:25

2 Answers2

7

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>
Horcrux7
  • 23,758
  • 21
  • 98
  • 156
2

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.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • If I want set a Property then I receive: warning CNDL1077 : The Property contains '[INSTALLDIR]' in its value which is an illegal reference to another property. To set a property with the value of another property, use a CustomAction with Property and Value attributes. * If I use CustomAction then I have the original problem. – Horcrux7 Jul 08 '15 at 14:39
  • 1
    In that scenario you need to use a SetProperty custom action scheduled after CostFinalize in the InstallExecute sequence. Your use of that property then has to be after that. – Christopher Painter Jul 08 '15 at 14:41
  • SetProperty is a shourtcut for a CustomAction of type Property. There is the same length limit. – Horcrux7 Jul 09 '15 at 15:00