Wednesday, November 13, 2013

Handling multiple SQL Connections in InstallShield

If you ever have the need to deploy multiple databases using InstallShield, you might have noticed that it does not have an out-of-the-box capability to deploy multiple end-user Dialogs corresponding to each of the database connections.

There is an older InstallShield article which addresses this issue, however, it does not seem to apply to InstallShield 2013 since the behavior is a bit different: http://kb.flexerasoftware.com/selfservice/viewContent.do?externalID=Q111493

However, there is an option to workaround this deficiency in InstallShield:


  1. From the Tools-->Options dialog in InstallShield, click on the SQL Scripts tab
  2. In the SQL Scripts tab, select the checkbox for "Generate unique Windows Installer properties for new connections"
  3. This will allow new properties to be generated for each individual SQL Connection that is created in the SQL Scripts view.  These new properties can be viewed in Property Manager.


Well, as I stated earlier, you will still need to ensure that you have at least 1 instance of the SQLLogin and SQLBrowse Dialog.

You can generate this SQLLogin Dialog as part of your Dialogs view, by clicking on the link for End-User Login Dialog in the SQL Scripts view:



Once you have the SQLLogin Dialog created in your Dialogs view, you can right click on the SQLLogin Dialog and Clone the Dialog by right clicking on the SQLLogin Dialog and selecting "Clone".  


In the newly cloned SQLLogin Dialog, you can now edit the individual properties that are bound to each of the controls in the Dialog to match each of the properties that you earlier viewed in Property Manager.



Finally, don't forget that you have to also correct all of the Events in the Back and Next buttons for the newly cloned SQLLogin Dialog so that the secondary SQLLogin dialog displays correctly in the Custom Actions and Sequences view!


In addition, you will also have to Clone the SQLBrowse Dialog, otherwise, the Browse action will not work when you click on the Browse... button on each of the respective dialogs:

  1. Clone the SQLBrowse Dialog
  2. On the newly cloned SQLBrowse Dialog, click on the Behavior icon
  3. Click on the OK button and change the Events for the OK button to point to the respective SQL Server and Database properties on the cloned SQLLogin Dialog.
  4. Now, navigate to the Behavior for the cloned SQLLogin Dialog
  5. Click on the BtnDbBrowse and change the Events to point to the Database property for the cloned SQLLogin Dialog.  Also change the SpawnDialog argument to point to the secondary SQLBrowse Dialog.
  6. Click on the BtnSQLBrowse and change the Events to point to the SQL Server property for the cloned SQLLogin Dialog.  Also change the SpawnDialog argument to point to the secondary SQLBrowse Dialog.
  7. Verify that the changes to the User Interface now work for both of the SQLLogin Dialogs.



10 comments:

  1. Hi samira vaidya,

    thanks to written as per my request i will implement as of your article, can u suggest me: in between installation my poweshell also raised, instead of this i need(installation as like database promt) to one more dialog box(textbox,button)--where i will specify the -->http://hostaddress:80, submit button.-------->wsp should be deployed there.---i am googling now

    --slient installation not accepted my team lead.

    ReplyDelete
    Replies
    1. You should provide an InstallShield Dialog Box where you prompt for the necessary values. You can then store those values by assigning the appropriate controls to Properties (which you have created in Property Manager). You can then use properties as parameters to your PowerShell script when invoking your PowerShell through the EXE Custom Action at the command line.

      Delete
    2. thanks, i will the way, you guide me. may i know your number to talk to u once. plz send me number to replied mail id....wait for your reply.

      Delete
  2. Hi vaidya,
    i was taken dialog box, but not getting how to do this, becauese i no need to build custom exe (becase we have built in windows powershell.exe) i need to pass 1. deployement powshell script & 2. deployement host(http://server:port)

    after installation i need to pass--->http://server:port(2)---as a parameter to-->powershell.(1).
    means--> powershell (which has Add-soluation "sampledemo.wsp" code).

    how to do this ?---plz guide me.

    ReplyDelete
    Replies
    1. powershell deployment code should be exist, but not be executed.
      when i send--->http://server:port only that existing code should be executed----->how to do it -->guide me--->according to guidness i will built my deplyment setup.

      Delete
    2. Check out this article: http://samirvaidya.blogspot.com/2013/11/installshield-2013-powershell-custom.html

      Also, if you are looking to deploy SharePoint Solutions, it might be worthwhile to take a look at Advanced Installer which has that capability built right in: http://www.advancedinstaller.com/

      Delete
    3. Hi vaidya, they ordered for installsheild licence, i need do this work using installshied only, can u say your mail id ? i will mail my requirement entirely.

      Delete
    4. Please provide ur e-mail address here, I can send u an e-mail if u wish to communicate further.

      Delete
  3. kasibabu84@gmail.com, waiting for replay sir,

    ReplyDelete
  4. Hi ssvidya

    emial : kasibabu84@gmail.com

    waiting for reply your reply,

    ReplyDelete