Навигация
Главная
Поиск
Новости
Статьи
ЧаВо
- - - - - - -
Файловый архив
Ссылки
Авторизация
Кто он-лайн

 

 
Главная arrow Статьи arrow Разное arrow Inno Setup: Adding a rule to the Windows firewall
Inno Setup: Adding a rule to the Windows firewall Версия для печати
Написал Ярослав Гасов   
01.12.2009

Share this!

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 the Windows Firewall"; GroupDescription: "Other tasks:"; MinVersion: 0,5.01.2600sp2;     ...    ...    ...    [Run]    Filename: "{sys}\netsh.exe"; .........; Tasks: Firewall; 

 

Finally don't forget to remove your program's firewall entry when you uninstall it with something like

   [UninstallRun]    Filename: {sys}\netsh.exe; Parameters: "firewall delete allowedprogram program=""{app}\app.exe"""; Flags: runhidden;     MinVersion: 0,5.01.2600sp2; Tasks: Firewall; 
 
< Пред.   След. >
 
 

Производственный кооператив "Геолог" - геологоразведовательные работы, разведка месторождений, подсчет запасов, бурение скважин, геологический отчет...


GASOV.COM © 2019