This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Sql Script Conditional Statement during patch
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
‎Aug 03, 2008
09:22 PM
Sql Script Conditional Statement during patch
Hello guys.
I developed a Web project with some SQL Scripts.
I made an upgrade and also a Patch named "PatchConfiguration1".
I want some sql scripts to be executed during the patch and not during the firs install or reinstall, only with the patch execution.
I set the "reevaluate condition" option at the component section and wrote Patch = "PatchConfiguration1" at the "specify a conditional statement" on the runtime (sql script).
nothing happend, the script is not executed durint Patch.
What's wrong with the conditional statement?
Thanks a lot for your cooperation.
Ariel M.
I developed a Web project with some SQL Scripts.
I made an upgrade and also a Patch named "PatchConfiguration1".
I want some sql scripts to be executed during the patch and not during the firs install or reinstall, only with the patch execution.
I set the "reevaluate condition" option at the component section and wrote Patch = "PatchConfiguration1" at the "specify a conditional statement" on the runtime (sql script).
nothing happend, the script is not executed durint Patch.
What's wrong with the conditional statement?
Thanks a lot for your cooperation.
Ariel M.
(6) Replies
‎Aug 04, 2008
05:16 PM
Are you setting a property named PatchConfiguration1 at runtime? If not, the condition would evaluate to false and prevent the script from running.
You can create a verbose log of the patch installation to verify whether or not a property named PatchConfiguration1 is set or not.
You can create a verbose log of the patch installation to verify whether or not a property named PatchConfiguration1 is set or not.
‎Aug 04, 2008
08:21 PM
Hello Josh
I didn't set a property at run time. The PatchConfiguration1 is the name of the patch I created.
I just want to make reference to the patch in the conditional statement in Sql Script RunTime tab so I could run the script ONLY when the patch is executed.
Thanks a lot for your cooperation.
Regards
Ariel
I didn't set a property at run time. The PatchConfiguration1 is the name of the patch I created.
I just want to make reference to the patch in the conditional statement in Sql Script RunTime tab so I could run the script ONLY when the patch is executed.
Thanks a lot for your cooperation.
Regards
Ariel
‎Aug 05, 2008
10:25 AM
Windows Installer doesn't provide any particular property that is set only in a specific patch (at least not that I'm aware of). There is the PATCH property that is set when any patch is running.
You could try using a set property custom action sequenced early in the installation that sets a property unique to the patch that is running, conditioned on the PATCH property so that the custom property is only set when a patch is being installed (the value of the property or the property name could be changed with each patch).
You could try using a set property custom action sequenced early in the installation that sets a property unique to the patch that is running, conditioned on the PATCH property so that the custom property is only set when a patch is being installed (the value of the property or the property name could be changed with each patch).
‎Aug 05, 2008
11:18 AM
If the project uses Install Shield Script, you may want to try an alternative. I often use ADO objects to Create and Upgrade the database in our product. Here are a couple of links that might interest you.
Link #1
Link #2
Since you create the ADO objects yourself, you have a lot of control on where you start in the file. I have written ours to run a SQL batch script file to traverse it one SQL Statement at a time and execute it. This allows me to show a progress bar and if it errors, I know exactly what SQL statement errors and I get the SQL Server error message. I can then log it and ask the user if they want to continue or not. I have also built into my source code a tag that I can put into the SQL file that will stop in the middle of the file in case I need to run a data migration tool and continue where I left off. I have also built into the SQL file a database versioning system. So if I'm upgrading a database, I can find the starting point in the file and start executing the SQL scripts from that starting point.
So I hope I have sparked your imagination to the possibilities.
Link #1
Link #2
Since you create the ADO objects yourself, you have a lot of control on where you start in the file. I have written ours to run a SQL batch script file to traverse it one SQL Statement at a time and execute it. This allows me to show a progress bar and if it errors, I know exactly what SQL statement errors and I get the SQL Server error message. I can then log it and ask the user if they want to continue or not. I have also built into my source code a tag that I can put into the SQL file that will stop in the middle of the file in case I need to run a data migration tool and continue where I left off. I have also built into the SQL file a database versioning system. So if I'm upgrading a database, I can find the starting point in the file and start executing the SQL scripts from that starting point.
So I hope I have sparked your imagination to the possibilities.