#963: Add a new option and dialog to the OGAgent Installer for Windows to enter the IP address of the OpenGnsys Server.
Now you can enter the IP address by running `OGAgentSetup-x.x.x.exe /server IPAddress` or by editing the related dialog.oglive
parent
f2af8209b9
commit
b18cd9b486
|
@ -15,10 +15,10 @@ Name "OpenGnsys Agent"
|
||||||
!endif
|
!endif
|
||||||
!define COMPANY "OpenGnsys Project"
|
!define COMPANY "OpenGnsys Project"
|
||||||
!define URL https://opengnsys.es
|
!define URL https://opengnsys.es
|
||||||
|
!define CONFIGFILE "cfg\ogagent.cfg"
|
||||||
|
|
||||||
# MultiUser Symbol Definitions
|
# MultiUser Symbol Definitions
|
||||||
!define MULTIUSER_EXECUTIONLEVEL Admin
|
!define MULTIUSER_EXECUTIONLEVEL Admin
|
||||||
#!define MULTIUSER_INSTALLMODE_DEFAULT_CURRENTUSER
|
|
||||||
!define MULTIUSER_INSTALLMODE_COMMANDLINE
|
!define MULTIUSER_INSTALLMODE_COMMANDLINE
|
||||||
!define MULTIUSER_INSTALLMODE_INSTDIR OGAgent
|
!define MULTIUSER_INSTALLMODE_INSTDIR OGAgent
|
||||||
!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY "${REGKEY}"
|
!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY "${REGKEY}"
|
||||||
|
@ -37,15 +37,21 @@ Name "OpenGnsys Agent"
|
||||||
!include MultiUser.nsh
|
!include MultiUser.nsh
|
||||||
!include Sections.nsh
|
!include Sections.nsh
|
||||||
!include MUI2.nsh
|
!include MUI2.nsh
|
||||||
|
!include nsDialogs.nsh
|
||||||
|
!include LogicLib.nsh
|
||||||
|
!include Filefunc.nsh
|
||||||
|
|
||||||
# Reserved Files
|
# Reserved Files
|
||||||
!insertmacro MUI_RESERVEFILE_LANGDLL
|
!insertmacro MUI_RESERVEFILE_LANGDLL
|
||||||
|
|
||||||
# Variables
|
# Variables
|
||||||
Var StartMenuGroup
|
Var StartMenuGroup
|
||||||
|
Var SERVERIP
|
||||||
|
Var SERVERIP_VALUE
|
||||||
|
|
||||||
# Installer pages
|
# Installer pages
|
||||||
!insertmacro MUI_PAGE_WELCOME
|
!insertmacro MUI_PAGE_WELCOME
|
||||||
|
Page custom "ParamsPage" "ParamsPageLeave" "Parámetros"
|
||||||
!insertmacro MUI_PAGE_LICENSE src\license.txt
|
!insertmacro MUI_PAGE_LICENSE src\license.txt
|
||||||
!insertmacro MUI_PAGE_DIRECTORY
|
!insertmacro MUI_PAGE_DIRECTORY
|
||||||
!insertmacro MUI_PAGE_INSTFILES
|
!insertmacro MUI_PAGE_INSTFILES
|
||||||
|
@ -89,6 +95,7 @@ Section -Main SEC0000
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
Section -post SEC0001
|
Section -post SEC0001
|
||||||
|
WriteIniStr $INSTDIR\${CONFIGFILE} "opengnsys" "remote" "https://$SERVERIP_VALUE:8000/opengnsys/rest"
|
||||||
SetShellVarContext current
|
SetShellVarContext current
|
||||||
WriteRegStr HKLM "${REGKEY}" Path $INSTDIR
|
WriteRegStr HKLM "${REGKEY}" Path $INSTDIR
|
||||||
SetOutPath $INSTDIR
|
SetOutPath $INSTDIR
|
||||||
|
@ -185,7 +192,35 @@ Function un.onInit
|
||||||
!insertmacro SELECT_UNSECTION Main ${UNSEC0000}
|
!insertmacro SELECT_UNSECTION Main ${UNSEC0000}
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
|
# Server IP 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
|
||||||
|
Abort
|
||||||
|
${EndIf}
|
||||||
|
${NSD_CreateLabel} 0 0 100% 12u "$(ServerLabel):"
|
||||||
|
Pop $0
|
||||||
|
${NSD_CreateText} 10% 20u 80% 12u "$SERVERIP_VALUE"
|
||||||
|
Pop $SERVERIP
|
||||||
|
nsDialogs::Show
|
||||||
|
FunctionEnd
|
||||||
|
|
||||||
|
# Get server IP
|
||||||
|
Function ParamsPageLeave
|
||||||
|
${NSD_GetText} $SERVERIP $SERVERIP_VALUE
|
||||||
|
FunctionEnd
|
||||||
|
|
||||||
# Installer Language Strings
|
# Installer Language Strings
|
||||||
|
LangString ServerLabel ${LANG_ENGLISH} "OpenGnsys Server IP Address"
|
||||||
|
LangString ServerLabel ${LANG_SPANISH} "Direccion IP del Servidor OpenGnsys"
|
||||||
|
LangString ServerLabel ${LANG_FRENCH} "Dirección IP del Servidor OpenGnsys"
|
||||||
|
LangString ServerLabel ${LANG_GERMAN} "Dirección IP del Servidor OpenGnsys"
|
||||||
LangString ^UninstallLink ${LANG_ENGLISH} "Uninstall $(^Name)"
|
LangString ^UninstallLink ${LANG_ENGLISH} "Uninstall $(^Name)"
|
||||||
LangString ^UninstallLink ${LANG_SPANISH} "Desinstalar $(^Name)"
|
LangString ^UninstallLink ${LANG_SPANISH} "Desinstalar $(^Name)"
|
||||||
LangString ^UninstallLink ${LANG_FRENCH} "D<>sinstaller $(^Name)"
|
LangString ^UninstallLink ${LANG_FRENCH} "D<>sinstaller $(^Name)"
|
||||||
|
|
Loading…
Reference in New Issue