/build/static/layout/Breadcrumb_cap_w.png

Execute SQL command from MSI (Windows Installer Editor)

 

I am using Window Installer Editor 7.0 and have a .WSI. I need to execute a .sql file utilizing SQLCMD.exe. I need the user’s credentials which I get from a dialog window. I'd like to add an action to when the user clicks "Next >" it would launch my .sql (with the recently add credentials) and depending on the exit code, continue the installation or pop up a dialog.

 


0 Comments   [ + ] Show comments

Answers (2)

Answer Summary:
Posted by: pjgeutjens 11 years ago
Red Belt
1

You could create a dialog in your MSI to gather the user's data for the SQL login, link the data they enter to properties, then create a custom action to run the SQLCMD command, using said properties.

 

Be aware that if you want to run the custom action in deferred context you won't be able to access the property values, so you'll either want to make them available throuh the CustomActionData property, or run your CA in immediate context.

As a sidenote, if you have access to an AdminStudio installation, it contains custom tools for inserting SQL statements into an MSI installer.

EDIT: as a matter of fact, just noticed Wise has this too.. using an SQL connection dialog, the WISE_SQL_CONN_STR property and the SQL Server Scripts tool.


Comments:
  • You have to keep the custom action in 'No Sequence' which causes this action to not run unless an event invokes it. - jagadeish 11 years ago
  • true, I overlooked the part where you wanted to link the execution of the script to clicking the "Next" button. Tnx for pointing this out jadageish - pjgeutjens 11 years ago
  • This method would have worked perfectly. Our requirements actually changed as we decided that the program would run with Windows creds.

    I'll definitely save this as I'll use this logic elsewhere. Thanks! - mrwillya 11 years ago
Posted by: SMal.tmcc 11 years ago
Red Belt
-1

We use a program to create exe's to little tasks like this:

http://www.itninja.com/link/winbatch-create-installs-even-recording-mouse-clicks-if-needed


Comments:
  • Not quite what I was looking for. I am an installation developer and we need to handle everything through our MSI.

    That's a GREAT tool though! - mrwillya 11 years ago
  • It has saved us a lot of hassles in the academic world. Paired with PStools Remote Install we can have one tech image a room of 30 machines by themselves in 1 to 1.5 hours. - SMal.tmcc 11 years ago
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ