4

If I want to abort an installation in a C# custom action, it will have to display an unwanted "1001 Error" message box.

To avoid this I once used a C++ project which can abort the installation without the message box.

I'm trying to create this C++ project again but the only tutorial I found on the internet

http://www.codeproject.com/Articles/1747/MSI-Custom-Action-DLL

isn't updated since 2002. How can I do the same on VS 2010?

1
  • 1
    This is a valid question. Setting up a custom action project requires understanding what includes and libraries, compiler settings and function declaration. This isn't trivial for a first time developer. Luckily WiX has templated all of this. Commented Jun 21, 2013 at 15:46

1 Answer 1

2

That example is outdated. The easiest way today is to download and install Windows Installer XML (http://wix.codeplex.com). Then say File | New Project | Windows Installer | C++ Custom Action

Also of note is the C# custom action project. Your 1001 error message tells me that you are using InstallUtil / Installer Class custom actions. The C# project type in WiX is called Deployment Tools Foundation (DTF) and is far superior. Checkout the following for an explanation of how it works and appears to MSI as a C++ custom action.

Deployment Tools Foundation (DTF) Managed Custom Actions

Sign up to request clarification or add additional context in comments.

2 Comments

The C++ template in WiX doesn't compile. Can't find dutil.lib.
Ask Rob Mensching. He answers a lot of WiX questions around here so maybe he knows about this. I think the DTF route is what you are really looking for though. It can return ActionResult.UserCancel (or something like that) and roll the install back and display the normal Installation Cancelled dialog.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.