Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the msi path within installerclass in C#

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

like image 567
Dulini Atapattu Avatar asked Dec 02 '25 16:12

Dulini Atapattu


1 Answers

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"];
like image 195
Grant Thomas Avatar answered Dec 06 '25 19:12

Grant Thomas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!