Reputation: 8902
I have added an Installer class and within the class i'm overriding Install method. Within this method i want to get the path where MSI is being installed? (Directory user have chosen to install the application) ?
I tried the following and it gives me empty string,
string s = Context.Parameters["SrcDir"];
Upvotes: 3
Views: 3642
Reputation: 143
I have iterated over all the available parameters to my installer class and found it only has:
Param: logfile, Value:
Param: lo, Value: 1 // custom parameter set in custom install action
Param: action, Value: install
Param: installtype, Value: notransaction
Param: assemblypath, Value: D:\InstallerTrialHelper.dll
From it, I see we can use assemblypath directory to know which install directory is selected by user.
Upvotes: 0
Reputation: 128
Installation path that user choose in wizard
string installationPath = this.Context.Parameters["targetdir"]
Upvotes: 0
Reputation: 8902
I finally found how to get the target directory path from installer class
string installationPath = this.Context.Parameters["assemblypath"];
Upvotes: 7