How do I create an installer that can install dependency software? - c#

Is it possible to create an installer where the user must install 'x' software before continuing with the installer? For example, if the user does not have the required software to use my own software, the installer will guide them through the set up and download the required software and then proceed to install my software as the final step?
I have never created an installer so I have no idea if this is possible.

Is it possible to create an installer where the user must install 'x'
software before continuing with the installer?
Best approach to handle this requirement is to create a Bootstrapper package and add required software as a prerequisite for the main application installer. First you have to install the bootstrapper manifest generater tool from the link i have provided below. Tool will autogenerate necessary manifest files. You have to copy these files to the following folder(Visual Studio2010) C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages.
Once thats done go to your Application deployment project > Properties > Prerequisite There you will see your prerequisite software as one of the prerequisite option. Just select that and create the MSI. Now when you run the Setup.exe of your application it will first check if the prerequisite software package is installed in the target machine if so it will directly install your application otherwise it will first install the prerequisite component and then install your application.
MSDN: The bootstrapper first detects whether any of the prerequisites are already installed. If prerequisites are not
installed, the installation begins for the prerequisites. Otherwise,
if all the prerequisites are detected, the bootstrapper just starts
the application installer.
Creating Bootstrapper Packages
Bootstrapper Manifest Generator

As AccessDenied said, using a bootstrapper is the best option. Right now the best and most powerful free bootstrapper from the industry is available in Wix. It integrates with VS so you can have the setup project directly within your solution, or as a part of your automated build.

Related

Additional Setup in Visual Studio Installer Projects

I am trying to create an installation for my project. I am using MS Access DataBase and for it to work Access DataBase Engine is required. If i download that engine https://www.microsoft.com/en-us/download/details.aspx?id=54920 from here and install it, program works.
How can i add that installation to my installation?
I am using Visual Studio 2015, C# and OLEDb.
Short Version: In essence you will need a deployment tool. List view of major deployment tools. Maybe that list view is the easiest overview? (a sense of scope). Much more detail below (and too many links too).
Details: There is some prerequisite functionality available in Microsoft Visual Studio 2017 Installer Projects, but I am unfamiliar with the details. I find this project type inadequate for real deployment work for a lot of reasons (lacking features and some odd implementations). More on this here - a few concrete problems to consider.
Several commercial tools will do this for you with special features to help make it quick(er). I verified that Advanced Installer can do it (and here is a great gateway to all things Advanced Installer. Some free features available). I assume Installshield can do it as well (certainly for other runtimes, didn't verify this particular one). Generally it will be handled by a setup.exe bootstrapper / chainer embedding all runtimes along with your own MSI file(s).
In other tools, you will have to do it yourself, by figuring out command lines and how to handle error conditions. There are some hints here (not tested by me - a google sweep will give you more): https://www.itninja.com/software/microsoft/access-runtime/2016-1
Get more command line info by going accessruntime_4288-1001_x64_en-us.exe /?:
WiX is free and open source - with a relatively hefty learning curve if you don't know MSI, and contains a bootstrapper feature called "Burn". Here is the documentation for: How To: Install the .NET Framework Using Burn (first read the "Building Installation Package Bundles" instructions in "Step 1"). A real-world Burn sample. And some sample source markup.
Some developers recommend the dotnetinstaller bootstrapper. Not something I know much about. It is just a bootstrapper. Runs things in sequence for you.
If you are doing in-house or ad-hoc deployment, even a batch file could do the job I suppose, but if you do that for a real product for large-scale and generalized deployment I would be very worried indeed. If there is one thing we hate as deployment specialists, I'd say it is batch files embedded in packages. Batch files (and scripts) are system administrator tools, not general deployment tools.
Some Older Links:
Executable files to MSI installer
How do Installation Software Programs Extract Files?
Create MSI or setup project with Visual Studio 2012
How to make an installer that automatically install all the prerequisite programs for the application
Windows service NOT shown in add remove programs under control panel
How to make an installer that automatically install all the prerequisite programs for the application
Wix - How to run/install application without UI
Visual Studio setup projects have a Prerequisites choice in the project's properties. This allows you to choose from a list of standard prerequisites and generate a setup.exe that will install the prerequisites and then install your MSI. The Access Runtime doesn't appear in later versions of setup projects because (I assume) Access 2013 ended mainstream support in 2018. The way to add your own prerequisites to this mechanism was with the Bootstrap Manifest Generator, which is perhaps still available but not well documented:
https://msdn.microsoft.com/en-us/library/ms165429.aspx
Apart from that I'd recommend that you learn how to build a WiX Burn bootstrapper executable that will install the Access Runtime and then install your MSI (which you still build with Visual Studio if you need to). If you do a search for that you'll find this kind of thing:
WiX - Install Prerequisites and 3rd party applications
https://www.c-sharpcorner.com/UploadFile/cb88b2/installing-prerequisites-using-wix-bootstrapper-project-and/
These will explain how to build the Xml to check whether the Access Runtime is installed and the command to use to install it. This is a much better choice than the Bootstrap Manifest Generator.

How to install pre-requsite software using Visual Studio Installer?

I have pre-requisite software installer, xyz.msi which should be installed via main installer, pqr.msi. I use Visual Studio 2015 installer project to create pqr.msi installer.
I also need to check certain condition like whether xyz.msi is already installed on target machine or not.
I understand that I can add xyz.msi as assembly in pqr installer and set below property to conditionally copy the xyz.msi:
Condition
But, how to invoke the pre-requsite installer to get installed/launched first before main installer silently. Would this cause nested installation and fails? Any other better way?
The condition on the copy that you're referring to is literally just a condition on installing the file to the target system, a plain copy to (say) the Application Folder. It won't install the MSI any more than it will run some exe file you install.
You also cannot install the MSI from a custom action (that would be nested installation failure) so you need a way to install it before your own MSI. There are two choices that I know of:
The bootstrap manifest generator can be used to build a setup.exe that will install your the prerequisite MSI then your MSI. Start here:
https://msdn.microsoft.com/en-us/library/ms165429.aspx
Use WiX to generate a bundle where you mark the prerequistite MSI as a prerequisite for yours. You'd use MsiPackage to install your MSI.
http://wixtoolset.org/documentation/manual/v3/bundle/bundle_author_chain.html
http://wixtoolset.org/documentation/manual/v3/bundle/
Note that you're not building the MSIs with WiX, just the bootstrapper bundle.
If that prerequisite MSI is from a 3rd party then they may have alternative ways to install, such as merge modules you add to your own MSI build.

How do I add prerequisites to a ClickOnce application?

I want to add prerequisites to my Click Once application. Here is the problem. The program is in a server and clients install the application from the specific URL. I want to auto install the prerequisites (for example, Crystal Report Viewer) when the user first downloads and installs it, how could I do that?
I'm using C# Windows Forms and .NET Framework 4.0
You need to create a prerequisite first. The prerequisites that are shown in Visual Studio are in the following location
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper\Packages
You can create a Product Manifest through this tutorial
Put it along with other bootstrapper packages.
Once this is done, you can select that prerequisite in your prerequisites window in publish settings and give the location from where you want the user to download it.
Here is a complete tutorial for creating Localized Bootstrapper Package.
There is a tool called Bootstrap Manifest Generator. This Code Project article is a complete tutorial for using this tool. I think this tool is not available from Microsoft directly any more.

Install Shield msi file installing to the wrong directory (error 1309)

I am using Visual Studio 2013/ISLE to create a C# program with a .msi install image. When I run install from VS the program is installed in the expected location, e.g. c:/Program Files (x86)/...
I'm sure that this is something simple but I can't figure it out. A pointers would be greatly appreciated.
When you run a 32-bit installer in x 64-bit system Windows will always redirect your installer writing to c:\Program Files to c:\program files (x86). If you want to install to the non-x86 folder you will need to provide a 64-bit installer for your application.
This blog post explains why Windows does this.
It looks like InstallShield LE will allow you to write to the correct folder when your project is set to AnyCPU, but for more advanced scenario's you'll need to use the Pro version or the free Wix installer.
I assume the question is why the installation MSI fails when you run it outside of Visual Studio, but works when VS launches it?
If yes, you should first check if your ISLE project is creating an MSI or an EXE bootstrapper (that also contains the MSI). If an EXE is created this is what you should launch manually, not the MSI. In theory, a bootstrapper can act like an initialization support for the MSI and specify default values for certain properties, like an installation folder, etc...
I say in theory because I am not very familiar with ISLE, I work with other setup authoring tools, thus cannot say for sure if this stands for ISE projects too.

How do I install multiple setups in a single installation?

I have created a piece of software to download data from finger-scanners and write them to a database. The drivers of them should be installed first, so the driver setups should be installed while he installs the software. I don't know how to do it. It is written in C#.
You may create a setup for your app using Visual Studio Setup Projects. It helps you to run external exe s or msi s when your setup runs.
Go to File -> New -> Project -> Other Project types -> Setup and Deployment to create a setup project as you prefer. Then you may use Custom actions to add the feature you requrire. (The 3rd and 4th links below shows about custom actions).
Refer to:
http://www.codeproject.com/KB/dotnet/Win_App_Setup_Project.aspx
http://www.codeproject.com/KB/install/ExtendVSSetupProject.aspx
http://devdump.wordpress.com/2009/01/17/setup-project-custom-actions/
http://www.simple-talk.com/dotnet/visual-studio/visual-studio-setup---projects-and-custom-actions/
Also you may create a script based installer for your app, which will let you create an installer with with high customizability and features.
Refer to
Main Page - NSIS
Embedding other installers - NSIS
Hope this helps...
You can't run an MSI based install from a Visual Studio custom action. MSI doesn't permit that kind of recursive install (because it's a transaction, and because it tries to use system restore points per install etc). That's part of the reason why other prerequisites are installed by the setup.exe program. The bootstrap manifest generator can be used to generate custom prerequisites (first topic in this forum).
From:
https://social.msdn.microsoft.com/Forums/windows/en-US/dfb5de84-a0f0-4639-958e-8cbf4cba6e90/setup-deployment-project-cannot-launch-another-installation?forum=winformssetup

Categories

Resources