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.


Answer Summary:
0 Comments   [ - ] Hide Comments


Please log in to comment

Community Chosen Answer



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.

Answered 07/06/2012 by: pjgeutjens
Red Belt

  • You have to keep the custom action in 'No Sequence' which causes this action to not run unless an event invokes it.
  • 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
  • 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!
Please log in to comment
Answer this question or Comment on this question for clarity



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


Answered 07/05/2012 by: SMal.tmcc
Red Belt

  • 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!
  • 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.
Please log in to comment