views:

344

answers:

3

There was a challenging situation happened when i was working with install to provide product key validation. I had to use C++ unmanaged code to validate the key. Actually we had the main validation logic written in C# and I had to create a mixed project. Problem was not stopped only with these, it continued. Since I used VC++ code, it expected atleast the VC++ runtime redistributable to be installed in the client machine. I thought of dropping the plan to migrate our install to Wix because of these kind of problems.

But I came to know that there is a nice and very cool feature that DTF is available in Wix to integrate any kind of actions in C#. I used it and could integrate the key validation in couple of hours and till now it is working fine in all client machine I implemented before 6 month.

Do you have any interesting moment or nice experience with DTF?

A: 

First off, the C#/DTF custom actions are still custom actions (no magic here :-)), so you should follow all the various CA guidelines working with this kind as well. It simplifies most of MSI tasks by abstracting low-level API behind the high level well-designed classes. Also, keep in mind that you can use managed code CA only in case the target machine has .NET installed (or install it as a prerequisite). Finally, the dtf.chm documentation which is distributed along with WiX toolset has some simple, but self-explanatory examples.

Hope this helps.

Yan Sklyarenko
Yan, thanks for your response. I completely agree on your points. my concern is handling un-managed code for a custom action, DTF replaced it with managed code and provided a very flexible options as you mentioned like well-designed classes. Of-course, we need .NET installed in a machine, but nowadays most of the windows OSs have .NET run-time by default and it shouldn't be a problem instead of installing VCRuntime redistributable. I posted this question to share the people moment if they would face any challenging action during installation and if they would have solved used DTF to solve it.
sankar
+1  A: 

I have written several .NET CAs to support our WiX based installs:

  1. Managed Wrapper around HTTPAPI.DLL - supports creating IP/Port SSL bindings and HTTP Url ACLs for use in deploying WCF services. I plan to turn this one into a Wix Extension. It was very interesting learning how to properly handle rollbacks, etc.

  2. SSL Picker dialog that displays all the SSL certificates on the system and allows you to pick one.

  3. SQL Server browser dialog - lets you browse your network for SQL Servers and then browse SQL Servers for Databases. Optionally uses impersonation. This is for crafting a connection string.

  4. I am in the process of writing a set of CAs that will use the Microsoft.Web.Administration assembly to do native installs of web applications on IIS 7 (without requiring the IIS 6 Metabase Compatibilty feature be installed).

Bryan Batchelder
Re point 4: did you know that Wix3.5 is going to support IIS 7 properly without needing IIS 6 Metabase compatibility?
Samuel Jack
+1  A: 

Search my blog at http://blog.deploymentengineering.com for DTF and you'll find a lot of useful content. I love DTF but I still believe that the best solution is to avoid a CA whenever possible in the first place. C#, like VBScript before it, is so luring that it tends to suck imperative thinking developers into writing CAs when not needed. I believe this is the reason DTF wasn't released for so long.

At my day job my approval is required for anyone who believes they need a CA. I instruct the developers on basic MSI philosphy, how to use DTF, how to attach a debugger and I make it clear that they are on the hook if it ever has any issues. The result is very few but well written CAs in our product line.

Christopher Painter