Microsoft Visual Studio 2015 Installer custom button - visual-studio

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.
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
thank you very much I am new in this
am using Visual Studio 2015 Proffessional

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.

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.

Related

Microsoft Visual Studio 2017 Installer Project template how to prompt the end user to restart their PC once installation is complete?

I need to prompt users to restart their PC after installing a program. I have created a MSI installer using the Microsoft Visual Studio 2017 Installer Project template.
There is no option in the project properties to prompt for restart once the installation is complete, and I have searched high and low on the web but am unable to find a way to configure the installer project to do this.
Is there no option I can configure for this in the installer project?
Do I have to write some code for a Custom Action to do it?
I have to do a reboot after install, as the software will be running in a corporate environment, and will run on machines that do not have admin rights. The software adds a reg entry that enables it to automatically start with windows. I have found that when I start the software from installer upon successful completion, it does not have access to certain paths in the user dir, that it does have access to when it starts with windows.
Thanks for your time.
Windows will reboot the PC if it's actually required for the installation to complete, so it may be worth explaining why you need the reboot. For example if it's needed to start a service just start it yourself in an installer class override.
The simplest way to do this is to open the MSI file with an MSI editor such as Orca, go to the InstallExecuteSequence table and add a new row, with the Action ScheduleReboot (case-sensitive) just after CostFinalize (although the location isn't too important) with a condition of Not Installed.
https://msdn.microsoft.com/en-us/library/windows/desktop/aa371527(v=vs.85).aspx
That'll give you the standard message asking for the reboot. If you must be more aggressive, use the ForceReboot action instead after InstallFinalize.
The condions need to be chosen wisely otherwise you'll get a reboot on every action, such as repair and uninstall.
Visual Studio setup projects have limited functionality when compared with other tools such as InstallShield, WiX, Advanced Installer and so on. That's why this isn't an option in the IDE.

How to deploy Outlook 2013 add-in with simplest installation

I am currently using ClickOnce to deploy the simple Outlook 2013 Add-in I developed.
It seems like it will generate a folder with 3 files inside. Users have to open the folder and run the setup.exe file, the popup windows will require users to click "install" to finish the installation steps.
Since I am fairly new to .Net framework, and my team asks me to find out a better solution when installing the add-in that users only need to click one file and get everything set up. Because we hope the users can only go through very simple process to set up the add-in.
Do you think is there any way that I can deploy my add-in to have only one file generated and users can click that to install without any windows pop up?
Many thanks.
All possible options for deploying Office add-ins are described in the Deploying an Office Solution section in MSDN.
Note, you can call VSTOInstaller directly with the /i /s flags for a silent installation. See ClickOnce and Silent mode installation and How to install ClickOnce app without prompting the user? for more information.
In case MSI installer you are able to use the /quiet or /qn options with msiexec to perform a silent install. Read more about that in Silent installation of a MSI package.

Visual Studio MSI Installer - Not making registry changes

I created a Visual Studio MSI Project that runs an custom EXE (which is good). In this exe, there is some code to add additional registry changes to add entries into Internet Options (mainly Local Intranet and Trusted Sites under Security). When the exe is run by itself (and in the debugger), it executes as expected (and puts the correct registry entries in their correct location). However, when the MSI executes the exe file, this part gets ignored even though it runs (I've added Console.Writelines everywhere).
I've been beating my head over this for 2 days and if anyone has had experience with this, a correct direction would be great.
I am using Visual Studio 2013.
Shelling out to an EXE from an MSI is not considered "good". As I recall, one of the many limitation of Visual Studio Deployment Projects (.VDPROJ) is that custom actions are scheduled with impersonation. If the MSI is being invoked from a standard user context UAC elevation won't help because the standard user context is impersonated.
If you want a reliable, best practices based installer, you should use the Registry table. Of course the problem there is another one of the annoying limitations of VDPROJ is that every registry value is a key file of it's own component and you quickly get into self repair hell.
I'd really suggest starting over with another toolset. I can think of several good ones.
I didn't realize that there is a "Registry On Target Machine" option inside of the MSI builder for Visual Studio. All I had to do is right click the project > view> Registry.
There I just had to map out the values in the right places.
Thank you for everyone who answered.

How to let MSI reboot without user interaction before installation finished?

I'm building the MSI using Visual Studio Installer Project. One requirement I have is automatically reboot system before installation finished. By saying 'automatically', I mean there is no customer interaction, e.g. click a button to trigger the reboot. Also, the reboot should to be suppressable by /norestart option to the msi.
I tried to edit MSI with Orca by adding the property REBOOT = Force. But this will pop a yes/no windows for user to click. Reboot will happen only after user click yes, which is not automatically.
Also I tried to call Win32 API InitiateSystemShutdownEx to initiate the reboot. But in this case, I can't disable the reboot by /norestart option.
Take a look at REBOOTPROMPT property
If the REBOOTPROMPT property is set to Suppress (or just S) any reboot
performed by the Windows Installer happens automatically without
interaction from the user. Setting this property does not initiate a
reboot if one is not needed, it only suppresses the display of any
prompts for reboots to the user.
BTW, one of the many shortcomings of Visual Studio setup projects is they don't give you a place to author this. You have to postbuild hack the MSI using ORCA or some script if using CI builds. It's like using ILDASM to tweak a DLL because VB.NET didn't support something. The more elegant solution is to use a tool with better Windows Installer XML support such as Windows Installer XML.

Windows Installer - Silently Installing Prerequisites

So here is my dilemma. I need to create an install for an office addin that can be pushed out to the company through AD/Group Policy. I have to work with the following limitations:
All prerequisites have to be installed, silently
Everything needs to be done via one executable (so we're
bootstrapping the prerequisites)
All of this is going to have to be wrapped in an MSI so our sys
admins can push it out through GPO.
I've managed to get the exe set up, and it works except that the prerequisites are not being installed silently (I'm calling "setup.exe /qn"). I'm still having to accept the EULA for the "Visual Studio 2010 Tools for Office Runtime" install. I've done quite a bit of searching and managed to find this article http://blogs.msdn.com/b/mwade/archive/2007/11/29/how-to-update-the-bootstrapper-to-accept-command-line-arguments.aspx which says I can't avoid the EULA but it was written in '07 and so I wanted to see if anything had changed or anyone knew of a way to do this.
Essentially what I'm asking at this point is how can I get the bootstrapper to do a silent install of the 2010 VSTOR so that users will not be prompted with the EULA.
Thanks for the help.
You can sometimes use Orca to manually modify installers and remove these types of dialogs.

Resources