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: BAsic MSI: Conditional execution of Sql Scripts
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 09, 2008
01:53 PM
BAsic MSI: Conditional execution of Sql Scripts
I am trying to use the Sql Scripts view to conditionally execute sql scripts
based on a property set to yes or no. this does not seem to work
either using the "run script during login" or "run script during install"
checkboxes.
My scripts seem to run as if no conditions were set up.
I would really like to use this way of doing things to take advantage of the string substitution facilities of this view.
What do I have to do to set up to run a sql script based on a value I retrieve from the registry during the UI sequence?
based on a property set to yes or no. this does not seem to work
either using the "run script during login" or "run script during install"
checkboxes.
My scripts seem to run as if no conditions were set up.
I would really like to use this way of doing things to take advantage of the string substitution facilities of this view.
What do I have to do to set up to run a sql script based on a value I retrieve from the registry during the UI sequence?
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 10, 2008
06:51 AM
I do not have extensive knowledge of this process but from the little that I have worked with this, you should be able to set the property in the sqlScript.sql Runtime tab.
For instance in a test that I setup I just added MYPROPERTY~="Yes". The tilde is the case insensitive operator. Now just make sure that the property table does not include a default value that could cause your script to fail.
Finally, run the setup with logging enabled and view the MSI log. Find the component name and see when that is being installed. Then see what the value of the property is prior to running the script. This should tell you definitively if the property is being honored.
For instance in a test that I setup I just added MYPROPERTY~="Yes". The tilde is the case insensitive operator. Now just make sure that the property table does not include a default value that could cause your script to fail.
Finally, run the setup with logging enabled and view the MSI log. Find the component name and see when that is being installed. Then see what the value of the property is prior to running the script. This should tell you definitively if the property is being honored.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 10, 2008
10:47 AM
Dan,
Thanks for the reply and the clue about using ~= operator.
It looks to me as if the conditional test in the sql script view when it looks like this: MCUPGRADEDB=1 succeeds
whereas if it looks like this: MCUPGRADEDB="1" it fails.
BUT in my installscript code I do
value = "1";
MsiSetProperty(hMSI, @MCUPGRADEDB, value);
make any sense?
Thanks for the reply and the clue about using ~= operator.
It looks to me as if the conditional test in the sql script view when it looks like this: MCUPGRADEDB=1 succeeds
whereas if it looks like this: MCUPGRADEDB="1" it fails.
BUT in my installscript code I do
value = "1";
MsiSetProperty(hMSI, @MCUPGRADEDB, value);
make any sense?