1

I need to create an installer for a web project in VS with Microsoft Visual Studio 2015 Installer Projects where the user who performs the installation the installer asked for the data of connection to the database with two textbox, in these 2 textBox i need the user through a "Test Connection" button to verify this connection before the user continues to the next step of the installation.

enter image description here

How can I do this button in the installer and apply the logic to validate if the connections that the user entered in the installer are correct?

looks like

enter image description here

thank you very much I am new in this

am using Visual Studio 2015 Proffessional

PhilDW
  • 20,260
  • 1
  • 18
  • 28

2 Answers2

3

There's no support in Visual Studio setup projects for validating user input in that UI sequence. In other words VS setup projects don't support custom action calls from the UI sequence (although other tools do).

It's common for this type of thing to be delegated to the setup, but in practice it often works better to just let the app install and then have the app do the configuration and any testing of IP addresses. After all I doubt that the install needs that IP to be up and running, it's the app that needs it.

Also, there may be a need for the IP to change, or the user and password. And if you actually entered a user name and password into that dialog there is no support in VS setups for securing that data, therefore the password is exposed.

PhilDW
  • 20,260
  • 1
  • 18
  • 28
  • Thank you for your answer, you are right it is not very common for these configurations to be in an installer configuration, however, the installer after install does modifying the web.config and replaces the connection chains for those exposed in the configuration PANE, then they would only be applied once (in that case it would touch to make a GUI where the user can edit the connection chains) in case the parameters do not work – Herman Andres Figueroa Apr 11 '18 at 01:03
1

I agree with Phil, but I was just thinking: if there is no application to launch (if you are deploying a web app), then perhaps you can just make yourself a little launcher.exe that pushes a command line to msiexec.exe (Windows Installer Installation Engine) with the required data and then kick the install off in silent mode and avoiding all the setup GUI issues and complexities?

So your launcher EXE would do all the GUI (familiar territory), and you just run the setup itself in silent mode, pushing a command line along these lines:

msiexec.exe /i Setup.msi /QN /L*V "C:\msilog.log" USER="User" PASSWORD="Pass" IP="0.0.0.0" REBOOT=ReallySuppress

I am not really familiar with this project type - I guess a launcher.exe conflicts with the pre-requisite setup.exe launcher that is already there for installer projects? The one which downloads and installs pre-requisites?

Perhaps you could encrypt the password in your launcher.exe and add a custom action in deferred mode in the MSI which will decrypt the configuration data and write it somewhere. Ideally you would use NT authentication I guess - avoiding the whole password / username issue.

Overall I would recommend using WiX instead of these installer projects. Though complicated, WiX is fully capable of all kinds of features - even if GUI is always complex when it comes to MSI. UPDATE: I should also add that WiX features its own launcher / bootstrapper / chainer feature called Burn. It is basically supporting the launching of MSI files in silent mode from a GUI you create yourself (or you use the default one) - much in the way I described above (with far more additional features). Maybe have a look at the "Building Installation Package Bundles" section.

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164