Later I figured out that the separate thread is active during event calls. So I tried it during *DetectComplete *event and it worked. <br/> <br/> But before that, I had to parse *BootstrapperApplicationData.xml* file to get *WixBalCondition* elements and get the collection into an array e.g. BalConditions[].
Here is my code snippet: void BootstrapperApplication_DetectComplete(object sender, DetectCompleteEventArgs e) { string balCondtionMessages = string.Empty; bool balConditionStatus = true; foreach (var balCondition in bootAppData.BundleData.BalConditions) { if (!model.BootstrapperApplication.Engine.EvaluateCondition(balCondition.Condition)) { balConditionStatus = false; if (!String.IsNullOrEmpty(balCondtionMessages)) { balCondtionMessages = balCondtionMessages + '\n' + "- " + balCondition.Message; } else balCondtionMessages = "- " + balCondition.Message; } } if (!balConditionStatus) { SetbalConditionMsg(balCondtionMessages); } } This makes us parse for all conditions in our Bundle.wxs code, evaluate them and display the related message in our Custom Bootstrapper UI. Farrukhw wrote > Hi, > In my Managed Bootstrapper, I tried to call > Engine.EvaluateCondition("MY_PROG_FOUND"); in Run() method. But it never > evaluates and said something like: "This requires a running thread." and > it never evaluates. > > I'm trying to evaluate Bundle conditions in my managed bootstrapper but > still no luck. > > MY_PROG_FOUND is defined in Bundle code: > <util:RegistrySearch Id="PETRELINSTALLLOCATION" > Variable="MY_PROG_FOUND" > Root="HKLM" > Key="SYSTEM\CurrentControlSet\Control\Session Manager\Environment" > > Value="$(var.my_prog_env_var)" > Result="exists" > /> > > > <bal:Condition Message="[WixBundleName] required the installation of My > Program."> > > > </bal:Condition> > How can I use Engine.EvaluateCondition() in managed bootstrapper? Does > this requires to be called in a specific event, like DetectBegin()?? > > Any help would be really appreciated... > Thanks a bunch. -- View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Managed-Bootstrapper-Engine-EvaluateCondition-requires-separate-thread-tp7600793p7600836.html Sent from the wix-users mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users