How can I create an MSI setup? - installation

I've created setups for all my Delphi tools with Inno Setup for years. Now some users rather want an MSI installation package, so they can deploy the setups from a central server to all workstations.
How do I create one? Do I have to buy Visual Studio or some other product?

You can use Wix (which is free) to create an MSI installation package.
WiX Tutorial - Creating an Installer MSI with Wix

If you don't understand Windows Installer then I highly recommend The Definitive Guide to Windows Installer. You can't really use WiX without understanding MSI. Also worth downloading is the Windows Installer 4.5 SDK.
If you don't want to learn the Windows Installer fundamentals, then you'll need some wizard type package to hide all the nitty gritty details and hold your hand. There are plenty of options, some more expensive than others.
InstallShield
Advanced Installer
MSI Factory
etc..
However still I'd suggest picking up the above book and taking some time to understand what's going on "under the hood", it'll really help you figure out what's going wrong when customers start complaining that something is broken with the setup :)

You can use Visual Studio - that's paid.
You can use https://www.advancedinstaller.com/ - that has a free edition.
You can use http://nsis.sourceforge.net/Main_Page - for example Winamp uses this installer - and is very configurable and is Open Source.

Google "Freeware MSI installer".
e.g. https://www.advancedinstaller.com/
Several options here:
http://rbytes.net/software/development_c/install-and-setup_s/
Though being Windows, most are "shareware" rather than truly free and open source.

In Visual Studio (including the free community editions) you can install the Microsoft Visual Studio Installer Projects extension [1] which allows you to create an MSI installation package. To install it from within Visual Studio:
Go to Extensions -> Manage Extensions in the menu bar
Search for Installer Projects in the search box
Select Microsoft Visual Studio Installer Projects and hit Download
Restart Visual Studio
Once the extension is installed, you'll create a new project that will contain all of the files and settings for the MSI. To do this:
Go to File -> New -> Project in the menu bar
Change the drop down menus visible to show All languages, All platforms, and All project types respectively
Scroll down in the project type list and towards the bottom select Setup Wizard: Create a Windows Installer project with the aid of a wizard.
Hit Next.
Work through the prompts to choose the installer project name and location. Choose Create a setup for a Windows application at Step 2 and in Step 3 choose the executable and other files that should be included in the MSI (hit Add..). At the end, hit Create.
To build the actual MSI go to Build -> Build Solution in the top menu, and you should see a message like the following in the Output window:
Build started...
------ Starting pre-build validation for project 'Setup1' ------
------ Pre-build validation for project 'Setup1' completed ------
------ Build started: Project: Setup1, Configuration: Debug ------
Building file 'C:\Users\zelda\Source\Repos\Setup1\Setup1\Debug\Setup1.msi'...
Packaging file 'test.exe'...
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
What's created by default is a very basic MSI, but for additional configuration like creating custom actions, adding/changing registry keys, configuring the user interface associated with the MSI, etc., see the full documentation [2]
[1] https://marketplace.visualstudio.com/items?itemName=VisualStudioClient.MicrosoftVisualStudio2017InstallerProjects
[2] https://aka.ms/vdproj-docs

You can use "Visual studio installer project" and its free...
This is very easy to create installer and has GUI.(Most of the freeware MSI creation tool does not have a GUI part)
You will find many tutorials to create an installer easily on the internet
To install. just search Visual Studio Installer Project in your Visual Studio
Visual Studio-> Tools-> Extensions&updates ->search Visual Studio Installer Project. Download it and enjoy...

Look for Windows Installer XML (WiX)

You can purchase InstallShield, the market leader for creating installation packages. It offers many features beyond what you get with freeware solutions.
Warning: InstallShield is insanely expensive!

In my opinion you should use Wix#, which nicely hides most of the complexity of building an MSI installation pacakge.
It allows you to perform all possible kinds of customization using a more easier language compared to WiX.

Related

How to override the server with now installer in visual studio installer 2015

I need to override the older version of installer form newer version.I am using installer for installing the windows services.
Visual Studio Installer 2015.
I change the installer with property "RemovePreviousVersion"= true, But in the installer getting error because service is not uninstalled and try to override this.
Error 1001. An exception occurred in the OnAfterInstall event handler of System.ServiceProcess.ServiceInstaller --CouslNot Star service on computer
enter image description here
Short Answer / Suggestion: Services must be stopped before install / uninstall / upgrade operations. There are mechanisms built into MSI to do so.
Hotlink to show how this is done using WiX (ServiceInstall
and ServiceControl elements).
Here is a proposed WiX quick start (with lots of link noise to
all kinds of WiX and MSI topics - it is an ad-hoc organically growing
link answer).
Hello WiX
Hello WiX Visual Studio Votive (maybe check markup at bottom first)
WiX: Use a proper deployment tool is the best advice, for example WiX. Visual Studio installer projects are known to be inflexible and have limitations for service installation among many other problems (shorter, list form).
Specifically in this case you need to use custom actions to start and stop services (unless there are new constructs in the latest Visual Studio installer projects that I am not familiar with - I don't think there are). Custom actions are complex and error prone. Proper MSI tools use built-in MSI constructs to make service installation more reliable.
Post-Processing: Some people post-process their MSI using Orca or equivalent tools to add constructs to the ServiceInstall, ServiceControl tables after building the MSIs with Visual Studio Installer Projects. Not rocket science, but a hassle and not recommended.
ServiceInstall & ServiceControl: Essentially you need to author the ServiceInstall and ServiceControl tables so that the service is installed, started, stopped and uninstalled in an operational manner. Only a few combinations here really make sense. Such as to stop on uninstall and stop and start on install.
How to install and start a Windows Service using WiX
WiX Samples: WiX quick start suggestions here and some WiX samples of service installation:
https://github.com/Robs79/How-to-create-a-Windows-Service-MSI-Installer-Using-WiX
https://github.com/iswix-llc/iswix-tutorials/tree/master/windows-service
Advanced Installer: And two links for commercial tool Advanced Installer on service installations. Don't underestimate commercial tools as relevant for you. "Some tools are free only if your time is worthless". WiX is great, but can be hard to learn and always takes time:
https://www.advancedinstaller.com/installing-windows-services.html
https://www.advancedinstaller.com/user-guide/qa-install-service.html

How to create windows installer for my 3rd party plugin?

I want to create an installer MSI that will unload and move files I need for my plugin into the user's application folder. In my case the application is Cinema 4D, but this detail does not matter. I need to unload a .cyc file and place it in a specific subfolder under the application folder. In addition to that, I need to add a line of code to a .res file another subfolder of the application.
I want my installer to look nice
I have already looked at WIX, NSIS, Advanced Installer and Microsoft Visual Studio as possible options but do not know how to do what I have to do. I've seen installers that do exactly this - so how do I do this?
Most of the tools mentioned above should be able to help you get the job done, except Visual Studio (its support for building setup packages is quite limited).
Here is a step by step article explaining how to do this with Advanced Installer. You can download a trial version of Advanced Installer from the website, during trial you can access all the features.
Disclaimer: I work on the team building Advanced Installer.

How to make an MSI with Visual Studio 2012 and Installshield LE

I've been given a Visual Studio solution someone else made. It has an installer project using Installshield LE. The installer builds fine but it makes an exe and I'm supposed to make an msi. I know the guy who wrote the project would generate msi files but I just don't see any options to do it. Is this doable with LE?
Go to step 6 and drill down to the Single Image release type. Set Compression on the build tab to yes and set setup launcher on the setup.exe tab to no. Build this release.
Thanks for the help, guys. These tips sorted my issue.
After so many 1990s-looking releases, its amazing that InstallShield finally went to the trouble to make their Visual Studio integration so friendly... yet hid this vital option away.
I'm adding a screenshot, to help other users.
I've solved it by using the following
By using SingleImage as the build type
Under - Setup.exe tab (Build | Setup.exe | Signing)
Select Setup Launcher = No.
The build from InstallShield will come out as a .MSI file under
(\RELEASE_PROJECT\Express\SingleImage\DiskImages\DISK1)

how to make a uninstall option in C# program?

i want to make a uninstall option in my C# program?
can u help for this?
and provide some code also
If you deploy your application via a Visual Studio Setup and Deployment Project, an uninstaller will come standard with the installation. It will be available in the Add/Remove Programs of the control panel.
You can create an installation project which will automatically add support for uninstallation. Under Other Project Types you have Setup and Deployment. There is InstallShield LE and Visual Studio Installer. If you choose Setup Project under Visual Studio Installer project, you will have uninstall as part of the built project.
see this video
http://www.youtube.com/watch?v=Z-xFLltALg0
If you want the executable to remove itself. aka self-destruct. Check out this blog http://blog.pedroliska.com/2010/05/20/c-self-destruct-windows-app/

Installing a windows service from a Visual Studio Installer project

A colleague has written a Windows Application and left me to do the installers. I have created the installer project through Visual Studio and added the primary output of the service project to the new project.
When I run the installer it creates the correct folders and copies the dlls, exe and config file in, but it doesn't do the actual install of the service.
The service isn't listed in the Services window, and if I double click on the exe I'm told I need to run installutil to install the service.
How do I make the installer do this bit for me? I found this article:
http://www.codeproject.com/KB/install/InstallService.aspx
but that seems overly complex for what I would expect to be pretty basic.
I used this article:
How to create a Setup project for a Windows Service in Visual Basic .NET or in Visual Basic 2005
Felt pretty dumb that I couldn't figure it all out until I went through all of the steps in this article. It's not a trivial exercise by any means.
For those who are looking for updated instructions for Visual Studio 2010 (instructions in answer are for VS 2005) check the following link:
Walkthrough: Creating a Windows Service Application in the Component Designer (note that "other versions" [VS 2005, VS2008] are available from the same link)
I had this issue in my case the problem was I neglected to add the custom actions for the installer project. To find these right click project->"view"->"custom actions" under there it needs the primary output added to the folders.

Resources