This worked fine for us inside OnDetectComplete on Wix 3.8 (released
version).  For example :

        // Check if Acrobat is installed by reading variable.
        LPWSTR sczAcrobatValue = NULL;
        BalGetStringVariable(L"AcrobatInstalled", &sczAcrobatValue);
        BalExitOnFailure(hr, "Failed to get AcrobatInstalled burn
variable.");

        // Show warning state if Acrobat variable is empty.
        if ((sczAcrobatValue == NULL) || (wcslen(sczAcrobatValue) == 0))
        {
             hr = m_pEngine->SetVariableString(L"AcrobatWarningState", L"");
             BalExitOnFailure(hr, "Failed to set AcrobatWarningState burn
variable.");
        }

AcrobatInstalled is read using Util: registry searches, and
AcrobatWarningState just controls visibility of a warning text box in our
custom theme.  What specifically "doesn't work" ?


David Burson wrote
> In the bundle I’ve tried 
> <Variable Name="MyVariable" Value="MyValue" />
> , and tried reading it in bafunctions.dll with
>     LPWSTR my_variable = NULL;
>     BalGetStringVariable(L"MyVariable", &my_variable);
> 
> But that doesn’t work.  Is there any way to do it?
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website,
> sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for
> all
> things parallel software development, from weekly thought leadership blogs
> to
> news, videos, case studies, tutorials and more. Take a look and join the 
> conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> WiX-users mailing list

> WiX-users@.sourceforge

> https://lists.sourceforge.net/lists/listinfo/wix-users





--
View this message in context: 
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/how-to-define-a-custom-variable-in-bundle-wxs-and-get-its-value-in-BAFunctions-dll-tp7599844p7599846.html
Sent from the wix-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to