[wix-users] Custom Action to set a Wix Variable

Brian Enderle brianke at gmail.com
Mon Sep 21 04:52:36 PDT 2015


Example using variable as a condition:

In the custom action:

                    session["FOXPROPATH_VALID"] = "1";

and in your wxs file:

          <Publish Event="NewDialog" Value="VerifyReadyDlg"
Order="4"><![CDATA[FOXPROPATH_VALID = "1"]]></Publish>




Example updating an XML file element with variable:

In the custom action:

            session["ENCRYPTED_PASSWORD"] =
PasswordConfig.encryptPassword(_password);

and in your wxs file:

      <util:XmlFile Id="UpdateEncryptedPassword"
                    Action="setValue"
                    File="[CONFIGFOLDER]config.xml"
                    ElementPath="//DelphiaConfig/DatabaseInfo/Password"
                    Value="[ENCRYPTED_PASSWORD]"
                    Sequence="3" />



Brian

If you can't explain it simply, you don't understand it well enough.  -
Albert Einstein

On Mon, Sep 21, 2015 at 7:24 AM, Sanket Panchamia <psanket at gmail.com> wrote:

> Hi,
>
> Is there a way to write a custom action (c# or vb) that sets a variable
> that
> can be used back in the main wix project.wxs file?
>
> Thanks
> --
> Regards
> Sanket Panchamia
> +91-9742836299
>
> <https://twitter.com/p_sanket>  <http://www.facebook.com/spanchamia>
> <http://www.linkedin.com/in/psanket>
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>



More information about the wix-users mailing list