2
votes

I have an exercise for you ! :)

I need to get an [INSTALLDIR] MSI property in my Installer class implemented in C#. Using InstallShield 2010, I created a component with a .NET assembly defined as key file of the component. Specified that the component is a .NET Installer Class, implemented required interface and made sure it was called during execution flow. Now I need to get installation directory MSI property. Do you guys have any ideas?

I know there is a predefined custom action to pass properties to deferred custom actions but I don't actually have an custom action for running Installer class, this is an installation component. There are some samples for Visual Studio installers, but install shield seems to be little different.

Thanks much!

1

1 Answers

2
votes

In InstallShield | Component Properties, right below where you said .NET Installer Class = Yes you put in your .NET Installer Class Arguments. You basically do something like

/INSTALLDIR="[INSTALLDIR]\" /FOO=42

Inside your context you can then access INSTALLDIR and FOO.

But I'd like to be really honest with you: You don't want to do this. Take it from me, WiX C# DTF is a much better pattern that eliminates many issues with InstallUtil that you will eventually encounter and regret.

I have DTF examples on my blog. Just search for DTF.