Adding a rule to the Windows firewall

From ISXKB

(Difference between revisions)
Jump to: navigation, search
(Category)
(wording and fixes)
Line 1: Line 1:
-
If you want to add you application to the "allowed" list in the Windows firewall (Windows XP SP2, Vista, ...) and, you can make use of the Net.exe application built into Windows:
+
If you want to add your application to the white list of the Windows firewall (Windows XP SP2, Vista, etc.), you can use the Net.exe application which is shipped with Windows:
-
This is all one line in Inno Setup:
+
This goes all into one line in Inno Setup:
     Filename: "{sys}\netsh.exe"; Parameters: "firewall add allowedprogram ""{app}\app.exe"" ""My App desc"" ENABLE ALL";
     Filename: "{sys}\netsh.exe"; Parameters: "firewall add allowedprogram ""{app}\app.exe"" ""My App desc"" ENABLE ALL";
     StatusMsg: "My status msg..."; Flags: runhidden; MinVersion: 0,5.01.2600sp2;
     StatusMsg: "My status msg..."; Flags: runhidden; MinVersion: 0,5.01.2600sp2;
-
MinVersion will take care of running it only for Windows >= WinXP SP2.
+
MinVersion will make sure that it only runs on Windows XP with SP2 or higher.
-
Ideally you should use a user selectable task for this:
+
Ideally you should let the user decide whether he/she wants to add your application to the white list of the firewall with a [Tasks} entry:
     [Tasks]
     [Tasks]

Revision as of 21:11, 6 February 2007

If you want to add your application to the white list of the Windows firewall (Windows XP SP2, Vista, etc.), you can use the Net.exe application which is shipped with Windows:

This goes all into one line in Inno Setup:

    Filename: "{sys}\netsh.exe"; Parameters: "firewall add allowedprogram ""{app}\app.exe"" ""My App desc"" ENABLE ALL";
    StatusMsg: "My status msg..."; Flags: runhidden; MinVersion: 0,5.01.2600sp2;

MinVersion will make sure that it only runs on Windows XP with SP2 or higher.

Ideally you should let the user decide whether he/she wants to add your application to the white list of the firewall with a [Tasks} entry:

   [Tasks]
   ; Firewall starting from Windows XP SP2 (5.01.2600sp2)
   Name: Firewall; Description: "Add an exception to Windows firewall"; MinVersion: 0,5.01.2600sp2; 
   ...
   ...
   ...
   [Run]
   Filename: "{sys}\netsh.exe"; .........; Tasks: Firewall;
Personal tools
Ads: