Search code examples
c#visual-studio-2012custom-actionwindows-installerinstallshield-le

Add Condition to check operating system type for custom action in Visual studio Install Shield project


I have created a setup file of windows service. Along with that as a prerequisite, I have to install third party software in the target machine. This 3rd party software comes for 2 versions of OS type, 64 bit and 32 bit. I've included this in the custom action as shown below:

Setup

Now I want to add OS type condition to this installations, but I am not finding any option to add under condition as shown below:

Conditions

As you can see there isn't any option where we can type conditions explicitly. I've read that the condition to identify OS type is NOT VersionNT64 and VersionNT64 and to check whether its installed or not it would be NOT Installed etc., and you can specify it as a condition. But as I said earlier, I don't see any options as of where to specify this condition. Any suggestions or insights on this will be great helpful. Please let me know if any further details are required.


Solution

  • The condition builder is for launch conditions that will permit the install to proceed only if the OS condition is met. For conditions on custom actions use VersionNT64 in the Condition property of your custom action. The Installed property is for your product - Not Installed means that your MSI is not installed - it's nothing to do with OS versions or other products.

    These situations are usually dealt with using prerequisites and a bootstrapper to install those prerequisites first:

    https://msdn.microsoft.com/en-us/library/ms165429.aspx

    The problem with installing other setups from your setup is that they may fail if they are MSI-based because you cannot do recursive MSI installs (yours calling another).

    For different architectures it's also common (and usually necessary) to build two MSIs.

    https://blogs.msdn.microsoft.com/heaths/2008/01/15/different-packages-are-required-for-different-processor-architectures/

    So you would build a 32-bit MSI and a 64-bit MSI and then there is no choice involved - you just install the 3rd party software that goes with your MSI.