Wix Bootstrapper multi-language - c#

I have a Wix installation set up. I am using Wix Bootstrapper to make windows. All installation windows are made by their own. I need to localize them, I can not solve this question in any way.

Not a lot of time, this will just be a bunch of links, hopefully enough for you to help yourself.
WiX Burn localization: Maybe have a look at this project on github for localization of your WiX Bundle (which I haven't really tried yet - this is someone else's sample): https://github.com/frederiksen/Classic-WiX-Burn-Theme.
I don't think this sample has localized MSI files, just the WiX Bundle. I am not sure.
MSI Localization: WiX has some support for standard dialog sets in a number of languages, but you need to localize your own, custom dialogs. I have seen some problems with these dialogs, but I usually get things working using the "Mondo" set.
I lack a full overview, but let me try to give you some pointers:
WiX Tutorial:
Localizing your custom setup dialogs
User Interface In General
Localization
User Interface revisited
More on custom dialogs
WiX Documentation:
How To: User Interface and Localization
WixUI Dialog Library
Using WixUIExtension (standard UI):
What else do I need to show the license aside from WixUILicenseRtf? (no Visual Studio)
WiX installer msi not installing the Winform app created with Visual Studio 2017 (Visual Studio)
IsWiX: Just trowing this is - I don't think there is much localization here, but there are some sample test projects that are useful. Also, you can find more advanced WiX samples and tutorials from the IsWix project. Essentially a GUI front end for generating WiX MSI files. Here are the actual tutorials. And the tool itself: https://github.com/iswix-llc/iswix. And the blog.

Related

Really struggling to get how WiX works

I am working on a WPF project. I have created a Wix project which runs along with the main project and has a program.cs component as well as the XML file.
Although I can see it creates the installer upon re-building the project, what is not clear to me is that why don't I have the actual WPF project inside it or as part of it. So really I don't install anything when I run it. Simply a shell program.cs file which is part of the Wix project.
I don't get the actual project at all. So how do I effectively "add" the WPF project to the WiX project so it generates the .exe or .msi file.
When I used the Windows native build project, I was able to get this however it is really tedious.
Thanks,
Ibrahim
Most of understanding how WiX works is understanding how Windows Installer works. WiX is mainly a language and compiler to author and build Windows Installer (.MSI) database files. It does have some additional extensions and the ability to create a bootstrappper / chainer (.EXE) and that is additional tech to understand.
MSI and therefore WiX should be thought of in terms of declarative programming rather then imperative. You describe the product, the UI experience, the feature/component/resources relationships or the "what" needs to be installed and MSI handles the "how" to install it.
WiX newbie here too. I found that this tutorial to be helpful to get started: Create a simple setup. It walks you through creating a new WiX project in the Visual Studio. It creates a really simple installer (e.g. doesn't even add a shortcut to the Start Menu), but I think it will help with your understanding of how WiX works.
After you get the above example working, I'd suggest reading through this tutorial: How To: Create a Shortcut on the Start Menu. Note: I found that it was easier to copy/paste the entire code sample at the bottom of the page, replace everything in the default Product.wxs file in the WiX Visual Studio Project, and then replace references to your own files as needed.

Additional Setup in Visual Studio Installer Projects

I am trying to create an installation for my project. I am using MS Access DataBase and for it to work Access DataBase Engine is required. If i download that engine https://www.microsoft.com/en-us/download/details.aspx?id=54920 from here and install it, program works.
How can i add that installation to my installation?
I am using Visual Studio 2015, C# and OLEDb.
Short Version: In essence you will need a deployment tool. List view of major deployment tools. Maybe that list view is the easiest overview? (a sense of scope). Much more detail below (and too many links too).
Details: There is some prerequisite functionality available in Microsoft Visual Studio 2017 Installer Projects, but I am unfamiliar with the details. I find this project type inadequate for real deployment work for a lot of reasons (lacking features and some odd implementations). More on this here - a few concrete problems to consider.
Several commercial tools will do this for you with special features to help make it quick(er). I verified that Advanced Installer can do it (and here is a great gateway to all things Advanced Installer. Some free features available). I assume Installshield can do it as well (certainly for other runtimes, didn't verify this particular one). Generally it will be handled by a setup.exe bootstrapper / chainer embedding all runtimes along with your own MSI file(s).
In other tools, you will have to do it yourself, by figuring out command lines and how to handle error conditions. There are some hints here (not tested by me - a google sweep will give you more): https://www.itninja.com/software/microsoft/access-runtime/2016-1
Get more command line info by going accessruntime_4288-1001_x64_en-us.exe /?:
WiX is free and open source - with a relatively hefty learning curve if you don't know MSI, and contains a bootstrapper feature called "Burn". Here is the documentation for: How To: Install the .NET Framework Using Burn (first read the "Building Installation Package Bundles" instructions in "Step 1"). A real-world Burn sample. And some sample source markup.
Some developers recommend the dotnetinstaller bootstrapper. Not something I know much about. It is just a bootstrapper. Runs things in sequence for you.
If you are doing in-house or ad-hoc deployment, even a batch file could do the job I suppose, but if you do that for a real product for large-scale and generalized deployment I would be very worried indeed. If there is one thing we hate as deployment specialists, I'd say it is batch files embedded in packages. Batch files (and scripts) are system administrator tools, not general deployment tools.
Some Older Links:
Executable files to MSI installer
How do Installation Software Programs Extract Files?
Create MSI or setup project with Visual Studio 2012
How to make an installer that automatically install all the prerequisite programs for the application
Windows service NOT shown in add remove programs under control panel
How to make an installer that automatically install all the prerequisite programs for the application
Wix - How to run/install application without UI
Visual Studio setup projects have a Prerequisites choice in the project's properties. This allows you to choose from a list of standard prerequisites and generate a setup.exe that will install the prerequisites and then install your MSI. The Access Runtime doesn't appear in later versions of setup projects because (I assume) Access 2013 ended mainstream support in 2018. The way to add your own prerequisites to this mechanism was with the Bootstrap Manifest Generator, which is perhaps still available but not well documented:
https://msdn.microsoft.com/en-us/library/ms165429.aspx
Apart from that I'd recommend that you learn how to build a WiX Burn bootstrapper executable that will install the Access Runtime and then install your MSI (which you still build with Visual Studio if you need to). If you do a search for that you'll find this kind of thing:
WiX - Install Prerequisites and 3rd party applications
https://www.c-sharpcorner.com/UploadFile/cb88b2/installing-prerequisites-using-wix-bootstrapper-project-and/
These will explain how to build the Xml to check whether the Access Runtime is installed and the command to use to install it. This is a much better choice than the Bootstrap Manifest Generator.

Windows service NOT shown in add remove programs under control panel

I installed my windows service via (name of the service: Testing Service)
InstallUtil.exe present in .NET Framework
(:\Windows\Microsoft.NET\FrameWork64\v4) in a windows 7 computer.
I can see my service under services console.
However, i went to programs and features of control panel to manually uninstall the same service, i didn't see my services under programs and features?
Any thoughts why a service will not be shown, so that, user can
uninstall it?
I checked the show hidden files too, but still service not shown?
InstallUtil.exe: As others have stated, InstallUtil.exe is intended for development use only, not for final distribution of your service.
MSI: The normal way to deploy services in the fashion you describe (with a proper entry in add/remove programs) would be to use an MSI installer created using a tool designed to help you do so (it is not advisable to "roll your own" tool to do this).
Ad-Hoc: The ad-hoc description of deployment tools below was written in a hurry, and has sort of been re-purposed as a general description of
such tools. Not too relevant for the question asked, but it sort of "happened" and here it is.
Free MSI Tools / Viewers
How can I compare the content of two (or more) MSI files? (towards bottom) - (most of) these are not full-featured tools to make setups, but great to inspect MSI files and to create transforms.
MSI Tools: Short-List
There are many tools you can use for MSI-creation, for example (arbitrary order - links to Stefan Kruger's installsite.org below will show further tools, these are just the most common ones):
WiX - quick download
Free, open source framework - excellent, but with a learning curve, hence a few more links.
WiX quick-start tips (a bit chaotic, strangely upvoted, must be helpful).
WiX's commercial branch FireGiant has a WiX expansion pack (which costs money).
Windows Installer and the creation of WiX (what is the idea behind WiX?).
How to install and start a Windows Service using WiX.
Documentation: ServiceInstall, ServiceControl.
Untested: How to create a Windows Service MSI Installer Using WiX.
IsWiX - quick download
Deployment and MSI expert Chris Painter has his own, free WiX-based tool called IsWiX
It can help with WiX's learning curve and manage WiX source files.
Also see his IsWiX Tutorials.
The various ways used (and abused) to install Windows Services.
Advanced Installer - quick download
Great commercial tool with lots of smarts to help you deliver packages quickly and reliably.
Some free features.
Here is a great gateway to all things Advanced Installer.
installing services, how-to.
InstallShield - quick download
The old and established market leader tool Installshield features a very rich set of functionality capable of delivering advanced setup requirements.
There used to be a Lite version which cost money at one point. Not sure if it is available now.
There is an InstallShield Limited Edition version. Unsure of its feature set and cost (if any). Does not work with Visual Studio Community editions.
Installing, Controlling, and Configuring Windows Services.
PACE suite - quick download
https://pacesuite.com/support/
https://pacesuite.com/docs/v5.5/how-to/edit-mgp/services/index.html
Visual Studio Installer project type
There is also the Visual Studio Installer project type in Visual Studio (VS 2017 sample).
I would not really recommend this - especially if you have advanced deployment or automation requirements.
It is very basic, and there are many severe limitations.
Install the Visual Studio setup and deployment project template.
Auto-Update?: Various ways to create auto-updating packages.
MSI Tools: Comparisons and Descriptions
What are the above tools like in actual use? Here are some pragmatic observations and summaries:
How to create windows installer (recommended overview).
What installation product to use? InstallShield, WiX, Wise, Advanced Installer, etc (an aging, detailed comparison of these major MSI tools - very detailed and "pragmatic").
Deployment Tools (General)
There are many further tools available to create create installers / setup.exe files of various kinds (not just MSI tools, but general purpose, legacy tools, multi-platform tools, etc...):
Stefan Kruger's Comprehensive Lists:
Non-MSI installer tools: http://www.installsite.org/pages/en/tt_nonmsi.htm
Windows installer tools: http://www.installsite.org/pages/en/msi/authoring.htm
Sys-admin tools: http://www.installsite.org/pages/en/msi/admins.htm
Other Links:
Cross-Platform Installers: Does an universal cross-platform installer exists? (non-MSI tools).
dotNetInstaller: There is also the dotNetInstaller Setup Bootstrapper - which I have never used.
Here it is on github.com (source).
Just a bootstrapper (runs things in sequence for you, and then some), not a development tool as such. I find this tool "a bit weird".
Some General Links: And there are various other ways to deploy - for example with self-extracting zip archives and stuff like that. Not recommended, but some links:
Error Creating a 7-zip installer package (7-Zip, iExpress and other self-extractor creators)
Combine exe and msi file in one installer (recommended)
Visual Studio 2017 Installer Project - include VC++ 2015 Redistributable (WiX Burn Quick Start)
Additional Setup in Visual Studio Installer Projects
InstallUtil only performs actions exposed by your .Net Installer classes, such as registering a service.
It does not perform the "standard" application installation which results in the entries being added into add/remove programs.
To do this, you will need to look at various install builders such as Wix, Installshield, etc.
Installutil.exe (Installer Tool)
The Installer tool is a command-line utility that allows you to
install and uninstall server resources by executing the installer
components in specified assemblies.
Its job in life is to do exactly that,
To fill in your knowledge you should read through this
Chapter 2. Install/Uninstall
You will notice this is an entirely different concept, and actually has all the information you need (albeit in a very verbose manner)
There are various ways to achieve what you are after, one of them is using out of the box installation software, MSI, click once, or many others. or you could roll your own by using the above resources
There is a Microsoft Visual Studio 2017 Installer available via Tools->Extensions and Updates
This official Microsoft Extension provides support for Visual Studio Installer Projects in VS2017
Because I cannot make and edit the most interesting answer, I will add it here:
NSIS Installer - quick download
NSIS (Nullsoft Scriptable Install System) is a professional open source system to create Windows installers. It is designed to be as small and flexible as possible and is therefore very suitable for internet distribution.
Free and open source
Used by WireShark (source of Wireshark installer)
Example tutorials

How to create a custom WPF interface to my Setup Project?

In my company we are using NSIS to develop our installers, however, the NSIS tool is so hard to maintenance and develop.
We are searching how to develop the installer using Visual Studio, but we would like to create our own custom interface with WPF for the Setup Project. Is it possible?
If it is, how could I do this?
P.S.: I don't know if it could matter, but our installer need to take a lot of dlls, create registry keys, install and start Services, run database scripts.
Google is your friend...
For standard setup project with custom WPF screens, there are several tutorials out there:
Tutorial
The MSDN documentation:
Role based installer
Customization of installer
Alternatives
As comments said, there is also Wix or Inno setup.
If you want to keep it full c#, you wan try Wix# (MIT license).

Installer for C# App

I'm developing an open source C# application. For awhile now, I've been using a basic .NET installer I coded myself. However, with a recent change, that is no longer practical for me, as I'd have to add a large number of files to the installer - and they may change with each release. A ZIP file is also not practical.
I've done some checking online, I see a lot of MSI, ClickOnce, Self-extracting ZIPs, and (imo the most promising) the NSIS system. None of them seem to exactly fit my needs, so I'm looking for advice on which system to use.
Actual installing of my program is very simple. Basically, I just need to copy the bin\Release directory (and all subdirs) to the client's computer. I've been achieving this somewhat ad-hoc, by embedding every file in my .NET installer, and maintaining a file table of what goes where.
Unfortunately, I just localized my app. I now have 30+ .resx files (Which are compiled to dlls and placed into MORE subdirectories by Visual Studio) and, obviously, it's impractical to add 30+ folders and DLLs to my installer. Hence why I'm on this search.
There's also a few other requirements:
The installer should search predefined directories for a specified .exe. (My app is designed to be a drop in replacement) If the .exe is not found, it should prompt for its location
The installer should verify that "OldApp.exe.bak" exists. If not, it should rename "OldApp.exe" to "OldApp.exe.bak"
The installer should update files. Ie, if "Culture.de.dll" hasn't changed, the installer will leave it alone.
The installer should work with all Windows versions of all .NET IDEs (VS, SharpDevelop, Mono, ect) but does not need to work on other platforms.
When I build the solution, the installer should be automatically regenerated. In other words, it should be run-able for by "Post-build" section.
The installer generation must be able to be added to a source code repo. This is so that anyone who downloads the source of my app can compile the installer as well.
Sorry for the long post, I figured it was better to post more than less.
I'd recommend SharpSetup. It combines WiX and C# for a pretty flexible implementation. Not much I've found it can't accomplish.
We use WIX extensively: http://wix.codeplex.com/
You may have to customize your installers with some exit routines to do things out of the ordinary, but there are hooks in Windows Installer framework that let you do that.
You can put these definition files (XML) in your source control, and you can configure a build to execute the installation. However, anyone that gets your source would need to have the WIX utilities installed.
I would recommend NSIS. From my experience any installer feature that I have required has been covered in NSIS documentation or community examples. I can't comment on NSIS integration with Visual Studio as I use NSIS integrated with my Jenkins build server. There appears to be a free Visual Studio Add-In called Visual & Installer which provides NSIS integration with Visual Studio. I have not personally used it but it appears to be currently actively developed so might be worth checking out.
WIX is a good one. According to Wikipedia, it is used by Microsoft to produce installers for some of their own products.

Categories

Resources