I'm trying to create an installer in VS2010.
My situation is: I have 2 app, during installing a application, I need to check if the other app exists or not. If it exists, just install the first app, otherwise install both of them. How can I do this in VS2010. I've searched and find a solution here. But I don't know where I can put these codes.
Any instruction in details would be appreciated.
Thank you.
You probably will want to look into creating a Custom BootStrapper
From above link:
The Setup program is a generic installer that can be configured to detect and install redistributable components such as Windows Installer (.msi) files and executable programs. The installer is also known as a bootstrapper. It is programmed through a set of XML manifests that specify the metadata to manage the installation of the component.
The bootstrapper first detects whether any of the prerequisites are already installed. If prerequisites are not installed, first the bootstrapper shows the license agreements. Second, after the end-user accepts the license agreements, the installation begins for the prerequisites. Otherwise, if all the prerequisites are detected, the bootstrapper just starts the application installer.
Related
Is it correct msi file is the Windows equivalence of deb file in Debian?
In Debian/Ubuntu, after I compile a program into an executable, I can create a deb file out of the executable using a program called checkinstall. Then I can install a deb file by dpkg.
In Windows,
what is the program/command that can create a msi file from an executable built from source code?
What is the program/command that can install a msi file?
Thanks.
The Windows Installer consists of an SDK, database specification and runtime service. Introduced in 1999, it originally had redistributables that were nesseccary to "bootstrap" onto the system before and MSI could be installed. Various versions of this runtime have been been baked into various versions of Windows for a very long time now so generally this is no longer a concern. You can simply install the MSI.
Technically the SDK does come with some tools that could be used to create an MSI. However this would be like using notepad and CSC to write a .NET app. Almost no one would actually do it this way. One notable tool does come from the SDK: ORCA.exe. ORCA is a database editor which is very useful for examining MSIs and making minor modifications to already built MSI. It technically can be used to create an MSI but very few outside of Microsoft back in the early days ever did.
For the most part Microsoft left installer authoring tools to third parties. Windows Installer XML (open source), Industrial Strength Windows Installer XML (open source), InstallShield, Visual Studio Deployment Projects, InstallAware and AdavancedInstaller are a few to list. It is outside of the scope of Stack Overflow but I will link a 2 minute video showing how to use Visual Studio, WiX and IsWiX to create a simple MSI with a shortcut for a single EXE:
https://www.youtube.com/watch?v=nnV_OU6fk8c
Disclosure: I'm the project maintainer for the IsWiX on GitHub.
As for how to install an MSI. An MSI is a database not a program. It is installed by the Windows Installer service msiexec.exe
There is an extensive command line documented at:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa367988(v=vs.85).aspx
There is no standard tool for creating MSI installer files. There are many, many third-party tools, free and paid, that will help you to create MSIs; you'll have to do some searching and comparing and figure out what works best for you. The command to install an MSI is the MSI itself, you don't need to explicitly run it with any other program like you do with deb/rpm packages.
My problem is the following:
I have multiple applications that I want pack in one installer so when the user runs it, they will be installed automatically instead of installing or copying each single application.
I have a program that's already a setup file (.exe) and two .exe files which can be executed manually and do not need an installation. So what I want is:
Build an installer so when the user opens it - the .exe file of the setup program gets installed and the other applications which dont need to be installed will be copied somewhere in a path.
Whats the best solution?
I think you need a packaging programs to create an installation package, such as:
AdvancedInstaller
InstallShield
InstallAnyware
The first two of them have a freeware version. Maybe you can see if the required features are available in the freeware version.
I would suggest Advanced Installer (allows easy chaining of installs) if you have no significant deployment experience. Otherwise I would suggest Wix and its "Burn" feature (ability to chain installers in sequence). Please read the following answers for context:
What installation product to use? InstallShield, WiX, Wise, Advanced Installer, etc
Windows Installer and the creation of WiX
Wix to Install multiple Applications
Read this if you want to get going with Wix quickly
I have a fresh WIX UI Install project in VS which compiles down into an MSI. Everything is working great with it.
It installs/uninstalls the files I want successfully. For example, it drops 3 DLLs into a Program Files folder, installs a Windows Service, and GAC's a DLL.
Now let's say I install on this in a given environment. Then one of our DLLs change and we need to upgrade this install without affecting other files already installed (such as the service) So my thought would be I would need a patch/upgrade MSI that would target that one DLL and just overwrite that particular file.
What is the simplest way to accomplish this? Do I need VS projects essentially for each patch/update MSI? Below is my current 2 WIX related projects (installer + custom action)
For updating just the DLL a patch is recommended. Visual Studio doesn't support patches, but you can try using WiX: http://wix.sourceforge.net/manual-wix2/patch_building.htm
Please note that patches have some restrictions: http://msdn.microsoft.com/en-us/library/aa367850(VS.85).aspx
A MSI which overwrites just one file is a bad mistake because you are not using the Windows Installer update mechanism.
If you want a MSI, it will have to be a major upgrade. A major upgrade will automatically uninstall the old version before installing the current one.
I am creating the deployment project (.MSI) for my .NET Windows project (Visual Studio 2010) using the advanced installer 8.x by adding some driver and 3rd party SDKs. I added them as prerequisites by choosing the product keys as conditions, but when I run the project it’s popping the prerequisites even after they get installed. Its status is not changing to installed and popping up every time.
How can I fix it?
Prerequisites use detection criteria to determine if they are installed or not. So most likely your prerequisite install conditions are not correct.
Usually a prerequisite is detected by searching for a file or registry entry installed by it. To see what files and registry entries are installed by a package you can use Process Monitor or a repackager tool.
when I build solutions in Visual Studio, that generates installer files as .exe and .msi, .exe files are useful for what?
The .EXE file that is created by the installer project is a bootstrapper for the .MSI setup file. It is used to launch the .MSI setup file.
Generally, both will launch the setup program and allow the user to install the application. However, sometimes the setup.exe file will run a custom validation routine to determine if the user's computer meets the minimum requirements for installing the software.
For example, if the user does not have Windows Installer, they will not be able to launch the .MSI file, but the .EXE application will still run and inform them that they need to install Windows Installer first. For .NET applications specifically, the .EXE file verifies the presence of the appropriate version of the .NET Framework, and if it is not present, it prompts the user to download and install it.
You can customize the prerequisites that are required for your application in your installer project using Visual Studio. See these MSDN articles for details on how to do that:
http://msdn.microsoft.com/en-us/library/ms165429(v=VS.100).aspx
http://msdn.microsoft.com/en-us/library/7eh4aaa5(v=VS.100).aspx
Others have commented on the how (.exe bootstraps the .msi) but part of the reason why is that users know that .exe files are the things you run. I don't think your average user knows that .msi files are something that you can click on to install an application.
The .exe file is made for installing the prerequisites of your application.
Let's say your application uses the .Net 3.5 framework, you can tell the installer project to include the installation of the needed libraries if they're not already installed.
You may also deactivate it, so only the .msi is being created.
This page shows how to activate and configure the prerequisites setup, just uncheck the checkbox in order to deactivate it.
You also find more details on the process of Bootstrapping on MSDN:
the capability to automatically detect
the existence of components during
installation and install a
predetermined set of prerequisites
.exe files are useful for executing your programs that you've just built in Visual Studio, assuming you're not doing web applications.
Pretty much every Windows program out there is executed using files with an .exe suffix.
Installer exe files are normally just the msi wrapped in a bootstrapper. The bootstrapper can do anything, but normally its purpose is to ensure the user is running a sufficient version of Windows Installer, then extract the msi and invoke msiexec.exe to start installing the msi. Generating installers as exe's is deprecated these days, but some still do it.