diff --git a/linux/debian/control b/linux/debian/control index b5b75a0..34d25de 100644 --- a/linux/debian/control +++ b/linux/debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: Ramón M. Gómez Build-Depends: debhelper (>= 7), po-debconf Standards-Version: 3.9.2 -Homepage: http://www.opengnsys.es +Homepage: https://opengnsys.es Package: ogagent Section: admin diff --git a/src/VERSION b/src/VERSION new file mode 100644 index 0000000..9084fa2 --- /dev/null +++ b/src/VERSION @@ -0,0 +1 @@ +1.1.0 diff --git a/src/opengnsys/modules/server/OpenGnSys/__init__.py b/src/opengnsys/modules/server/OpenGnSys/__init__.py index 3865e53..bcbf562 100644 --- a/src/opengnsys/modules/server/OpenGnSys/__init__.py +++ b/src/opengnsys/modules/server/OpenGnSys/__init__.py @@ -82,8 +82,8 @@ class OpenGnSysWorker(ServerWorker): self.cmd = None # Ensure cfg has required configuration variables or an exception will be thrown self.REST = REST(self.service.config.get('opengnsys', 'remote')) - # Get network interfaces until they are active or timeout (1 minute) - for t in range(0, 60): + # Get network interfaces until they are active or timeout (5 minutes) + for t in range(0, 300): try: self.interface = list(operations.getNetworkInfo())[0] # Get first network interface except Exception as e: diff --git a/src/opengnsys/operations.py b/src/opengnsys/operations.py index 1b7c050..dcfa40c 100644 --- a/src/opengnsys/operations.py +++ b/src/opengnsys/operations.py @@ -38,7 +38,7 @@ import sys if sys.platform == 'win32': from .windows.operations import * # @UnusedWildImport osType = 'Windows' - osVersion = '.'.join(map(str,getWindowsVersion()[:3]))+' '+getWindowsVersion()[4] + osVersion = getWindowsVersion() else: if sys.platform == 'darwin': from .macos.operations import * # @UnusedWildImport diff --git a/src/opengnsys/windows/operations.py b/src/opengnsys/windows/operations.py index 7a14dce..aa83c94 100644 --- a/src/opengnsys/windows/operations.py +++ b/src/opengnsys/windows/operations.py @@ -99,7 +99,18 @@ def getDomainName(): def getWindowsVersion(): - return win32api.GetVersionEx() + ''' + Returns Windows version. + ''' + import _winreg + reg = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion') + try: + data = '{} {}'.format(_winreg.QueryValueEx(reg, 'ProductName')[0], _winreg.QueryValueEx(reg, 'ReleaseId')[0]) + except Exception: + data = '{} {}'.format(_winreg.QueryValueEx(reg, 'ProductName')[0], _winreg.QueryValueEx(reg, 'CurrentBuildNumber')[0]) + reg.Close() + return data + EWX_LOGOFF = 0x00000000 EWX_SHUTDOWN = 0x00000001 @@ -136,6 +147,7 @@ def renameComputer(newName): computerName = win32api.GetComputerNameEx(win32con.ComputerNamePhysicalDnsHostname) raise Exception('Error renaming computer from {} to {}: {}'.format(computerName, newName, error)) + NETSETUP_JOIN_DOMAIN = 0x00000001 NETSETUP_ACCT_CREATE = 0x00000002 NETSETUP_ACCT_DELETE = 0x00000004 diff --git a/windows/ogagent.nsi b/windows/ogagent.nsi index e53d63d..88c9ab2 100644 --- a/windows/ogagent.nsi +++ b/windows/ogagent.nsi @@ -3,13 +3,13 @@ Name "OpenGnsys Agent" # OpenGnsys Actor version -!define OGA_VERSION 1.1.0 +!define /file OGA_VERSION "src\VERSION" # General Symbol Definitions !define REGKEY "SOFTWARE\OGAgent" !define VERSION ${OGA_VERSION}.0 !define COMPANY "OpenGnsys Project" -!define URL http://opengnsys.es +!define URL https://opengnsys.es # MultiUser Symbol Definitions !define MULTIUSER_EXECUTIONLEVEL Admin @@ -20,7 +20,6 @@ Name "OpenGnsys Agent" !define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUE "Path" # MUI Symbol Definitions -#!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico" !define MUI_ICON "src\img\oga.ico" !define MUI_FINISHPAGE_NOAUTOCLOSE !define MUI_UNICON "src\img\oga.ico" @@ -110,6 +109,10 @@ Section -post SEC0001 "1" "7" "1" "$INSTDIR\OGAgentService.exe" "" "" \ "" "" "" "" "" Pop $0 ; return error(1)/success(0) + # Disable fast boot on Windows 10, if registry key exists. + ReadRegDWORD $0 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Power" HiberbootEnabled + IfErrors 0 +2 + WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Power" HiberbootEnabled 0 # Install service nsExec::Exec /OEM "$INSTDIR\OGAgentService.exe --startup auto install" # Add service after installation # Update recovery options @@ -156,8 +159,9 @@ Section -un.post UNSEC0001 SetShellVarContext all RmDir /REBOOTOK $INSTDIR SetRebootFlag true - MessageBox MB_OK|MB_USERICON "Your system needs to reboot to complete uninstallation." - Reboot # Reboot is needed after uninstalling, so new installs works fine + MessageBox MB_YESNO "$(^RebootMessage)" IDNO donotreboot + Reboot # Reboot is needed after uninstalling, so new installs works fine + donotreboot: SectionEnd # Installer functions @@ -182,3 +186,7 @@ LangString ^UninstallLink ${LANG_ENGLISH} "Uninstall $(^Name)" LangString ^UninstallLink ${LANG_SPANISH} "Desinstalar $(^Name)" LangString ^UninstallLink ${LANG_FRENCH} "D�sinstaller $(^Name)" LangString ^UninstallLink ${LANG_GERMAN} "deinstallieren $(^Name)" +LangString ^RebootMessage ${LANG_ENGLISH} "Reboot the system to complete uninstall process?$\nNote: for a new $(^Name) installation, you will need to reboot." +LangString ^RebootMessage ${LANG_SPANISH} "¿Reiniciar el sistema para completar el proceso?$\nNota: es necesario reiniciar para instalar un nuevo $(^Name)." +LangString ^RebootMessage ${LANG_FRENCH} "Reboot the system to complete uninstall process?$\nNote: for a new $(^Name) installation, you will ned to reboot." +LangString ^RebootMessage ${LANG_GERMAN} "Reboot the system to complete uninstall process?$\nNote: for a new $(^Name) installation, you will ned to reboot."