1

I would like to install Geoserver silently on Windows machines. I tried running the windows installer from command line, passing to it /S argument:

.\geoserver-2.13.4.exe /S

It works, but I need to pass also some installer's parameters such as the port number. Also the path of the Java VM need to be passed, as the silent installer didn't detect it automatically.

How can I do that?

  • try .\geoserver-2.13.4.exe /S /Port=XXXX – Ahsan Mukhtar Jan 8 at 9:13
  • @AhsanMukhtar it didn't work unfortunately. – Faz B Jan 8 at 9:39
0

The variable name indeed seems to be "Port" https://github.com/geoserver/geoserver/blob/master/src/release/installer/win/GeoServerEXE.nsi but perhaps the script should have something more in the .onInit function for making it to read the command line options with the GetOptions. From https://nsis.sourceforge.io/Docs/Chapter4.html#silent:

If your installer/uninstaller requires some more information that can not be gathered when silent, you can allow the user to specify that information on the command line and process it in .onInit. You can use GetOptions.

 !include FileFunc.nsh !insertmacro GetParameters !insertmacro
 GetOptions
 Function .onInit   
   ${GetParameters} $R0
   ClearErrors   
   ${GetOptions} $R0 /USERNAME= $0 
 FunctionEnd

The above example will copy the value the user passes on after /USERNAME= into $0. This allows the user to specify the required information on the command line instead of using the interactive user interface. The user can use:

foo.exe /S /USERNAME=Bar /D=C:\Program Files\Foo

I fear you should edit the GeoServerEXE.nsi file and complile your own modified installer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.