liuyt1
Posts: 25
Joined: Sun Aug 02, 2015 10:18 pm

how to pop up error dialog if 80 port not available

hi,

I know how to check if 80 port available from custom actions.
But how to pop up dialog with "80 port not available" and stop install?
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: how to pop up error dialog if 80 port not available

Hello,

Please note that when using the Check TCP port custom action, the custom action returns the check's result in the Windows Installer property AI_PORT_TEST_RES. The property can have the following values:
  • FreePort - the port is free
  • UsedPort - the port is used
  • SockError - an error occurred
So, you can add a Display message box predefined custom action and condition its execution through the AI_PORT_TEST_RES property. (e.g. AI_PORT_TEST_RES = "UsedPort").

Should there be any difficulty you encounter implementing something, please do not hesitate to contact me and I will gladly assist.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
liuyt1
Posts: 25
Joined: Sun Aug 02, 2015 10:18 pm

Re: how to pop up error dialog if 80 port not available

Dan,

I tried add customer action.
I do two thing:
1) check 80 port when user click next in welcome dialog
2) pop up error message box is 80 port is not available

But no message box pop up.

Attachment is my install file.
Can you help to take a look?

Thanks,
YT
Attachments
myapp.aip
(17.78 KiB) Downloaded 405 times
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: how to pop up error dialog if 80 port not available

Hello,

I've tested your scenario and it worked as expected. The sample project is attached to this thread, so if you are interested to take a look directly at my project, you are more than welcome to download the ZIP file.

By the way, it is highly expected that the 80 port be used. If you need a free port, then you can use the predefined Get a free TCP port to get a free TCP port. Also, the installer stops to late. Since you are checking if the related port is free during the wizard dialogs, you should also give the related error then.

For example, you can ask the user if he agree to assign a different port if the port you are checking is used. Depending the user's answer, you can quite the installation or continue further.

Please give us more details about your installation scenario so I can guide you better and precisely.

Best regards,
Dan
Attachments
myappSample.zip
(3.57 KiB) Downloaded 272 times
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
liuyt1
Posts: 25
Joined: Sun Aug 02, 2015 10:18 pm

Re: how to pop up error dialog if 80 port not available

Dan,

Thanks a lot.
The file works as expected.

YT
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: how to pop up error dialog if 80 port not available

You're always welcome,

If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”