views:

78

answers:

3

I'm trying to create a setup project and I can't believe how painful it could be. Non of the tools that I've tried to use, haven't satisfy me. How come? Well, let's see:

First and easiest option: Setup project built in Visual Studio. Easy and fast. you can easily implement custom actions, even if you're code was written in c# or vb.net. Exactly what I wanted. But this approach has some drawbacks and the major one is unbelievably painful way to implement custom dialogs. For example if I need to ask for DB credentials, authorize the user and proceed with the rest of installation. But no. There is no way to build custom setup dialog in VS. Actually there is a way, but it's not an easy one. I mean what, are you kidding me? I have to spent a day to create a couple of simple dialogs?

Second option: Use some kind of a tool. Like InstallShield. You have to pay for it, yes, fortunately it's damn cheap. Only $5500. Not a big deal, right? Well maybe, but for me it's like "dude, forget about it"

Third option: Use WIX Nice, has many options. Not so easy to use like the one built-in VS but has many much better features. The only problem - I spend a few hours trying to convince that thing to run my code written in c#. I failed. Nothing helped and I give up.

Now. Please, please my fellow experts, all knowing developers. Help me. What should I do? What's the best way to solve my problem (believe me my boss will kill me, he likes to achieve results over dead bodies of his employees).

Tell me is there any better way to edit .wid files. Using Orca tool, isn't an easy solution. Or show me a real example of setup project built with WIX which can run managed c# code.

Thank you!

A: 

I implemented a custom dialog by simply displaying a form in my custom action. This is a straightforward thing to do.

Stefan Egli
Yeah I did that too. but my boss didn't like that.
Ike
was any reason given?
Stefan Egli
What can I do? He is the boss. He wants to see that as a part of native installation dialog ;(
Ike
Well, I just added some beatifications on my form and cut all default dialogs of setup. I hope now my boss will love this thing...
Ike
Maybe he didn't like it because it's an anti-pattern?
Christopher Painter
A: 

You should check out NSIS. It is free, open source and has a long and stable history. And that's where i've turned every time another install system has failed me.

The script is a little terse but there are (free) 3rd-party UIs to help manage it if you need to.

Paul Sasik
Have you tried to run c# or any other .net language code with that? it's vital for me I need to be able to run some c# managed code before installation
Ike
Oh.. Actually I see that it cannot run your managed code from dll. But it can run the code if you put it into exe. But now there is another question how do you send a parameter to your method and get a result back to nsis script?
Ike
There are a variety of ways. The simplest from my experience is actually file-based comm. You write out a text file (known name and location) the DLL/EXE reads and parses it and either produces another text file or rewrites that one. Up to you.
Paul Sasik
Downvote? How come? If there's a hole in my answer and/or comment i'd like to know what it is.
Paul Sasik
I downed it for several reasons. First is that every tag Paul gave is a tool that is related to Windows Installer. He clearly wants to know how to run a managed custom action in the context of a windows installer session. Your answer is like telling someone who is asking how to do something in .NET that he should use VB6 instead.
Christopher Painter
My second reason is that your solution is a complete hack. Let's see how many process boundries we can cross and take dependencies on file I/O to get around the fact that we picked a solution that is out of process and can't communicate with the host process. That's duct tape programming for installs. WiX has DTF which encapsulates managed code custom actions in a way that makes it a piece of cake to read/write properties, log message, query MSI tables and even attach a debugger to the CA.
Christopher Painter
My third reason is NSIS is a crappy installer technology only used by people with a passing interesting in writing proper installs. I could write tomes on why Windows Installer, despite it's horrible learning curve for developers, is ultimately the better choice for end users and systems administrators. I've been writing Installers for 14 years now and I promise you I *NEVER* use NSIS.
Christopher Painter
@Chris: I appreciate the feedback. And we have a fundamental difference in outlook on NSIS and installers in general. I've been writing installers for 13 years and found NSIS to succeed where others fail, especially in getting necessary, hack-ish things to work. Or even non-hack-ish. For example, using Install Shield to put Sql 2005 Express on a machine failed me completely so guess what my backup solution was? NSIS. There are many who NEVER use NSIS, there are just as many who ALWAYS use NSIS. And there are more in the middle who use whatever works.
Paul Sasik
I am well aware that there are many people writing installs like it's still the 1990's. I'll leave it at that since anything else I have to say will come across as snarky.
Christopher Painter
+1  A: 

I don't suggest using either "Setup Projects" ( aka Visual Studio Deployment Projects ) or Managed Custom Actions ( in your context you are referring to InstalUtil custom actions ).

For managed custom actions I use Windows Installer XML - DTF ( Deployment Tools Framework ). This builds and packages your CA to look and feel to MSI like a C++ CA which means you can then consume it using InstallShield, WiX, Wise and so on.

I also don't suggest using CA's as fake dialogs. If you want a fancier UI write an external UI handler ( not a simple task ). I suspect your real problem though is that VDRPOJ doesn't expose this very well, that WiX is lot's of writing in XML. InstallShield gives you a drag drop IDE for working on custom dialogs. But then that would be one of the many reasons it isn't free.

Christopher Painter

related questions