cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
landsharkdaddy
Level 2

Conditional Prerequisite

I have a Basic MSI project that I want to check whether a user exists on the current system before installing PostgreSQL. I created a Redistributable package for PostgreSQL that just uses a command line to execute the PostgreSQL MSI package. This package creates the user on the local system. The problem is that if this user exists the installation will fail. I wrote a managed DLL in C# that can check for the user on the local system and created a custom action that puts its result in a variable called POSTGREEXISTS.

What I am trying to do is to run this custom action to set the variable and then check the variable to see if I should run the PostgreSQL redistributable or not. Any help on this or a better way to do this would be so appreciated.
Labels (1)
0 Kudos
(2) Replies
landsharkdaddy
Level 2

Sorry about the posting again....any ideas on how to resolve this problem?
0 Kudos
MichaelU
Level 12 Flexeran
Level 12 Flexeran

The only way InstallShield supports this would be with a Feature Prerequisite. This will run the prerequisite after the initial UI is shown; by conditionally installing the feature, you choose whether the associated prerequisite will be installed. In your case, however, it sounds likely you may prefer to exit with a message when this user exists, rather than installing without Postgres, at least if Postgres is truly a prerequisite for your software.
0 Kudos