best approch among EXE and MSI - winforms

I have an application that needs to be delivered as a package.
What are the best among EXE and MSI Installers, and why?
Is there any open source tool to decompile the EXE or MSI?

It depends on what kind of EXE you are talking about.
MSI is setup package that is run by Windows Installer. If you make setup project with Visual Studio it will provide both MSI and EXE for you. EXE in this case just a bootstrapper (MSI or EXE). It will run MSI after checks that Windows Installer is in place.
If you use other tools like InnoSetup, this EXE is a setup package itself, not a bootstrapper.
Regarding to your question about MSI editor: Orca MSI Editor.
If don't need need very complicated installer, I suggest using Visual Studio setup project as it is simple, yet powerful enough.

Many installers these days use MSI internally although they're distributed as EXE. You need an EXE to ensure all the prerequisites are installed: .NET framework, for example; and it installs the prerequisites if they're not. Then it extracts the MSI package which handles the rest of the installation.
MSI provides some advanced install features:
rollback support: if something failed during installation, it returns the system to the state before installation started.
repair: if your application stopped functioning correctly, users can use this feature to reinstall the application. It restores missing files, registry entries.
updates/upgrades: MSI handles application updates/upgrades. MSI package can be configured to automatically the previous version of the application when user starts installation of a newer version. This happens transparently to user: it looks as if only the new version is installed.
patches: MSI supports patches. When only several files of your application are modified, you can update them using a patch package (MSP). The patch will be smaller than the full package.
advertised shortcuts: you can allow users to not install some features of your application unless they're used. When users access such a feature, MSI installs the necessary files.
Though it takes some time to learn the technology.
You can do anything from an EXE file, while MSI is for installation only. Inno Setup and NSIS installation packages are distributed as exe files. They have a scripting language which describes installation steps.
WiX toolset has MSI decompiler called dark.

check Difference between EXE and MSI

I posted a summary of some MSI benefits (and problems) on serverfault.com:
https://serverfault.com/questions/11670/advantages-of-using-msi-files

MSI is a Microsoft Installer, it is newer than the older EXE , Wise Installer and many others support it. It allows for a smarter install with what needs to be deployed (like CAB files, and registry settings etc...) and it can check for previous installs etc..
MSI are ONLY installations, while EXE can do other things like run.
I would use InstallShield and build an MSI
I'm unsure about #2

You can just tell Visual Studio to make your application into an MSI/EXE. If that works and does what you want, just do that. It much effort on your part creating an installer.
MSI means you are using Microsoft's Installer. Microsoft has legitimate reasons for recommending (i.e., not giving your application Certification) MSI. However, a good MSI is tough to produce, so I don't recommend it unless you need your application to be certified.
If you don't require certification, I recommend Inno Setup, along with a front-end like ISTool. It's easy to use and gives you simple interfaces to perform most common installer tasks. In a pinch, it supports scripting to allow you to do anything it doesn't support.

Related

Windows Installer 4.5 Doesn't appear in the prerequisites component list

From Prerequisites on the setup property pages, I selected the option to Download prerequisites from the component vendor's web site
There is no Windows Installer 4.5 in the prerequisites to install option..
because every im installing my setup using the sqlexpr_x64_ENU.exe in custom actions to install, run the setup after the extracting sqlserver it pops up the window says
There is a problem with this Windows Installer package. Aprogram run as part of the setup did not finnish as expected. Contact your support personnel or package vendor
im using VS2017 on windows 10
Exclude MSI Engine: You should not include Windows Installer 4.5 with any package these days. This runtime is from back in the day of Windows Vista - we are long since on version 5. Windows Installer should be deployed only via Windows Update as of today - in my opinion. Leave the runtime out of your setup.
No Concurrency: You can not run an MSI setup from within another MSI setup via a custom action. This is due to technical restrictions. There is a mutex set when an MSI runs its actual installation sequence, and triggering another installation sequence from within it will fail. A similar answer on the topic.
Setup.exe Launcher: What you need is to install your pre-requisites via a setup.exe launcher instead. This runs installations in serial, not in parallel. Which version of SQL Server are you installing? I see only a couple of versions available in the Visual Studio Installer Project launcher.
Other tools have features to allow you to install a setup.exe with embedded packages of various kinds in sequence. I have explained a myriad of times how to do this in previous answers. Here are just a few that I found quickly:
SQL Server named instance with Visual Studio 2017 Installer project (basically exactly the same issue - I suggest WiX the open source, free alternative)
Custom installer for application in Visual Studio 2017 (I suggest WiX and several commercial tools that are easier to use - maybe try to read this one)
Cannot call command.exe(SQL Server Setup.exe) while calling C# CA with parameters
How to create a MSI file which simply copies a directory to Program Files? (tools list)
Combine exe and msi file in one installer
Visual Studio 2017 Installer Project - include VC++ 2015 Redistributable
The general situation:
The problem is not Windows Installer 4.5, it's the fact that you are trying to do a recursive MSI install (the SQL one from inside yours) which is not allowed and will fail.
The MSI 4.5 engine is pretty much obsolete, about 10 years old, and anyway it's not the issue, and it's not clear why you believe it is. But it IS in the Prerequisite list on my VS 2017 setup project prerequisites - see 3 - even though you almost certainly don't need it.
There are some SQL Express options available in the Prerequisites of the VS setup project - right click the project in solution explorer and choose Properties, then Prerequisites.

3rd Party dependencies and SVN Integration with Visual Studio Team Services

I'm assessing moving from TeamCity to VSTS and there are two steps I have in my pipeline that I'm not sure how to setup in VSTS.
How do I include 3rd party dlls in my build? Currently we use a tool that must be installed in the Developer's computers that has separate dlls for x86 and x64. The x86 are included in the project and are needed for the designer, but the x64 are copied from the Program Files folder with an after-build command in Visual Studio. For it to work in TeamCity the tool was installed in the server, so the same after-build command copies the dlls into the build directory as in any other developer computer.
I don't see a way to achieve this in VSTS without including the x64
dlls in the source code, which isn't desirable due to the tool's
license.
How do I publish to SVN? Currently our binaries are hosted in an SVN server. In TeamCity I have a PowerShell script that (in short) updates the SVN local repo in the server, copies all the files from the build directory into the SVN repo and commits the changes.
Storing your dependencies
Lot's of options available here:
Put them in a NuGet package and store them in VSTS Package Management. Have your build restore the package during build.
Put them in Source control, either SVN or TFVC and fetch them during the build.
Store them in Azure Blob storage and fetch them on-demand by downloading them at the start of your build.
Use a custom build agent (Azure VM?) and install the software and the VSTS build agent onto it.
Store them as Build Artefacts in one Build Definition and fetch them using the Fetch Build Artefacts task, which is available from the marketplace.
I'm not sure what kind of license issues you're facing, but I'd expect that each has the same issues if you're not allowed to put the binaries anywhere other than on a licensed machine. Maybe the vendor offers a better option or can be persuaded to offer a Cloud/VM license option.
Publish to SVN
I don't see why the same PowerShell script couldn't be used. Though I'd recommend not to alter your repository from the build pipeline. It makes future CI/CD scenarios much harder. You can attach the binaries as Artefacts to VSTS Builds and that way they can also easily be linked to Release pipelines. You may need to fetch the latest version of svn and store it somewhere in order to run your script. When running on a Azure VM, you can simply install SubVersion directly to the agent.
There is no built-in task available.

Visual Studio 2015 CE Setup Installer: Redistributable Package

I have my my setup project in (Visual Studio 2015: Community Edition) ready to be built and create my program installer. But, obviously the program will not work on other computers without the appropriate redistributable package installed on the clients computer.
So, I need to set that up in my project but I do not know how. I read in a post on another site that it is located in:
Project>>Setup Properties>>Prerequisites
But, all I just see are selectables for ".net framework" related things. Also, I read that merge modules are not good to use due to servicing issues.
If you have any insight into whether I am needing to download an extension for the correct prerequisite to appear, use merge modules, or something else it will be greatly appreciated!

What's the protocol for packaging external software with InstallShield?

My WPF project requires Adobe Reader. Apparently when I try and run the installer, it says I need to have it installed before I run the installer for my project.
I was wondering how do I package it along with InstallShield so that the user can select the option to have Adobe Reader install before installing the main project instead of having to search for it online themselves to install it?
Is this even possible? I tried to search online but I'm having hard time finding results.
Right now I'm using InstallShield Limited Edition for Visual Studio 2012.
EDIT:
Here's one screenshot where I picked the settings:
EDIT #2: I found a redistributable .exe of Adobe Reader 9.1. Now, I am wondering how I can tie that into InstallShield?

Embedding SQL Server into a .NET application

Hey, I've just finished writing a VB.NET application. Now I want to package the executable and the database ofcourse into a single installer file. I tried using QSetup, InstallShield to make SQL Server embedded into the setup file, and finally after hours of try&fail I have no idea. Anyone?
You can do a rightmouse on the properties of your Visual Studio Setup Project, and then there is this button 'Prerequisites'. There you can tick 'SQL Server Express ...' Or the 'SQL Server Compact 3.5'
link to image
You're probably best off just to set the connection file directly to the mdf, and attach it when the program is run. This is easier as it doesn't require a custom setup script to install the database to the database directory itself.
Note: Consider using the Compact Version, it's smaller, people don't like a full blown engine on their computer :)
InstallShield has a concept called Setup Prerequisites where you can teach it how to install additional packages along with your own. In older versions this would happen before calling your MSI. In newer versions you can have a "Feature" prerequisite where the prereq can associated to a feature and only installed if that feature is selected to be installed and after it's been selected but still before the main activity of your MSI occurs during the install execute sequence.
InstallShield also has a pattern for executing SQL scripts against your database instance so that you can then load your database into your newly installed instance.
All of this is quite powerful but it does take a bit of digging to learn.
As far as I know, anything but the SQL Server Compact Edition (SQL Server CE) cannot be embedded into your setup, really. Microsoft doesn't want that - you need to have SQL Server Express installed separately - any other edition can't even be shipped with your software (the client must have a license and installation separately).
You can indeed distribute SQL server with your custom application:
http://msdn.microsoft.com/en-us/library/bb264562(SQL.90).aspx

Resources