John_E
Level 4

Evaluating a condition that doesn't exist

I've been using installShield for many years and I'm quite used to adding conditions to my various features. For example I often test the value of the VersionNT property so that a feature can get installed on (say) XP but not on Windows 7.

Our app is entirely 32 bit but like most 32 bit apps it runs perfectly well on Win64. However, there's one specific component which doesn't need to be installed on a 64 bit system.

My understanding is that install conditions only get evaluated if they exist on the destination system. So if you test for a condition that doesn't exist, your component will get installed anyway.

According to something I read on Microsoft's MSDN site an MSI installer can find out if a condition exists before evaluating it. To test whether or not it exists you supposedly compare its value to an empty string (""). So in this particular feature I've added the following condition:-

VersionNT64=""

This should evaluate to TRUE if the user's OS is NOT 64 bit. I expected that the feature would now only get installed on Windows32 and NOT get installed on Windows64 (where VersionNT64 will usually be defined). But in fact my feature and its components get installed in both cases. Is there a way to achieve what I'm trying to do?
Labels (1)
0 Kudos
3 Replies
DebbieL
Level 17

I think you'll want to use one of the following as your component's condition:
VersionNT64 (to install the component on 64-bit systems)
Not VersionNT64 (to install the component on 32-bit systems)

To test whether a property exists, you need to simply use the property name as the condition. Include the Not operator if you want the condition to evaluate as true if the property is not set.
0 Kudos
John_E
Level 4

Thanks for the suggestion Debbie. It worked (if a little strangely).

Whenever I've needed to do this kind of thing in the past, I've tended to apply the condition to a feature, rather than to individual components. For example, if I wanted to install some components only on Windows Vista or above I'd create a new feature called (say) InstallVistaOrHigher and I'd set it to check for the condition VersionNT>599. I'd then just place any relevant components into that feature.

But VersionNT64 doesn't seem to work that way. I need to set it on the individual components rather than the feature. Does that make any sense to you? It did work but it's a departure from what I'm used to, so I found it a bit confusing.
0 Kudos
DebbieL
Level 17

Hmm. That's odd. In any case, I'm glad you got it working.
0 Kudos