Question

I would like to know the path where the msi is located whithin the InstallerClass that I use as a custom action in the setup.

I tried using properties like path, SrcDir etc. in Context.Parameters, but those values do not exsist (Throws NullReferenceException). Is there any other way way of getting that path or any reason why those values are null???

Thanks

Was it helpful?

Solution

You will need to pass the relevant property in action data via the Property window in VS:

/sourceDir="[SourceDir]\"

Then, use the context to retrieve it:

string path = Context.Parameters["SourceDir"];

OTHER TIPS

Installer Class have many limitations and behave very poorly when they fail ( fragile ). I suggest you look at C# managed custom actions using Deployment Tools Foundation (DTF) in Windows Installer XML ( WiX ). The output of this project type is C++ equiv and can be consumed by a Visual Studio Setup and Deployment Project ( which I also wouldn't reccomend using. )

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top