Experiences with Wix# WixSharp compared to WiX - wix

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?

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

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#.

Related

Can I convert a sequence of wxi files to a Visual Studio Wix Project?

I have a lot of wxi files for a Wix setup.
All together works great as a setup but I think But it works good.
But with changes and extensions it is extremely confusing.
Looks like:
Product.wxs
App.wxi
CustomAction.wxi
Firewall.wxi
Feature.wxi
en-us.wxl
Can I convert all these somehow to a Visual Studio Wix Project? And if yes how I can do it?
Short Version: Below is an attempted generic answer: 1) You can use another tool such as Advanced Installer or Installshield, 2) you can find help with WiX to continue to use it, and 3) you can even use dark.exe to convert other MSIs to WiX format (this can help you with WiX markup syntax - you can implement in another tool and covert to WiX - then the markup will work).
WiX is particularly good - I think - for corporate in-house use (large companies) where expertise is readily available and can be maintained over time. For a lone developer who does setups once a year it might be too much to handle with all the flexibility and syntax?
Alternative Tools: I forget my ad-hoc quick overview of MSI tools in the comments above. Both Advanced Installer (help portal) and Installshield have excellent features that makes you able to deliver setups quicker than with WiX.
Advanced Installer and Installshield should have features to import many project types. I have not tested lately, there could be changes.
Update: https://www.advancedinstaller.com/import.html
VS Installer Projects Limitations: WiX has the flexibility needed to make pretty much anything you need, Visual Studio Installer Projects have many limitations (short list form). I would not recommend going for a conversion - especially since this setup looks to be complicated enough to require WiX's flexibility.
WiX Quick Start Material: If you go here and click the "WiX Samples" entry there is a list of WiX resources in the grid. Also, have a look at "WiX Quick Start" section here.
Dark.exe: In fact, WiX has a tool called Dark.exe which can be used to decompile an MSI file to WiX markup. In other words it is generally easier to move to WiX than from it - although Advanced Installer and Installshield should be able to import WiX and other project files and also import MSI files.
Dark.exe, Sample Syntax:
dark.exe -x outputfolder MySetup.msi
An answer on MSI files and viewers: How can I compare the content of two (or more) MSI files?

How to uninstall a non-msi InstallShield setup in Wix toolset

I have an old installer that is made with InstallShield 2015, its non-MSI based (I tried opening it with 7zip and could not --> non-MSI based, am I right?).
In general, I need to stop using InstallShield and migrate to Wix.
Is it possible some how to convert InstallShield it to Wix?
Using Wix, I need to detect if a previous version (the InstallShield version) is currently installed and automatically uninstall it and then continue with the normal Wix process. Is such a thing possible?
Thank You :-)
I'll add a quick answer for reference, though the problem appears solved already.
If the old Installshield setup is an MSI, you can use dark.exe from the WiX toolkit to "disassemble" an MSI into WiX source code (dark.exe can also decompile WiX setup.exe bundles - there is a somewhat messy description of this here: How can I compare the content of two (or more) MSI files?).
After some cleanup you can compile the WiX source to a new WiX-built MSI. A bit of knowledge and experience is needed for the cleanup to be successful (eliminating GUI sections, add a WiX GUI, realign source paths, clean up binary stream tables, etc... - not trivial, but not rocket science :-).
If the old setup was a legacy installer (not MSI), you can convert it to MSI by using a repackager tool to capture changes done to the system during installation and convert them to an MSI. A lot of knowledge is required to clean up such a capture. If you know the product it is often better to code a new setup "by hand". Or if you are in a large corporation chances are you will have a "repackaging team" available somewhere who will have the expertise to do this job for you.
Yes, old setups can be uninstalled as part of your new MSI.
As you discovered if the old setup was an MSI you can simply use a major upgrade to remove it during the new WiX install.
If the old version was a legacy setup things can get considerably more involved often requiring you to "record" a dialog response file to feed to the uninstaller function of the old setup.exe file. Not at all trivial, and quite error prone. Incidentally one of the major benefits of MSI is the completely suppressible GUI.
For reference, here is an old answer with information on dealing with the infamous setup.exe files that we frequently have to uninstall and upgrade:
How can I use powershell to run through an installer? The setup.exe can be many different things: Installshield Setup, Advanced Installer Setup, Inno Setup, Self-Extracting Zip-Archive, a proprietary setup format, the list goes on...

Installshield or Wix [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I have a pretty huge web application developed using asp.net 3.5 and I need to prepare an installer package which will be using to deploy the application on IIS 6 and 7. I have done a lot of research on Wix and Installsheild 2010 (pro) and need some advice before making decision. I notice that the installsheild is quite expense in terms of license but for me, I have enough budget so that won't be an issue. the installer should be able to perform the following processes.
Deploy the published web resource
(aspx etc).
Create Virtual
Directory.
Create Database on sql
server and run some initializing
scripts.
Modify XML files and
web.config files.
Set the
permission to allow writing to the
files in the virtual dir.
I found that both technologies are capable of doing the above scenarios but I would like to get personal experience and advices.
Having created a Wix installer to do exactly what you're looking to do, I'd happily recommend it.
The benefits of Wix over InstallShield as I see it:
Since Wix is free, everyone on your team can install it, and thus everyone can contribute to the installer. If one dev adds a library to the project, they can update the installer as appropriate, without waiting for the "Setup guy" to do his bit.
There are no issues with installing Wix on a Build Server, making it a nice fit for an environment where you use Continuous Integration. It integrates nicely with MSBuild (see the Votive project).
Wix installers are built from text files, making them very easy to version control.
Wix includes Deployment Tools Foundation (DTF) which makes it very easy to create custom actions using .Net code.
Wix is close to the metal: you can usually apply your knowledge of Windows Installer quite directly to Wix. Conversly, learning Wix teaches you a lot about Windows Installer which is always good when it comes to providing support for deployments.
To balance this, there are a few things to be aware of:
Wix does have a steep learning curve. If you haven't already, check out the WiX tutorial.
WiX isn't a "visual" environment like InstallShield - it's usually text and xml all the way. Having said this, there are editors, free and commercial.
Specifically relating to IIS setups: Wix 3.0 only works against the IIS 6 metabase APIs. To install on IIS 7, you'll have to enable the Metabase Compatibility feature on the target server. Full support for IIS 7 is coming in Wix 3.5 - I've tried the beta of this, and it seems to work fine so far.
Based on my experience with Wix and InstallShield, I would recommend using InstallShield unless you need a fairly basic and straightforward installer. I say this because the huge Wix learning curve is made even more difficult by the lack of information available
There are no books on Wix, so your resources are limited to the Wix tutorial, which is detailed and lengthy but still doesn't cover much beyond basics, and blog posts you find via Google. Granted, there are many good blog posts which detail how to accomplish specific things, but unless you don't have deadlines to meet, you probably can't afford to sit and research how to do specific things in Wix for days at a time. Personally, I found myself doing this way too much for Wix to be a feasible solution (again, unless you only need a simple installer)
Ultimately, in my case, we had existing installers which were developed with InstallShield and we are simply able to be productive quicker with it. InstallShield also has its own scripting language which has pretty good documentation too.
Another big plus for me was that InstallShield eases the pain of multiple instances (try searching for how to do this with Wix and you'll get an idea of what I'm saying) and upgrading/patching. I was able to accomplish both of these (especially multiple instances) in a fraction of the time with InstallShield than what it took to accomplish in Wix.
My advice would be to choose based upon your time constraints/deadlines/commitments, complexity of your installer, and maturity of your product. Wix requires LOTS of research for things InstallShield provides a fairly quick way of doing. This can be even more painful if you have a mature product versus a fairly young product.
Hope this helps.
To address Samuel's points above....
I've created a project on CodePlex that is called IsWiX that addresses the democratization issue. You use it with WiX to create Merge Modules and then consume the Merge Modules with InstallShield to get the best of both worlds. This allows a setup guy to use InstallShield and dozens of my developers to use IsWiX/WiX. The XML can still be marked up with additional metadata so we aren't restricted in what the modules can describe.
InstallShield has a stand alone build engine that integrates with MSBuild/TFS and provides an automation interface. There is no advantage for WiX here.
InstallShield is a text file also. It's an uglier DTD format but IsWiX solves that problem by abstracting the frequently changing portions from the rarely changing portion of the installer.
I highly encourage the use of DTF with InstallShield. After all a Type 1 Exported Function is the same to any MSI based tool.
InstallShield has a direct editor which shows you the underlying tables. This is actually closer to the metal then WiX which uses an XSD based DSL to output the metal.
All in all, there are really good things about WiX AND InstallShield and I use them together to create extremely complex installers.
PS- IsWiX put a lot of thought into hashing and sorting to solve branch merge problems. ( We use Base Clearcase on dozens of branches so this was very important to us. )
+1 to Samuel's answer. As for the steep learning curve... if you don't understand the way the underlying technology (Windows Installer) works, you'll have problems with the support of your installation, either InstallShield or WiX you choose. But WiX encourages you to learn Windows Installer to use WiX abstractions correctly.
I personally started my setup project (a huge web application) with InstallShield, but I recently moved to WiX and I'm happy about it. The key points of my choice:
it is free
it is XML (no more pain diffing and merging)
it is friendly to NAnt
it does exactly what you instruct it to do (no more and no less)
Hope you find this information useful.

WiX, Windows Installer summary?

I started to write an installer with WiX. I've spent several days reading blogs and studying tutorials. Last night I couldn't sleep, so I sat down in Fireworks and drew the following picture. That's my understanding so far of how Windows Installer / WiX work. Is there anything wrong? Do you have any suggestion to complete this graph?
http://nestorsulikowski.com/index.php/2009/08/windows-installer-wix/
I'm happy to receive feedback and modify the diagram so that it's useful to more people.
Firstly, forget about WiX for now. Your concern is Windows Installer - WiX is simply a tool to define Windows Installer databases (MSI files). WiX is no different than many other products out there, except for the fact that it doesn't try to mask any Windows Installer concepts for you. InstallShield transparently does a bunch of things that Windows Installer doesn't support via custom actions and the like, WiX forces you to think more about the Windows Installer methodology and way of doing stuff. Windows Installer is what you want to understand, WiX comes afterwards.
Second, get a copy of The Definitive Guide to Windows Installer. This book is an invaluable resource for anyone looking to understand how Windows Installer (MSI) works.
Third, start with the first entry in the UAC in MSI blog posts, and you should be able to get a better grip on things. It is the best documentation I ever read in trying to understand elevation, permissions and all the other stuff that goes with UAC.
The image kind of makes sense, but I think think the UAC series describes the sequences a bit better. Very few people use administrative installs, and if your installer is written properly then there shouldn't be any reason to concern yourself with advertised installations either. They'll just work. Build your installation to work with only the InstallExecuteSequence to begin with, and then add the UI later and you'll have a bulletproof installation that works without much effort.

Switching from InstallShield to WiX

I am looking for a replacement for InstallShield. Unfortunately we only have 1 license for InstallShield and it was installed on a developer's machine. I'm considering switching over to WiX, but after reading the documentation there is a Product ID GUID, Upgrade Code GUID and a Package GUID.
I also know GUID's were created by InstallShield. If I switch over to WiX can I start using new GUID's or do I have use some of the GUID's created by InstallShield? If an upgrade to a product is released will switching installers hose customers who had the old installer?
In order to be able to upgrade your old package, you need to use (and find out) your old upgrade code.
The Package code should be different (ie autogenerated) for every different MSI (the MSI can be cached with the guid as cache key).
The Product code should be different between major upgrade, but is important for minor upgrades and patches. I haven't used wix to do anything else than major upgrades right now, so I don't know the exact details
See the MSDN article on patching and upgrades as well as the WiX Tutorial
It may also be interesting to know that you can decompile the msi that was generated by Installshield with the dark.exe tool (included in wix). This will recover the upgrade code among other things.
I'd also suggest getting a copy of The Definitive Guide to Windows Installer, I highly recommend the book and don't know how I would have migrated to WiX without it. It's a very low level overview of Windows Installer, if you understand the book then WiX becomes pretty easy.
I know you've already accepted an answer, but make friends with Orca if you haven't already done so.
Orca helped me understand MSI and what WiX was doing under the covers. In your case it would make finding the Upgrade (or any) GUID very easy.
This question may also save you some time and headaches :)