Creating WiX Installer with UI and Localization - visual-studio-2013

I have the requirement to create an installer for a WPF application. That's not much of a problem (but much of a pain with WiX), but now my client updated his requirements and I'm starting to get frustrated. Please tell me if the requested functionality is possible with WiX (and if, could you please provide a hint?).
My Setup:
Visual Studio 2013
WPF Application (many files as it includes a self hosted web server and some pages/css/js, etc)
Requirements:
Installer has to be a MSI package for automated installation
There has to be a UI guiding the user through the installation (where to install)
The installer has to be localized (13 languages), starting with the windows language with the opportunity to change on installation
The successfully installed app has to be started (or at least there should be the opportunity to do so at the end of the installation)
I'm not sure if it's even possible to create a functioning MSI with WiX Bootstraper. I've only seen exe files.
Thank's for your time!

Ben,
It's a very easy task. Don't get frustrated. So here are solutions for your requirements. Hope you are still working on it :
Installer has to be a MSI package for automated installation
No need to add Bootstrapper for it. Just create a simple WiX installer.
There has to be a UI guiding the user through the installation (where to install)
You need to add WixUI.wixlib library in your project reference.
The installer has to be localized (13 languages), starting with the windows language with the opportunity to change on installation.
You need to add Languages in Package node.
Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Languages="1033,1031"
The successfully installed app has to be started (or at least there should be the opportunity to do so at the end of the installation)
You need to write CustomAction for that & need to launch it after installation.
You can find a sample code here.

Related

Custom installer for application in Visual Studio 2017

I need to generate an installer for my application but first I need to know if it is already installed on the system node.js, npm and other applications
Is it possible to include the installation of node.js within the installation of my application and to know if it is already installed?
I'm using Visual Studio 2017 and a WPF project for desktop applications
When the application is already installed I need to execute npm commands in the console for this reason I need to install them before or verify if they are installed correctly
I appreciate any help.
UPDATE: Advanced Installer: How to install a NodeJS web app. Really excellent videos IMHO.
Best Effort: I don't know much about Node.Js, and hence should not answer. But I haven't seen anyone else answering these questions either. Despite lacking experience, let me try to give a few suggestions.
Windows Installer: There seems to be an MSI you can use to deploy Node.Js. And there are some alternatives listed. (Essentially Chocolatey and Scoop).
Heads-Up: I have answered a more specific deployment question relating to a failed installation of the Node.Js MSI earlier: Node.js installation (windows installer) terminates prematurely on windows 10 64-bit. This may or may not be fixed.
Deployment: To deploy a prerequisite MSI before your own package installation, you can use a deployment tool capable of bootstrapping / sequencing / downloading - in other words to run several installation operations in a given sequence wrapped as a setup.exe. Or you could investigate the Chocolatey approach. With regards to the deployment tools, I am a bit tired of writing up the list of capacities these tools have and don't have. I will link to a few flavors of answers for this:
Prime Suspects:
Installshield Suite Projects - screenshot of Suite projects.
WiX Burn Bundle - beware: link overload. But there is a "Hello Burn" example. Official WiX documentation.
Advanced Installer - Prerequisites View - screenshot of view available in some project types.
One of the above tools should be able to do the job. Only WiX Burn is free and open source. Sometimes you can save a lot of time by going with a commercial tool. Obviously especially if your company already have a license for such a tool (which can be a days work to figure out).
Free Tools: In the realm of free-tools only and alternatives to WiX, some people use self-extracting archives made with 7-Zip and WinRAR and some other tools described here: Combine exe and msi file in one installer. I don't like this for security reasons and other reasons as explained in the link.
Simplicity: For corporate deployment a simple batch file or some custom construct distributed via your deployment system (SCCM, etc...) could suffice. Or even a zip with an embedded batch file to kick off your zipped installers in sequence could work. All depends on your scenario. I wouldn't roll with such an approach for global distribution.
And here are several other answers where I describe available deployment tools:
How to create a MSI file which simply copies a directory to Program Files?
Visual Studio 2017 Installer Project - include VC++ 2015 Redistributable
Some Links:
Create MSI from extracted setup files
Error Creating a 7-zip installer package
How to create windows installer
What installation product to use? InstallShield, WiX, Wise, Advanced Installer, etc
Nodejs - Another installation is in progress

How to Deploy a Windows Service using Visual Studio 2017 Community

Working with VS2017 Community I have written a service that works on my local machine. I followed the instruction here:
https://learn.microsoft.com/en-us/dotnet/framework/windows-services/walkthrough-creating-a-windows-service-application-in-the-component-designer
and installed it successfully using Installutil.exe (as per instructions in above link). All good.
I now want to deploy that across six servers in our organisation. In Microsoft's documentation about installing services (https://learn.microsoft.com/en-us/dotnet/framework/windows-services/how-to-install-and-uninstall-services) it says:
If you’re a developer who wants to release a Windows Service that users can install and uninstall you should use InstallShield
and links to a page that applies to VS2012 (can't post any more links as my reputation<10)
I have downloaded and installed the "Microsoft Visual Studio 2017 Installer Projects" package, which allows me to create a Setup Project. When I run it, it installs the project output correctly (i.e. copies the exe & dll files to the correct folder in Program Files) but does not create the service.
There's a detailed post about deploying services on this site (question 9021075) but when I follow those instructions I get a 1001 error on Install.
All the documentation I can find refers to earlier versions of VS or the previous Installer package, so I'm not even certain if I can do it with the software I am using.
So, with VS2017 Community using Microsoft Visual Studio 2017 Installer Projects, how to I create a stand-alone Installer to deploy a service that works correctly when installed locally using InstallUtil?
Or can I use InstallUtil on the target machines? I think I'd need to install Visual Studio on them for that, which I'd prefer not to. Is there a quicker way?
I only have 6 servers to install this on, so even some manual work-around might do.
Thank you for the responses. I now have a solution. I found InstallUtil on the Target Server (in my case it was in C:\Windows\Microsoft.NET\Framework64\v4.0.30319 but search will find it). I copied and added that to my project as content so when I now deploy it, I have InstallUtil in the same folder as my EXE.
To install, I run CMD as admin, cd to project folder and issue command:
installutil.exe myService.exe
This is a one-off task. Once the service is working, to update it I just need to stop it, upload the new myService.exe (& any DLLs) to overwrite the old ones and restart it again.
Further information about settings you're using for the serviceProcessInstaller1 and serviceInstaller1 files will be needed to debug this issue, as the 1001 error raised by the installer is a generic error.
An alternative way of doing this is to use Topshelf, which is a framework for hosting services written using the .NET framework. It simplifies the creation of services, allowing developers to create a simple console application that can be installed as a service using Topshelf. The reason for this is simple: It is far easier to debug a console application than a service. And once the application is tested and ready for production, Topshelf makes it easy to install the application as a service.
Alternatively, you could use InstallUtil.exe. It is part of the .NET Framework, so no need to install Visual Studio.

Building an installer that runs another installer

My company has a project for which I've developed an application in c#. I can create an installer for that application. However, the project requires users to install another application built in c++ that has an installer built using Visual Studio 10. Is there a way that I can build an installer that includes installation of the second product before installing my application?
What you are looking for is a bootstrapper or chainer. The WiX Toolset provides this functionality in a tool called Burn. It allows you to provide a single user experience while installing all of your setup packages. You can read about it more in WiX .chm.

How to create a Installation Bundle Package?

I have an application which require .net 2 and .net 4 framework with adobe reader , i want to install them before software installation, how i am supposed to do this? Kindly please guide me towards right direction.
This is usually done by adding the packages you need as prerequisites for the main installer. Most commercial setup tools support prerequisites one way or another. Here is a list which can get you started:
http://en.wikipedia.org/wiki/List_of_installation_software
Pick a tool and try using it to create your installer and add prerequisites for it. I recommend Advanced Installer or InstallShield. If you want a free solution, you can try WiX.
What you need is basically a suite installation. The link I included shows how to do this with Advanced Installer (Disclaimer: I work on this tool). This is a commercial tool, but it saves you from learning to code Wix/NSIS projects, as it is completely GUI driven, thus you can built your installers without writing any code.
With NSIS as your installer, you can refer to the following pages for help with detecting and installing .NET:
How to ensure a required version of .NET Framework is installed
How to automatically download and install a particular version of .NET if it is not already installed

Creating an msi containing windows service and other dll files

I have a windows service that installs and runs fine. I want to create an installer/msi bundle that contains the windows service + other .dll files. And when I run the msi, I want it to run the service and the dlls'.
Currently I am at a point where I have a SetUp project which can install and uninstall the windows service that I created. And the dlls that are being used for a specific task also work fine individually. I want a package that would initiate these 2 tasks.
Do I need to use any third-party package creation wizards? Please guide me to achieve this.
Thanks in advance.
I don't understand what you mean by "specific task" regarding your DLLs, since DLLs are not executed directly... does your service depend on those DLLs?
I don't want to do commercial but I used http://www.advancedinstaller.com/ with the enterprise license (1k$) for very very easy complicated MSI functionality.
What are you doing with those DLLs? Just install them?
//
Well you can easily deploy your service and related DLLs, and registry settings, .... with that tool i mentioned, but its not for free. But this should be possible without it, I just don't know any tool that gives you an easy interface to creating such MSIs. I don't have any experience with the Visual Studio integraded MSI generation / install projects.
You could "try" the trial ;) The basic/free version does not support this.

Resources