Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 9 of 9
  1. #1
    Join Date
    Apr 2006
    Posts
    75

    Testing open ports during install / Add application to firewall exception list

    Hi.

    I want to do two things during install of our application...

    1. I want to test that certain ports are open and working, and if not I want to show a popup advising people of this and suggesting they refer to their router maker to figure out how to do this...

    2. I want to ask the user to add our application to their firewall exception list....

    Also, part of point 2, is can I trigger their software firewall so that they deal with problems before they get to run the application...


    Thanks for all the help...

  2. #2
    Join Date
    Mar 2006
    Posts
    24
    You could get the inmstall application to execute a batch file in the background. The batch file would run a telnet command to the desired destination server, and output to a txt file. You can then interogate the txt file and make decisions based on that.

    The batch file would look something like this....

    REM ## TEMP BATCH FILE TO TEST TCP PORT ##
    TELNET serverIP portnumber >%tmp%\porttest.txt

    After the batch file has quite, you will end up with porttest.txt within the users temp area. Interogate the txt file, and if the port is not open, you can search for the string... "Could not open a connection to host on port" which would imply a connection failure, and the port is closed.

    As regards triggering thier firewall software, you will never know which software is being used if any. And obvisouly the firewall might actually be a hardware firewall, so I would suggest simply warning the user that they need to open the port.

    Hope this helps.....

  3. #3
    Join Date
    Apr 2006
    Posts
    75
    Thanks for your comments...

    Actually, the ports I need to test are UDP..... does that make a difference ?

    Thanks

  4. #4
    Join Date
    Mar 2006
    Posts
    24
    Ahh !!.........lol

    Yes that does make a difference. You cannot telnet to a UDP port, and I am unaware of any means of testing a UDP port, other than using portscanner software.

    Do a google search for testing / probing / interogating UDP ports.

  5. #5
    Join Date
    Apr 2006
    Posts
    75
    I think we'll have to do the port test via our application....

    But does anyone know how to add the application to the firewall exemption list ?

  6. #6
    Join Date
    Mar 2004
    Location
    Toronto, ON CANADA
    Posts
    696
    Here is a way to do it by adding the entry to the registry. Replace 'C:\\Path\\To\\my.exe' with the path to the executable you want added to the firewall exceptions list. Replace 'Name_Of_Product' with the name of the application you want to add (for display purposes when you view the Windows Firewall Exceptions list.)

    Code:
    Registry.SetValue(HKEY_LOCAL_MACHINE, "SYSTEM\\ControlSet001\\Services\\SharedAccess\\Parameters\\FirewallPolicy\\StandardProfile\\AuthorizedApplications\\List", "C:\\Path\\To\\my.exe", "C:\\Path\\To\\my.exe:*:Enabled:Name_Of_Product", REG_SZ);

  7. #7
    Join Date
    Jun 2005
    Posts
    470
    As I know, only Windows firewall available in Win XP and later provides a way to automatically add a program to the 'allowed' list, and only if this is allowed in the firewall configuration.
    I guess Tek's reply is about Windows firewall, but you should know that very few people use it. Most people use others like Symantec, ZoneAlarm, Sygate etc. etc., or hardware firewalls - for all these, you can't automatically add a program to exceptions list.

    I think the only way is to set something on your server that listens on these ports and sends a reply. From the setup send some data to the server and if you do not receive the expected reply within a given period, show a message that app has to be allowed in the firewall.

  8. #8
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    One might want to have links available for each major product's firewall settings, along with the initial, "Make sure to allow this program access" sort of alert.

    Intrigued

  9. #9
    Join Date
    Apr 2006
    Posts
    75
    Thanks for all the help...

    It seems the only sensible solution is to test the ports once the application is running, and then notify the user if those ports are not open... doing this, we can also tell the user they will need to allow the application to work through their firewall...

Similar Threads

  1. HOWTO: Distribute an AutoPlay Application with Setup Factory 6.0
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-25-2002, 02:33 PM
  2. HOWTO: Set up an MP3 Playlist
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-24-2002, 11:57 AM
  3. HOWTO: Make an AutoPlay Application Expire
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-09-2002, 10:10 AM
  4. HOWTO: Add Password Protection to Your Application
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-03-2002, 03:39 PM
  5. INFO: How to Set the Default Application Directory
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 09-25-2002, 12:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts