PDA

View Full Version : Bitwise Operators - MSI



trevrobwhite
07-16-2007, 06:10 AM
Does anyone know how bitwise operators should be entered into a Custom action condition, I want a custom action to launch if my UILevel is 4 but optionally to also run if the bitwise operators 32 or 128

Thanks.

bryanwolf
07-16-2007, 12:05 PM
The only valid values for UILevel are 2, 3, 4, and 5.

However, Microsoft documents the Conditional Statement Syntax for MSI conditions here:
http://msdn2.microsoft.com/EN-US/library/aa368012.aspx

trevrobwhite
07-17-2007, 05:03 AM
The only valid values for UILevel are 2, 3, 4, and 5.

However, Microsoft documents the Conditional Statement Syntax for MSI conditions here:
http://msdn2.microsoft.com/EN-US/library/aa368012.aspx

You can also have 32, 64 and 128 as bits on these values, often people who use my installer Hide the Cancel button using 32, which is why I raised the question

RobertDickau
07-17-2007, 12:25 PM
I think it's a pair of confusing names: the value of Installer.UILevel (which you can query in a script custom action) can contain those bit flags, but the UILevel property (in a script using Session.Property, or used directly in a component/action/whatever condition) from the supports only the list of values that Bryan mentioned.

P.S. There are also MsiUIHideCancel and MsiUIProgressOnly properties that might be of use.

trevrobwhite
07-18-2007, 03:34 AM
Ah thanks Rob, I saw in help "Conditional Statement Syntax" Bitwise numeric operators and thought they applied to that property.

Out of interest how to you use the Bitwise numeric operators as I don't really understand the help, these are the operators ><, << and >>

Cheers.

RobertDickau
07-18-2007, 09:44 AM
From memory I can't think of any properties that are bit flags, but the general format seems to be a><b. If I add two text controls to InstallWelcome with text "1><2" and "1><3", and then add identical conditions to Disable control events for the two text controls, at run time the first one is still enabled (the condition failed) and the second disabled (condition succeeded).

Likewise, a silly way to detect if the target system is a Windows NT-based server of some sort might be to use MsiNTProductType><2.

And the other operators, << and >>, seem to be analogous to HIWORD and LOWORD from InstallScript; useful if you wanted to pull apart a language ID, perhaps?

trevrobwhite
07-18-2007, 09:51 AM
Thanks for that your a star