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

有帮助吗?

解决方案

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"];

其他提示

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. )

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top