Have you tried http://nsis.sourceforge.net/CallAnsiPlugin_plug-in ?
NSIS Simple Firewall Plugin
44 posts
No! I'm wandering how I couldn't find this plug-in 🙁. I will try it in suitable time, because now my installer is stable.
Thank you for the idea!!!
Thank you for the idea!!!
Version 1.20 released
Hi,
I've released a new version of the firewall plugin. This version is a minor release with one addion in the "AdvAddRule" function.
The can find the complete changelog, documentation and download file here:
Best regards
Rainer
Hi,
I've released a new version of the firewall plugin. This version is a minor release with one addion in the "AdvAddRule" function.
The can find the complete changelog, documentation and download file here:
Best regards
Rainer
Still there is no Unicode support 😉... I hope in next version...
Hi,
I have a problem using the plug-in for adding a program in the firewall:
It doesn't work correct, because it only adds a rule for the private network not for the public network.
This is what i wrote:
SimpleFC::AddApplication "Program-Name" "$INSTDIR\program-name.exe" 0 2 "" 1
Am I doing something wrong?
I have a problem using the plug-in for adding a program in the firewall:
It doesn't work correct, because it only adds a rule for the private network not for the public network.
This is what i wrote:
SimpleFC::AddApplication "Program-Name" "$INSTDIR\program-name.exe" 0 2 "" 1
Am I doing something wrong?
Dear Andreas,
this belongs to the "old" MS firewall support e.g. for XP. You you are using >= Vista please use "AdvAddRule". Take a look at the "Important Notes"!
Kind regards
Rainer
this belongs to the "old" MS firewall support e.g. for XP. You you are using >= Vista please use "AdvAddRule". Take a look at the "Important Notes"!
Kind regards
Rainer
OK,Originally Posted by Speed78 View Postthis belongs to the "old" MS firewall support e.g. for XP. You you are using >= Vista please use "AdvAddRule". Take a look at the "Important Notes"!
it is was bid more complicated, but it worked!
Thank you!!
Hi!
I need some support again. I use the function AdvAddRule and I'm trying to set a rule for all protocols. According to the documentation:
I need some support again. I use the function AdvAddRule and I'm trying to set a rule for all protocols. According to the documentation:
1 - ICMPv4I have to use value 256 for any protocol. When I call the function it returns 0 (success), but looking in the Firewall settings, I see that the protocol is actually set to 2 (IGMP). I cannot guess what I'm doing wrong. When I try with specific protocol all is OK. Can you help, please?
6 - TCP
17 - UDP
58 - ICMPv6
256 - Any protocol
Short update... I found the problem, but I don't understand it. I'm compiling my installer with Unicode option. We already know that this plug-in doesn't support Unicode, therefore I used the macro that converts Unicode string to ANSI as it was posted above. But I don't do this conversion for values. I thought that it is not necessary, therefore I pass this specific parameter to the function directly... and it didn't work. Now I covert it with the macro and then pass it to the function... and it works well...
I see also another problem. I can not define a group. If I use an empty string, it works. But if I try to define something else (even if I convert it with the macro from Unicode to ANSI), I always get an error from the function. Any ideas?
I see also another problem. I can not define a group. If I use an empty string, it works. But if I try to define something else (even if I convert it with the macro from Unicode to ANSI), I always get an error from the function. Any ideas?
All variables in NSIS are strings. Therefore all values are passed to plug-ins as strings. The plug-in then converts those values to integer if it needs to.
Stu
Stu
Ok, but I always have problems with the parameter for the group. I switched the compiler to ANSI (just for test) and I still get error in any case except when I pass an empty string.
Hello,
I have a problem with this plugin. Under Win 7, I am able to add firewall rules for an application using AdvAddRule. However, it seems it crashes in the uninstall when using AdvRemoveRule to remove that rule.
The uninstaller will turn gray (such as when an application freezes) and a dialog will pop up stating that Au_.exe has crashed. Or something similar.
Here are the relevant code bits
At install:
I have a problem with this plugin. Under Win 7, I am able to add firewall rules for an application using AdvAddRule. However, it seems it crashes in the uninstall when using AdvRemoveRule to remove that rule.
The uninstaller will turn gray (such as when an application freezes) and a dialog will pop up stating that Au_.exe has crashed. Or something similar.
Here are the relevant code bits
At install:
!define PROGRAM "My Program"
!define InboundRuleName "${PROGRAM} In"
...
Section -Post
...
; Add firewall rules depending on Windows version
SimpleFC::AdvAddRule "${InboundRuleName}" "" "256" "1" "1" "2147483647" "1" "$INSTDIR\Program.exe" "" "" "" "" "" "" ""
Pop $0
DetailPrint "Added firewall rule $\"${InboundRuleName}$\"."
SectionEnd
...
Section Uninstall
...
; Remove firewall rules depending on Windows version
SimpleFC::AdvRemoveRule "${InboundRuleName}"
Pop $0
DetailPrint "Removed firewall rule $\"${InboundRuleName}$\""
SectionEnd
Ok I think I found the issue.
I had a function un.DeleteDirIfEmpty that was called just beforehand which seemed to interfere with the plugin.
I had a function un.DeleteDirIfEmpty that was called just beforehand which seemed to interfere with the plugin.
Function un.DeleteDirIfEmptyMaybe because something was already in one of the registers, it caused the plugin function to fail?
FindFirst $R0 $R1 "$0\*.*"
strcmp $R1 "." 0 NoDelete
FindNext $R0 $R1
strcmp $R1 ".." 0 NoDelete
ClearErrors
FindNext $R0 $R1
IfErrors 0 NoDelete
FindClose $R0
Sleep 1000
RMDir "$0"
NoDelete:
FindClose $R0
FunctionEnd
SimpleFC Unicode Version released!
Dear all,
I know this thread is really pretty old but I'm happy to can say that I'm released the unicode version of the SimpleFC-Plugin so that NSIS 3.x is fully supported now. This plugin version has the same functions like the ANSI version. The ANSI version is still supported. You can find both versions here: https://nsis.sourceforge.io/NSIS_Simple_Firewall_Plugin
Best regards
Rainer
Dear all,
I know this thread is really pretty old but I'm happy to can say that I'm released the unicode version of the SimpleFC-Plugin so that NSIS 3.x is fully supported now. This plugin version has the same functions like the ANSI version. The ANSI version is still supported. You can find both versions here: https://nsis.sourceforge.io/NSIS_Simple_Firewall_Plugin
Best regards
Rainer