Page 1 of 1

How to pass parameters to .NET Installer Class

Posted: Sat Jan 14, 2012 9:17 am
by rmarma
Hi

I have a .NET installer class that requires parameters.
The .NET installer class has code to retrieve the parameters using the InstallContext such as:

public override void Install(System.Collections.IDictionary stateSaver)
{
// Get the custom parameters from the install context.
parameter1 = this.Context.Parameters["MyParam1"];
// etc.
}

When I invoke the setup.exe, I am passing the parameters as follows:

setup.exe MyParam1="123"

but no parameters are being passed to the .NET Installer class. Is there anyhting that needs to be added to the MSI Code to pass the command line arguments?

In InstallShield, we were able to specify a property called ".Net Installer Class Arguments". I attached a screenshot of the InstallShield option.

Please advise.

Thanks!

Re: How to pass parameters to .NET Installer Class

Posted: Mon Jan 16, 2012 8:21 pm
by rmarma
If you do not support passing arguments to a .NET Installer class, please let me know asap so that I can look for an alternate solution. I would appreciate an answer, be it positive or negative.

Thanks.

Re: How to pass parameters to .NET Installer Class

Posted: Tue Jan 17, 2012 7:23 pm
by giaviv
Hi,

I am afraid we do not support that at the moment. You would have to use Run Program to call the installer class with custom parameters.