"Richard Wilde" <[EMAIL PROTECTED]> writes:

> I have a property called [MAXIMIZERDIR] which the user has browsed to using
> a custom dialog. 
>
> I want WIX to automatically append a backslash to the end of this property
> if it does not already have one.

This can be done just with the Windows Installer tables.
You need not use any WiX-specific custom actions.
To append the backslash, you can use a Formatted string that
consists of a reference to the property and the backslash.
And to check whether the backslash is there already, you can
use a Condition.

Formatted:
http://msdn2.microsoft.com/library/aa368609.aspx

Conditional Statement Syntax:
http://msdn2.microsoft.com/library/aa368012.aspx
">>       TRUE if left string ends with the right string."

If you want to append the backslash when the user clicks a
PushButton in one of your dialog boxes, you can put this inside
the Control element:

<Publish Property="MAXIMIZERDIR" Value="[MAXIMIZERDIR]\"
  ><![CDATA[NOT (MAXIMIZERDIR >> "\")]]></Publish>

If you instead want to append the backslash during an execution
sequence, so that it happens even in a silent installation, you
must do it in two parts: first define a custom action that
actually appends the backslash, and then refer to it from within
a sequence table, with a suitable condition.

<CustomAction Id="AppendBackslashToMAXIMIZERDIR"
              Property="MAXIMIZERDIR" Value="[MAXIMIZERDIR]\"/>

<Custom Action="AppendBackslashToMAXIMIZERDIR" After="whatever"
  ><![CDATA[NOT (MAXIMIZERDIR >> "\")]]></Custom>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to