Experiences with Wix# WixSharp compared to WiX
Asked Answered
D

2

21

We are using Inno Setup and are planning to replace this with WiX. But when evaluating and playing around with WiX, I felt the declarative manner has some limitations compared to programmatic setup solutions.

Moreover I found out that the WiX documentation is rather sparse. So I came across Wix# (WixSharp) which promises to create WiX source code programmatically via script files written in C#.

However we've had some negative experiences with very small companies and even 'one-man-shows'. Therefore I just wanted to ask about your experiences with Wix# (WixSharp) or even other good alternatives out there. Can you report some advantages or limitations?

Desiraedesire answered 10/4, 2012 at 14:19 Comment(1)
Oleg wrote the original CsScript which has been around since ~2004. github.com/oleg-shilo/cs-script/wiki I like the look of it myselfKieger
J
20

Wix# looks like an improvingly good bet on the "Will it be around next year" score; see below. And note that Custom Actions are now quite straightforward to build in Wix#.

From this article: http://www.codeproject.com/Articles/31407/Wix-WixSharp-managed-interface-for-WiX

In July 2014 Wix# was rereleased under more liberal MIT license and it is now hosted on CodePlex. https://wixsharp.codeplex.com/

In August 2014 UI Extensions to Wix# were released and described in this CodeProject article: "Wix# (WixSharp) UI Extensions".
http://www.codeproject.com/Articles/804584/Wixsharp-WixSharp-UI-Extensions

The fact that new Wix# features are coming out bodes well for the product.

Since Wix# is built on top of WiX and Windows Installer technology, it can only do things that are possible in WiX. When Wix# runs out of gas... WiX can do a lot of things that aren't directly available in the Wix# C# syntax, so you can generally use WiX XML technology directly to bridge the gap. Also see my answer here for additional examples of making Wix# generate the .wxs XML, and then including additional WiX XML code and invoking Candle and Light to build the resulting combined XML into an MSI. Programatically building an MSI

Below is a quick, non-exhaustive list of WiX and Wix# pros and cons that I have experienced thus far.

WiX/Wix# Pros:

  • It generates real Windows Installer MSI files.
  • The uninstall feature is "free"; you automatically get a reliable uninstaller.
  • The Server Admins in my environment readily accept MSI files for things I as a developer want to install, because they trust the MSI technology and the uninstall feature.
    • Windows Registry entries are included in the "free" uninstall you get, as long as you create them using WiX or Wix# native syntax and don't merge .reg files--you won't get a registry entry uninstall that way.

WiX/Wix# Cons

  • Because it's limited to the Windows Installer feature set, some "procedural" things are harder to do in WiX and Wix#

WiX Pros

  • Lots of great examples and support resources ("How do I .. in WiX") are available on the Web.
  • The utilities for harvesting registry entries and putting in XML WiX statements work well.

WiX Cons

  • As a C# developer, I found WiX XML to be unintuitive to get started with, working directly with XML files. Wix# and C# made more sense than WiX at the start.

Wix# Pros

  • Custom Actions are now simple to implement in Wix#.
  • Wix# integrates neatly with Visual Studio. I'm currently using it with VS2013.
  • Wix# and C# made more sense than WiX XML at the start. Better starting point.
  • Wix# is helping me learn WiX in a more approachable way. Seeing what does and doesn't work in Wix# helps in understanding WiX.

Wix# Cons

  • Wix# examples are currently a lot harder to come by on the Web. Often it is necessary to research the WiX how-to and then figure out how to apply it to Wix#.
  • I didn't find an automated path for harvesting registry entries and expressing in WiX# C# code. I translated the .reg file entries manually. It's necessary to have registry entries in Wix# "RegValue(" statements to get the automatic uninstall capability for registry entries. Note: Developer added this feature in a January 2015 release. I haven't tried it yet.

I will say, doing things in WiX/Wix# that were simple & obvious in procedural installers, like NSIS, and past generation script-based installers (e.g., older Wise editions) often takes extra research and creativity in WiX/Wix#.

Overall, I'm betting on Wix# as a growth technology and a safe bet for current and future use. Worst case, you'd still have your .wxs files, and could change over to using a straight WiX XML approach to building installers, and you'd still be getting value out of the Wix# time investment.

RECENT UPDATES TO THE Wix# Product for Common Installer Tasks

As of January 2015. See: [https://wixsharp.codeplex.com/releases/view/610843][1]

  • Can now import a .reg registry settings file instead of hand-coding registry class entries
  • Additional support for Windows Config file modifications
  • Specific support for Windows Service installations
  • Support for passing parameter values to Deferred Custom Actions, with all WiX supporting infrastructure properly auto-generated
  • Support for absolute path in target system directory, with all WiX supporting infrastructure properly auto-generated
Javier answered 7/10, 2014 at 19:26 Comment(2)
Edited to add list of some useful features added in Jan. 2015 release. While most of these things were "possible" before, they are much smoother now. For example, the ability to simply import and use .reg files directly (vs. hand-coding the registry entries in C#) and still get the free "uninstall" capability for the registry entries is a big productivity booster.Javier
I used the "import .reg file" feature and it worked great. However, I would like to assign registry settings in an imported .reg file to a specific Wix/Wix# "Feature ID", e.g., Basic install gets one set of .reg entries, Full-feature install gets the basic entries plus some additional entries in a second .reg file. Submitted request for this, developer says working on it for an upcoming release.Javier
G
2

WiX has been around for quite a while and has a lot of community support. I've been doing setup (in my spare time :) ) for about 8 years and have never found anything I couldn't reasonable do in WiX.

This is the first time I've seen WixSharp. My first reaction would be how stable is it given it's 0.1.42 at the moment. I'd also be concerned about how much of the MSI schema is actually implemented in WixSharp. It looks interesting, but I'd be more comfortable with an XML file. I don't really see any advantage to do it in C#.

Gestation answered 16/4, 2012 at 19:20 Comment(3)
I'd like to do some custom actions during the setup and I found it wasn't that comfortable in Wix and I hope I'll find a better way to implement custom actions directly in C# with WixSharp. Do you have to do custom actions like starting a service or check for more or less complex conditions? And how do you handle that in Wix?Desiraedesire
Responding to Dan Vallejo, for me, it was more approachable working in C# than in XML. For someone who already knows WiX XML, it wouldn't matter. The other advantage of Wix#/C# is the readability of the installer code. I walked thru the Wix# code with our server admin guys to show them what was in the installer (.NET COM Interop registration registry entries, etc.) and they were able to make sense of the Wix# code and thus feel comfortable running the installers on the servers they are the admins for.Javier
@MrCube, so far I haven't had to do significant Custom Actions in my installers. I did include a trivial Custom Action shell in one installer, and found it was simple to include Custom Actions in a Wix# installer. Check out the Wix# Custom Action example in the CodeProject article at codeproject.com/Articles/31407/…. Also there is a Custom Action example in the Wix# installation folder, in the file Samples\AllInOne\MyAppWix.cs.Javier

© 2022 - 2024 — McMap. All rights reserved.