Jump to content
infinitenothing

Windows Firewall has blocked some features of this app

Recommended Posts

I keep coming to computers and I guess the user didn't approve the exception or something because they're getting an error 56 when the app opens a TCP connection. I'm looking for ways to avoid this. Some ideas:

  • Autoapprove the exception as part of installation
  • Is there a way to keep prompting them until they approve the exception or close the app
  • Maybe a command line I can send them if they say they are seeing error 56?

firewall blocked.png

Share this post


Link to post
Share on other sites
56 minutes ago, infinitenothing said:

I keep coming to computers and I guess the user didn't approve the exception...

How dare them making a choice when they are asked to? :D

43 minutes ago, infinitenothing said:
  • Autoapprove the exception as part of installation

You cannot approve the dialog automatically as it is shown only after starting the application (or restarting the computer) during which you don't have elevated access. However you could add firewall rules as part of the installation procedure (see below).

43 minutes ago, infinitenothing said:
  • Is there a way to keep prompting them until they approve the exception or close the app

None that I know of. It is also very annoying to get prompted over and over again after making a choice. Why even bother asking if there is no choice in the first place? Software that does that is malware in my opinion. Also I can see users taking three courses of action:

  • Allow access (stupid, since it could be malware, also teaches your users bad habits)
  • Decline and inform IT (IT will knock on your door, so go for it if you need to talk to them urgently :P)
  • Uninstall (yeah, might not be IT who is knocking next)
43 minutes ago, infinitenothing said:
  • Maybe a command line I can send them if they say they are seeing error 56?

You can actually run command line instructions during installation in order to add firewall rules. Have a look at the instructions over at TechNet: https://technet.microsoft.com/en-us/library/dd734783(v=ws.10).aspx

Once you figured out the necessary firewall rules (e.g.: by checking a computer that accepted the rule), you can build the commands and execute them during installation. It should be possible to run the instructions using the post-install action (run application after installation), though I'm not sure if it will actually be run in elevated mode.

Another option is to use a custom installer (we made our own using Inno Setup) and pack the LabVIEW installer inside the custom installer.

  • Like 1

Share this post


Link to post
Share on other sites
11 hours ago, LogMAN said:

Once you figured out the necessary firewall rules (e.g.: by checking a computer that accepted the rule), you can build the commands and execute them during installation. It should be possible to run the instructions using the post-install action (run application after installation), though I'm not sure if it will actually be run in elevated mode.

The post install action is run in the context of the installer so it should have the same elevated rights. That SHOULD be enough, but I'm sure there is a possible scenario with custom policies and such from a heavily guarded IT departement that could allow users to install applications but not change firewall rules. Most likely not intentionally but still!

Edited by rolfk

Share this post


Link to post
Share on other sites

For follow up, I was able to create a batch file: 

netsh advfirewall firewall add rule name=%1 dir=in program=%2 action=allow

and in my installer I have these command line arguments

"Allow MyApp" "[INSTALLDIR]MyApp.exe"

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.