cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
loyalp
Level 5

SQL Script conditional on Setup Type?

I have an InstallScript MSI project with 3 SQL Scripts that only need to run for specific Setup Types. I have been trying to set the condition on the Runtime tab, but so far I've only been able to either have the scripts run all the time or none of the time.

One thing I tried is basing it on a feature that is only installed when I want those scripts to run, so I used: &MyFeature = 3 That just made the scripts never run at all.

In the actual InstallScript I have a global variable that I set for the SetupType, but using that variable doesn't seem to affect the conditions at all.

What am I missing here?
Labels (1)
0 Kudos
(4) Replies
hidenori
Level 17

Do you associate the underlying components of your SQL scripts with the MyFeature feature? If not, please try that and remove the condition from your SQL scripts.
0 Kudos
loyalp
Level 5

How did I miss that? 😄

That seems to have worked well for 2 out of my 4 scripts, but the other 2 almost seem to be acting as if the condition is still present. I've checked the table and do not see them there or in the Runtime tab. Would it be prudent to just recreate those scripts from scratch?
0 Kudos
hidenori
Level 17

I would recommend you to generate a Windows Installer verbose log for the installation, and see why those scripts in question are not getting installed as expected.
0 Kudos
loyalp
Level 5

The verbose log didn't really show me anything amiss, but after deleting the sql scripts from the project, saving, and then adding them back in, everything seems to be working great now.

Thanks hidenori!
0 Kudos