.NET Installer Class and Dialog Variables - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

astukov
Posts: 2
Joined: Fri Dec 17, 2010 2:19 pm

.NET Installer Class and Dialog Variables

Hi,
I'm having trouble with some Custom Actions using a .NET Installer Class. What I'm trying to do is pretty simple.

I have created a dialog that asks user to input a TCP port that will be later used to configure an app.config. Once user inputs port number and hits "Next" button, it is checked if port is available on the machine. If available, port number is copied from AI_BIND_TCP_PORT variable to an Installer Parameter called "ServerPort". This Installer Parameter has a default value of 3660.

The problem comes just here. Once user navigates through all dialogs and it comes the time to install, "ServerPort" parameter is passed to the .NET assembly, but I found that it is always passed with its default value 3660 , ignoring what user has indicated in the dialog. Installer log says that "ServerPort" variable has received the correct value (user input), but custom action call shows the parameter being passed with default value.

Is there any kind of issue doing this with a managed assembly or it is just that I'm doing something wrong. BTW, "hardcoded" parameters are being passed correctly.

TIA.

Regards,

A. Stukov.
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: .NET Installer Class and Dialog Variables

Hi,

This happens because private properties("ServerPort") cannot pass their values from InstallUISequence to InstallExecuteSequence.

The solution is to rename the property "ServerPort"so it becomes a public one, for example "SERVER_PORT".

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
astukov
Posts: 2
Joined: Fri Dec 17, 2010 2:19 pm

Re: .NET Installer Class and Dialog Variables

That did the trick, thanks.

Return to “Common Problems”