combining multiple msi installer into single installer - c#

In My application there are 4 msi installers.one which installs web project,other one installs web services and two installers for installing windows service.
I want to combine all 4 into one.Is there a way to do that without using wix,installshield or any third party products.

A simple approach is to add 3 of your installers as a prerequisite to the fourth one. You can read more about prerequisites here:
http://msdn.microsoft.com/en-us/library/77z6b8tz(VS.80).aspx
http://msdn.microsoft.com/en-us/library/ms165429.aspx
http://msdn.microsoft.com/en-us/library/ms165429(VS.80).aspx
You can then add the EXE bootstrapper and MSI files into a single EXE self-extract archive which executes the bootstrapper when extracted.
If an EXE is not acceptable and you want to combine them in an MSI, you will need a third party setup authoring tool.

No, there's no way to combine 4 MSIs into a single one. Whilst there are some ways of compositing components together (see Merge Modules, but they're not that popular these days), these have to be specially constructed, and are consumed whilst constructing the MSI into which they're added.

Related

How to make one installer dependent upon other, while installing application in windows?

I am struggling with a issue of making one installer dependent upon other.Suppose i have a setup project Through which, i use to make MSI(or setup) of my c# application for deployment on windows machine. Now suppose i have another project whose MSI(or setup) is generated by another setup project.
Now what i want to make is that when my first setup is run than it will first check for whether second MSI(or setup) is installed or not. If its not installed on target machine then it first set up will run and install second setup, once second set up is properly installed then installer of first continues and completes the its installation.
I can't figure it out how can i check whether second setup has installed or not. i.e how to make second installer dependent upon first installer. I am using visual studio 2013 and the project which i am deploying is c# application
First time i am dealing with making setups for application deployment so may be my way of asking may not be good. Thankyou!
In general that is not possible by means of MSI only since you can't run two MSI installers at the same time. You'll need to use some external solution: a self-made script, InstallShield wrapper etc. The only thing you can do within the MSI is to check that a prerequisite application is installed and if it's not - abort the installation.
Yes, you need to use a packaging tool that either offer out of the box support or you will have to write your own code for this.
You have quite few options here:
-InstallShield
-AdvancedInstaller
-Wix
What you are trying to achieve is known as prerequisite or runtimes required by your application.
As J.Tribbiani mentioned in his answer the solution you need is to use a professional tool like Advanced Installer or the others, to configure your setup as a prerequisite. This is the standard procedure for your requirement.
Here is an example tutorial of how to do it with Advanced Installer:
prerequisite configuration
Or a video of configuring an optional prerequisite, i.e. which the users could choose to skip (let's say if they have an equivalent alternative or want to manually install the prerequisite)
Disclaimer: I work on the team building Advanced Installer

How to make installer package with multiple executables in Visual Studio

I'm making a small backup app that comprises three parts.
A system tray "config" utility where the user specifies backup source / target locations, times they want the backup to run etc.
When changes are made, this calls another exe which creates a scheduled task for the backup. (It's a separate part because this part must be elevated.)
The third part is the exe that performs the backup. (It compresses and uploads by ftp to a server somewhere.) This is the exe that is run by the scheduled task.
How do I package these up (preferably in VS2013, if not using some freeware) so they are all installed together? (They each use a couple of (different) custom dlls. For example the backup component uses DotNetZip and WinSCP, and the scheduling component uses the Win32.TaskScheduler.)
I basically just want the user to run a single installer that will install all three exes and their dependencies.
These are currently three separate projects, with three different solutions. I can combine to one solution if it makes it simpler.
As Louis Van mentioned in this comment You can add one of these executable as primary output to your installer project and the remaining two exes can be added to the installation bin directory using Add > File.. option.
When you add an executable to Application Folder of your installer, References of relevant exe will be detected and automatically included by the windows installer.
You can use the free edition of Advanced Installer (create "Simple" project) to package them up in a MSI. It also includes a VS extension, so you can have the MSI built right out of VS.

Wix: How far can I go with custom action?

I want to build a Wix installer which will detect a few programs of mine and update them.
I have c# code (using another DLL) to check a few things on the system,
then I want to download a table of the most recent version of all the apps,
decide which app I need to update, and then download & update the selected ones.
So my question is, can Wix preform the following actions:
1) run another dll call using c#?
2) download a file from the web and parse it (let's say - also using c#)?
3) go to a link and download an MSI\EXE?
4) install the MSI\EXE (let's say run it on silent mode)?
5) uninstall old other apps from system?
Windows Installer has a mutex that only allows 1 execute sequence per machine and 1 UI sequence per process. One MSI cannot install another MSI due to this limitation. There are hacks around this but they don't follow good design (don't provide proper elevation support or silent install / uninstall support ).
You should use custom actions with care. A properly designed custom action should behave like the standard actions built into Windows Installer. That is support transactional installation whenever possible and be data driven via custom tables.
A better candidate for the stuff you are describing needing to be done would probably be a bootstrapper / chainer such as WiX's Burn feature.
1) - definitely yes
2)-5) you could do it but you should differ msi from "custom bootstrapper" and "custom after install configuration manager". General rule: use msi package only for resource (usually files; in more complex cases - registry, in most cases sql objects) atomic deployment; move all other functionality outside msi (means use wix ony to build msi; create custom utilities for bootstrapper and configuration tool; see wix samples how to integrate three parts together).
1) Yes but keep in mind that if you have a dependency on .NET 3.5 and you are on a box with .NET 4 your custom action will not be able to run.
Besides this your custom action dll is unpacked from the msi into the %TEMP% folder. If you have any dependency to other dlls not stored in the GAC you will fail to load. If you bring in another e.g. C++ dll you have to embed it as resource in your C# dll and unpack it as well to find it.
2) You can do whatever you have the rights for.
3) Sure
4) Only one MSI installation can run at one time. You have to spawn some child process to wait until the current installation is over.
5) Yes sure. The easiest way is to add an Upgrade table to your msi to simply uninstall any software which has this upgrade code. This is the only allowed action where two msis at the same time can be active. Look at the InstallExecute Sequence table for RemoveExistingProducts action.

What are the differences between MSI and EXE installers, and which should I choose? [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
What are the specific differences between .msi and setup.exe file?
I am working on an installer for a new version of my project (C#).
Previously, I've used Inno Setup to create .exe files for installing my projects on other computers in the workplace. While reading through some tutorials, though, I came across Windows Installer XML, which uses XML files to build a .msi installer.
My project will be available on a network share that all the employees have access to so they can install the software (I'm currently working on an update checker as well)
What are the major differences between .exe and .msi installers? Why would I want to chose one over the other? Would either make more sense given my specific environment?
I found some of the information at this question, but there was not a lot of information.
I wouldn't use WiX for a new project. I'd use an 'Installer Project' in Visual Studio to build an MSI. An installer project is much, much easier to put together.
Many exe installers are actually stubs or containers that hold an MSI, btw.
I guess you've checked out http://en.wikipedia.org/wiki/Windows_Installer?
MSI's give administrators the ability to restrict installs, rebase installs, change or add custom actions, automate installs/reinstalls/uninstalls, standard logging and switches. It just really integrates into a corporate IT environment ( http://technet.microsoft.com/en-us/library/bb742606.aspx ).
A custom installer may have many of those features, but that would depend on the installer package.
Most EXE installers available today are simply stubs to verify that the target machine has just enough support to launch an MSI stored within the EXE. They do basic windows version checking and Windows Installer version checking, then essentially invoke msiexec and let Windows Installer handle the rest.
For a very basic installation, the Installer Project in Visual Studio can get you by, but for just about any kind of real customization or tweaking you'll need a real MSI editor. We use WiX and love it - but it's a bear to learn. If you've got the cash you can invest in InstallShield - but that has it's own set of quirks.
MSI is configurable while EXE is not. I know this doesn't answer your question directly, but I thought I should point towards the ClickOnce technology.
MSDN: See example here.
Simply stated, a ClickOnce application
is any Windows Presentation
Foundation, Windows Forms, or console
application published using ClickOnce
technology. You can publish a
ClickOnce application in three
different ways: from a Web page, from
a network file share, or from media
such as a CD-ROM. A ClickOnce
application can be installed on an end
user's computer and run locally even
when the computer is offline, or it
can be run in an online-only mode
without permanently installing
anything on the end user's computer.
For more information, see Choosing a
ClickOnce Deployment Strategy.
IndigoRose's MSI factory is extremely powerful and much, much cheaper than InstallShield.
It uses WiX internally and allows you to modify the XML files in any way you like. The bootstrapper (.exe, if you add one) has a powerful scripting engine based on Lua to do... well anything.

How to create setup for any exe?

I have .NET exe, I want to create a setup for this and after any login or restart this exe should be called automatically.
As you are deploying a .NET application, there are multiple ways in which you can approach this challenge.
There are many questions you have to consider when choosing an installer strategy. These include:
How do I plan to distribute this software?
Is the software supposed to be connected to the internet in any way?
What users is the software targeted towards?
Do these users have specific computer installations, such as all having .NET Framework already installed?
How should I approach the problem of updates to the software?
After answering some of these questions, you can get a general idea of how you should distribute the software. Then, you need to consider the various installers, and Wikipedia has a convenient list that compares them, which might help you.
Below are some examples of what might work for you:
ClickOnce deployment built into Visual Studio - my current favorite way, as this is the most easiest for users and for developers because updates and interaction is extremely simple
NSIS (Nullsoft Scriptable Install System), an open source scripting system for such installers. A great tutorial on packaging and checking for the .NET Framework with NSIS can be found here.
InstallShield (from Macrovision) - a heavily used installer system, but this one is not free, unlike other solutions
DreamShield - I haven't tried this one, but it appears to be a viable solution.
WiX (with Visual Studio plugin)
Deployment of applications is a very tough part of software development, especially in .NET, because how can we know, for example, whether the potential user already has the .NET Framework installed on their system or not? Or what version is installed? Thus, we must use tools like ClickOnce and NSIS to help.
To your question about how to start your application immediately at login, there are four ways to approach this:
Add registry key to start at login/bootup - MSDN explains that very well here. However, most installation systems allow you to automatically configure the registry key for bootup addition.
Use the Windows Task Scheduler to schedule a "task", in other words, to create a task that runs at startup. There is a .NET library for that here, I've used it in two of my applications that run on a specific schedule, it works great!
Adding the path to your executable into the Startup folder located at C:\Documents and Settings\All Users\Start Menu\Programs\Startup(that is for all users - for single users you can customize the username in that path). By the way, that location is in Windows XP, it may be different in other version of Windows.
If your application is a Windows Service, you can already automatically start at bootup, through svchost! There is a simple service configuration that will allow you to accomplish this.
Hope I helped!
You can use Inno Setup for the specific tasks described in the other answers.
By setup, I'm going to assume you mean the conventional installer. A good open source solution is NSIS. If that does not work, here is a more complete list.
As for having it start whenever the computer restarts/you login, that is platform specific (the installer can be platform specific if the program is). On windows, the installer needs to add a shortcut to your program in the folder
C:\Documents and Settings\All Users\Start Menu\Programs\Startup
(that is the easy method, there are surely more complicated registry settings).
This blog post lists a few useful links to info about Setup and Deployment projects using Visual Studio.
You could also google with the keywords ".net deployment project".
Although not .NET specific, you can try InstallJammer. Its open source and multiplatform.

Categories