diff options
author | Ramón M. Gómez <ramongomez@us.es> | 2020-03-11 11:47:57 +0100 |
---|---|---|
committer | Ramón M. Gómez <ramongomez@us.es> | 2020-03-11 11:47:57 +0100 |
commit | 5a6a9ce0f1aeef4ca992234cdba35e46b35c246a (patch) | |
tree | 539f1deb08997f1d90fa53462c8c6678a19c796a | |
parent | 911b6597c26bf79607f0194dc6cc9df2b6048171 (diff) |
#963: OGAgent Installer for Windows supports `/S /server IPAddress` parameters to assign the server IP address in silent mode and automatically starts the services just before finishing the installation.
-rw-r--r-- | admin/Sources/Clients/ogagent/windows/ogagent.nsi | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/admin/Sources/Clients/ogagent/windows/ogagent.nsi b/admin/Sources/Clients/ogagent/windows/ogagent.nsi index dd156cf2..f1f59b3c 100644 --- a/admin/Sources/Clients/ogagent/windows/ogagent.nsi +++ b/admin/Sources/Clients/ogagent/windows/ogagent.nsi @@ -95,7 +95,7 @@ Section -Main SEC0000 SectionEnd
Section -post SEC0001
- WriteIniStr $INSTDIR\${CONFIGFILE} "opengnsys" "remote" "https://$SERVERIP_VALUE:8000/opengnsys/rest"
+ WriteIniStr $INSTDIR\${CONFIGFILE} "opengnsys" "remote" "https://$SERVERIP_VALUE/opengnsys/rest"
SetShellVarContext current
WriteRegStr HKLM "${REGKEY}" Path $INSTDIR
SetOutPath $INSTDIR
@@ -130,6 +130,8 @@ Section -post SEC0001 nsExec::Exec /OEM "$INSTDIR\OGAgentService.exe --startup auto install" # Add service after installation
# Update recovery options
nsExec::Exec /OEM "$INSTDIR\OGAServiceHelper.exe"
+ Exec "net start ogagent"
+ Exec "$INSTDIR\OGAgentUser.exe"
SectionEnd
# Macro for selecting uninstaller sections
@@ -178,6 +180,7 @@ SectionEnd # Installer functions
Function .onInit
InitPluginsDir
+ Call GetParameters
StrCpy $StartMenuGroup "OpenGnsys Agent"
!insertmacro MUI_LANGDLL_DISPLAY
@@ -192,13 +195,8 @@ Function un.onInit !insertmacro SELECT_UNSECTION Main ${UNSEC0000}
FunctionEnd
-# Server IP dialog box
+# Parameters dialog box
Function ParamsPage
- # Get input parameter
- ${GetOptions} $CMDLINE "/server" $SERVERIP_VALUE
- ${If} $SERVERIP_VALUE == ""
- StrCpy $SERVERIP_VALUE "192.168.2.10"
- ${EndIf}
nsDialogs::Create 1018
Pop $0
${If} $0 == error
@@ -211,11 +209,19 @@ Function ParamsPage nsDialogs::Show
FunctionEnd
-# Get server IP
+# Get parameters from the dialog
Function ParamsPageLeave
${NSD_GetText} $SERVERIP $SERVERIP_VALUE
FunctionEnd
+# Assign input parameters or default values to variables
+Function GetParameters
+ ${GetOptions} $CMDLINE "/server" $SERVERIP_VALUE
+ ${If} $SERVERIP_VALUE == ""
+ StrCpy $SERVERIP_VALUE "192.168.2.10"
+ ${EndIf}
+FunctionEnd
+
# Installer Language Strings
LangString ServerLabel ${LANG_ENGLISH} "OpenGnsys Server IP Address"
LangString ServerLabel ${LANG_SPANISH} "Direccion IP del Servidor OpenGnsys"
|