How do I install multiple setups in a single installation? - c#

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

Related

Merge Multiple (setup) Files into Single Setup

I have a project (Outlook desktop add-in) in the following stack:
C#
Dot net pre-requisite 4.5.2+
When I build the application, I get a setup folder of 3 files/folders:
setup.exe
project-vsto.vsto
Application Files - folder with dll.deploy and manifest files
When I run this exe manually, I can see the installation in my control panel and things work fine.
Now, for mass deployment purposes, I package this folder using advanced installer, through which I create a packaged msi of the project.
On manual installation of this msi, it does 2 things:
"Installs" the packaged project. It can be seen in the control panel. However, this is not the actual thing, more like extraction of files in "C:\program-files..." and we need to run the "setup.exe" here.
Runs the setup.exe, as it is mentioned in the exit dialog at the time of msi creation. This is actual project installation step.
However, when I deploy this through SCCM or GFI (Languard) (which we will be using for mass deployment), second step does not follow. What is the work-around through this?
Is there any thing in advanced installer which I can do to omit step-1? I have read docs etc but could not find other than doing this through custom actions or exit dialog (I've tried both, obvs) which behave in same way as far as my situation is concerned.
Or,
Can I tweak some setting in SCCM or GFI (maybe add custom action there, or some installation switch, or some other setting?!!) which can help me achieve my purpose.
Any leads which can help my cause will be greatly appreciated. Thanks in advance.
Most likely you didn't use the built-in support Advanced Installer has for Office addins.
Here it is a video tutorial about how to create a setup package for an Office Addin with Advanced Installer:
Package Office addin with Advanced Installer
Try to follow these steps and check the outcome.

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 add an installer as a dependency to a setup project for a C# app?

I have a C# application (I use Visual Studio 2010). I added a setup project to my app, like that: File -> Add -> New Project -> Setup project.
I order to work correctly, my application requires Code::Blocks.
I want to add the Code::Blocks installer, to my Setup project for my application, so that when the user runs the setup (to install my app), it should have the posibility to install Code::Blocks directly from the setup of my app (of course, if it isn't installed on the user machine).
More exactly: the user runs the setup for my application. It presses "next", and then the setup should run the Code::Blocks installer if it isn't installed on the user machine. The user installs the Code::Blocks, and then the setup of my app continues normally.
How can I do that? I've searched on every menu but I can't figure out where is the solution!
Thank you respectfully.
You have to create a Custom Action for that. That is an Installer-specific type of class that you then register as an action in the Setup project.
In a Custom Action, you can do anything you want, such as verify the existence of a registry key (which would indicate the presence of installed software), run EXEs, etc.
To find out more, check out these links:
Tutorial: http://www.c-sharpcorner.com/UploadFile/87ad51/3/
On MSDN: http://msdn.microsoft.com/en-us/library/aa368066(v=vs.85).aspx
Incidentally, Visual Studio 2012 and 2013 do no longer come with Setup project support; instead you can install the (free) InstallShield Limited Edition. But guess what: the InstallShield Limited Edition cannot execute custom action classes from .NET DLL projects, only as command-line EXEs. Just so you know that, when you upgrade to a more recent Visual Studio, you'll have some work to recreate your installer and modify your custom action classes.

how to use VS Setup and Deployment project and build an .msi file to install the program?

i wanna deploy a C# Windows Application project using Setup and deployment project technique
but i don know what should i use
after i open File > New > Project > Setup and deployment > ....
then what ,, what should i do next
In the past I've used the Visual Studio Setup Project or Innosetup for my programs. I prefer to build .msi's over exe's so Visual Studio Setup Project has been my goto for a while now. It is however, very lacking in capabilities. The interface is not intuitive either in my opinion. Every time I build an installer there is a lot of trial and error install/uninstall to get it right. Other's have pointed out WIX and I've looked into it. It appears to be very flexible and since it is open source, we should be able to count on it for the long term.
Here is a recent article about WIX. What I found interesting is the article claims (see link in article) that Visual Studio Setup Project is being End Of Life'd in VS 2010 + NEXT_VERSION. This is a little disconcerting to me. Since I don't want to begin to rely on the new Install Shield "Lite" in VS, I'm going to put effort into learning WIX. I hope it'll pay off in more flexible builds for my applications as well.
All that said, when creating a VS Setup project, I usually use the wizard to put in the initial plumbing. You'll point it at the files you want in the .msi. Typically for me this means the "outputs" of one or more programs in my solution. Any managed assemblies referenced in the programs will automatically get picked up as dependencies and included. Unfortunately unmanaged assemblies don't and I usually have to add them manually using the "File System Editor" mode in the Setup Project UI. Adding shortcuts is a little hokey as well. You right click under the start menu and desktop section of the "File System Editor" mode and select create shortcut. This is all by memory so hopefully I'm getting this right. You will certainly have to test your installer multiple times before you get it just how you want. I like to test under a VM as well.
Finally, the VS Setup project produces a setup.exe and .msi file. Setup.exe is used for detecting and installing dependencies (such as .Net) before unpacking the actual DLL.
When u do this File > New > Project > Setup and deployment >
then right click Application folder> Add > File...and add your app's .exe file and also you can add shortcuts of your app in desktop and program's menu
I would recommend you to go for some tool for creating msi.
I am using WIX
What you need depends on... what you need.
For a large percentage of applications, all you need the installer to do is let the user choose an install location, copy files to a directory structure at that location, and create a few shortcuts. For that, a Visual Studio Installer -> Setup Project is fine. It can handle this basic functionality, as well as installing prerequisites like the .Net Framework redistributables, providing custom install options, and/or writing simple registry keys. The Setup Wizard creates a Setup Project as well, but runs you through a wizard to set up the basics. This is a good option if you've never created an installer before.
If you want this application to be controlled by a larger, more custom install, choose the CAB Project; it will simply pack the necessary files into an archive that is easily accessible from another setup project.
If you are publishing a class library, use a Merge Module. Merge Modules work within install programs themselves, providing files needed for the main application to work.
If you need serious customization, or you want to interface with existing InstallShield logic, I'd get a third-party installer. I've worked with InstallShield before, and it's pretty full-featured, but by the same token, the installers it creates are applications in their own right and can take days or weeks of logic programming to "tweak" to your satisfaction.

Setup project modificatios

I have made a application using c# database and sucessfully made a setup projects that outputs setup files needed to install that application but when i install it on other machine first I have to update installer then framework 2 sp2 and then SQL server and when I tell my client that he would have to do the same he just ........... so I want a way to embed these things in that installer wizard so that in a one go every thing gets installed without prompting for each thing . for example when we install visual studio every thing gets installed without asking permission as we select what to install.so is there a way?
If you have a setup wizard for each of the parts you need to install, you may want to take a look at Inno Setup, as you can embed those installers in a new one which in turns executes Database/.NET Framework/application setups in correct order to properly configure all the pieces of the solution on a machine.
As setup applications usually have a way to configure options by command line parameters and run silently, you can collect all parameters you need in the new wizard page and call any of the needed installers just by adding a line in the [Run] section of the script.
With Inno you can even embed a pascal script to run code at wizard run-time, for example to inspect destination machine in order to run or not run some installers. You are able to download required extra-files on demand also.
When you compile a Inno setup project with default options, you get a single executable containing all what you need to install your project, making deployment very easy.
This options may be available for the tool you're using now to produce your installer.

Categories

Resources