Wix Stop Installation Condition On Property

Posted on  by  admin
Wix Stop Installation Condition On Property 5,0/5 7675 reviews
  • USING A WIX BOOTSTRAPPER PROJECT TO INSTALL PREREQUISITES Why use a WIX Bootstrapper project? In our project there are so many things that we need to install before our software will be installed. At that time we can use this to bundle the prerequisites (like.Net Framework, SQL etc.) of Software or Website.
  • Install location and custom server name are persisted across upgrades Install location and server name can be specified on the msiexec command line Displays a license agreement in RTF format Easily localizable (including the license agreement), all relevant strings in per-language WXL files Uses the upgrade logic introduced with WiX 3.5.

I want to use an MSI installer property in a condition message in a WiX installer. This MSI property is set by a C++ custom action. I can set and get the same MSI property and value before calling the condition message, but it is failing when I use it in condition message.

My condition message is looks like

WiX (Windows Installer XML) is a set of tools that allows the creation of Windows Installer-based deployment packages for your applications. Microsoft uses WiX to deploy its own software, including Office and Visual Studio. Sending errors that stop the installation. In our case, the install condition uses RegistrySearch to check if the.

Here this MyProperty is a string and returns either YES or NO, and it is set by C++ CA and this condition is failing in both cases. But I want to show this message only when the MyProperty is set to 'NO'.

So how do I use my custom MSI property in a condition message that was set by a custom action?

Peter Mortensen
8,46516 gold badges61 silver badges85 bronze badges
AnnaAnna

Wix Feature Condition

2 Answers

I would try to UPPERCASE the property MyProperty to make it a PUBLIC property, and then I would also declare it in your WiX source via a Property Element and set the Secure attribute to Yes and see if that helps. The WiX markup:

I would also retrieve the property after you set it in your C++ custom action to determine if it has been set correctly (it could be blank). Using VBScript you can retrieve the property very easily. Here is a sample (VBScript helps avoid any compilation and you can embed the source in the custom action - great for testing purposes - and use it only for testing purposes):

As a WiX element, something like this (can't test right now - give it a try - remember to insert in the InstallUISequence or InstallExecuteSequence):

I believe this should help you sort out what the problem really is.

You can use the WiX Property element to test the condition by hard coding a value outright (in case the C++ code set property call is the problem). The following should make your launch condition evaluate to false (triggering the message you specified to show):

Wix stop installation condition on property managementStein ÅsmulStein Åsmul
8841 gold badge12 silver badges22 bronze badges

Coding questions are better placed on https://stackoverflow.com/

The answer to this question is a lot more complicated than it should be. Please check if this post gets you going in the right direction, and I will check back to see if your problem was solved: https://stackoverflow.com/questions/3252448/visual-studio-deployment-project-customactiondata

In addition to what that question mentions, make sure your property is listed in the delimited list of 'secure properties' in the SecureCustomProperties Property.

All this complexity stems from Windows Installer's complex 'elevated priviledges' concept that allows non-administrator users to install with elevated rights at times. For this to work no properties can be accessed directly in the transaction that runs with elevated rights, and you must specifically write their value into the execution script and retrieve them in a rather exotic way as you will see in the linked articles. It involves reading back a property called CustomActionData.

Finally, and importantly; post on stackoverflow.com also. WiX may have a more advanced way to deal with this complexity at this stage that I am not aware of. Some sort of automagic.

Community
Stein ÅsmulStein ÅsmulWix burn
8841 gold badge12 silver badges22 bronze badges

Not the answer you're looking for? Browse other questions tagged installationwindows-installationwindows-installer or ask your own question.

Coments are closed
Scroll to top