0
votes

I am trying to install Payara through inno setup and when I run the setup.bat file, Windows firewall is blocking Java and it requires the user to click on Allow access button each time to continue with the installation.

I have added the below code in the iss file before executing the batch file to create a rule to allow Java through firewall, but I am still getting the prompt.

Filename: "netsh.exe"; Parameters: "advfirewall firewall add rule name=""Java 8"" dir=in action=allow program=""C:\Servers\java\bin\javaw.exe"" enable=yes"; Flags: RunHidden; StatusMsg: "Configuring Firewall for Java 8...";

I call the batch file using the below code.

Filename: "C:\Servers\install\setup.bat"; StatusMsg: "Starting Payara...";

What am I missing here?

P.S. - I am using Windows 10.

1
And does that command allow Java, if you run it manually on Windows command-line?Martin Prikryl
support.microsoft.com/en-ca/help/947709/… Your installer can call relevant commands to manipulate Windows Firewall, but keep in mind your end users might use an alternative firewall.Lex Li
@MartinPrikryl, even when I run manually, java is not allowed automatically. The user I am running have Admin rights too.DeeJay007
@LexLi, I used the mentioned link to create a firewall rule in the first place. The rule is created perfectly, but I am still getting this allow java prompt. I need to have a silent installation and this prompt is not helping.DeeJay007
I just changed the allow program from javaw.exe to java.exe and now the access is allowed automatically.DeeJay007

1 Answers

1
votes

The firewall rule needs to be changed to allow java.exe instead of javaw.exe and it will be allowed automatically without a prompt. The updated rule is mentioned below.

Filename: "netsh.exe"; Parameters: "advfirewall firewall add rule name=""Java 8"" dir=in action=allow program=""C:\Servers\java\bin\java.exe"" enable=yes";