3

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

3 Answers 3

7

I finally found how to get the target directory path from installer class

string installationPath = this.Context.Parameters["assemblypath"];
Sign up to request clarification or add additional context in comments.

3 Comments

How do we get the current MSi path?
@Ranish What do you mean by current MSI path ?
Would be interesting if this can be set from the installer-class.
0

Installation path that user choose in wizard

string installationPath = this.Context.Parameters["targetdir"]

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.