4

I'm creating a program which is being installed by Wix, using VS 2010 and I've already got the product.wxs ready.

Now I want to add a custom C# action to the installation. I've searched how to do it and found this guide: How do I create fully fledged C# custom actions?

The problem is that I don't understand all the instructions, specifically in this section of the guide: Integrate the C# custom action in Advanced Installer

I've created the Custom Action project but I don't understand how do I tell the setup project to run that custom action and how do I set the action to run at install in the commit phase.

Another related thing. How in the C# code can I get the installation path that the user chose to install to?

1 Answer 1

8

That tutorial is for how to use WiX managed custom actions with "Advance Installer", a commercial tool for creating installers.

Here is a good explanation on how to create WiX Custom Actions in C#, to use with the WiX toolset.

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

6 Comments

Do you know how can I get the installation path in the code? Probably from the Session parameter?
You can use the session parameter to get the value of any property, (for example: string propValue = session["MYPROPERTY"];). The property that contains the installation folder may depend on your code.
How can it depend on my code? There's supposed to be only a single property with the installation path
It is defined by you setup Directory structure, or in case you are using the WixUI_InstallDir dialog set then a look at the sample in this link
But I'm talking about the custom action C# code. Not the wxs file code
|

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.