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

RUn script only during first install and not during patch

I have a BasicMSI Project.
I have cretaed a patch project of this msi.
Now in the sql server scripts , I want to run only the scripts that are not rum in the first install . How can this be checked?
What condition has to be given in the script condition so that the scripts will run either in the first install or in the patch?
Labels (1)
0 Kudos
(10) Replies
hidenori
Level 17

You may want to try "Not Installed And PATCH".
0 Kudos
NamitaB
Level 5

I have tried this That is I wrote
Not Installed And PATCH in the script condition but it didnot worked .

Is there anything wrong in the statement or the case of the condition is wrong..
0 Kudos
irenejia
Level 4

Not Installed and Not PATCH
0 Kudos
NamitaB
Level 5

What will be the condition if i want ot run a script only during patch
0 Kudos
hidenori
Level 17

Try just "PATCH" and see if it works.
0 Kudos
NamitaB
Level 5

Thanks , it worked.

I have now a different requirement.
I have sveral scripts in the SQL Scripts and I want to run this scripts in the patch based on centain keys from registry.
That is Suppose I have 10 scripts in the main installer .

I want to run the first 5 scripts in the first run and the rest of the scripts will be run on patch..
That is depending on the keys in the registry , is it possible to provide a condition with to the scripts whether it will be run or not in the patch installer.

Please help...
0 Kudos
hidenori
Level 17

You may want to try using a system search that will set the existing value of a registry to a Windows Installer property. You can use the property for the condition of your SQL scripts.
0 Kudos
NamitaB
Level 5

Thanks for ur reply...
One more query---
Can I tag the scripts added to the main installer with the registry keys.
That is,
When i addd the scripts I provide some tag in the scripts with the new registry keys or the vice versa that is when an script is run for a particular patch or first time installation , then can i set any value in the script depending on which , I provide condition, so that the script is not run in the next patch??
Please help...
0 Kudos
skutnar
Level 4

NamitaB wrote:
Thanks for ur reply...
One more query---
Can I tag the scripts added to the main installer with the registry keys.
That is,
When i addd the scripts I provide some tag in the scripts with the new registry keys or the vice versa that is when an script is run for a particular patch or first time installation , then can i set any value in the script depending on which , I provide condition, so that the script is not run in the next patch??
Please help...


Instead of relying on registry keys and the installer, why not have some kind of version table in your database? Each script would first query the version table and determine what, if any, other code to run.
0 Kudos
NamitaB
Level 5

I have used the Schema version and it worked.
0 Kudos