This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Can anyone please guide us how to check the port & popup message if port is in use
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 20, 2014
05:11 AM
How check port status in installshield
I want check port status of system by use installscript. But I don't know how to do it.
Please, help me!
Thank you so much.
Please, help me!
Thank you so much.
(3) Replies
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)
Not applicable
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 03, 2016
07:20 PM
Can anyone please guide us how to check the port & popup message if port is in use
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 04, 2016
08:00 PM
What kind of ports? If you mean IIS ports you can use APPCMD in a Custom Action.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 07, 2016
04:41 AM
prototype BOOL isPortAvailable(STRING);
function BOOL isPortAvailable(szPortNumber)
STRING svCommand, svParams;
STRING svLine;
BOOL isAvailable;
NUMBER nvFileHandle;
begin
isAvailable = TRUE;
svCommand = SystemFolder ^ "netstat.exe";
svParams = " -an | find \"" + szPortNumber + "\" > \"" + FOLDER_TEMP ^ "stdout.txt\"";
LaunchAppAndWait( svCommand, svParams, LAAW_OPTION_HIDDEN | WAIT);
OpenFileMode (FILE_MODE_NORMAL);
if(OpenFile (nvFileHandle, FOLDER_TEMP, "stdout.txt") < 0) then
MessageBox ("OpenFile failed to open " + FOLDER_TEMP ^ "stdout.txt", SEVERE);
abort;
endif;
while GetLine (nvFileHandle, svLine) = 0
if(svLine != "") then
isAvailable = FALSE;
endif;
endwhile;
CloseFile (nvFileHandle);
return isAvailable;
end;
function BOOL isPortAvailable(szPortNumber)
STRING svCommand, svParams;
STRING svLine;
BOOL isAvailable;
NUMBER nvFileHandle;
begin
isAvailable = TRUE;
svCommand = SystemFolder ^ "netstat.exe";
svParams = " -an | find \"" + szPortNumber + "\" > \"" + FOLDER_TEMP ^ "stdout.txt\"";
LaunchAppAndWait( svCommand, svParams, LAAW_OPTION_HIDDEN | WAIT);
OpenFileMode (FILE_MODE_NORMAL);
if(OpenFile (nvFileHandle, FOLDER_TEMP, "stdout.txt") < 0) then
MessageBox ("OpenFile failed to open " + FOLDER_TEMP ^ "stdout.txt", SEVERE);
abort;
endif;
while GetLine (nvFileHandle, svLine) = 0
if(svLine != "") then
isAvailable = FALSE;
endif;
endwhile;
CloseFile (nvFileHandle);
return isAvailable;
end;
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)