#718: Mejoras en OGAgent para Windows:
* Obtener versión y edición de Windows. * Ampliar el tiempo de detección de la red a 5 min. * Deshabilitar la hibernación en la instalación del OGAgent. * Reinicio opcional en la desinstalación. git-svn-id: https://opengnsys.es/svn/branches/version1.1@5553 a21b9725-9963-47de-94b9-378ad31fedc9remotes/github/oglive
parent
622bc35be6
commit
2e072d295d
|
@ -4,7 +4,7 @@ Priority: optional
|
||||||
Maintainer: Ramón M. Gómez <ramongomez@us.es>
|
Maintainer: Ramón M. Gómez <ramongomez@us.es>
|
||||||
Build-Depends: debhelper (>= 7), po-debconf
|
Build-Depends: debhelper (>= 7), po-debconf
|
||||||
Standards-Version: 3.9.2
|
Standards-Version: 3.9.2
|
||||||
Homepage: http://www.opengnsys.es
|
Homepage: https://opengnsys.es
|
||||||
|
|
||||||
Package: ogagent
|
Package: ogagent
|
||||||
Section: admin
|
Section: admin
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
1.1.0
|
|
@ -82,8 +82,8 @@ class OpenGnSysWorker(ServerWorker):
|
||||||
self.cmd = None
|
self.cmd = None
|
||||||
# Ensure cfg has required configuration variables or an exception will be thrown
|
# Ensure cfg has required configuration variables or an exception will be thrown
|
||||||
self.REST = REST(self.service.config.get('opengnsys', 'remote'))
|
self.REST = REST(self.service.config.get('opengnsys', 'remote'))
|
||||||
# Get network interfaces until they are active or timeout (1 minute)
|
# Get network interfaces until they are active or timeout (5 minutes)
|
||||||
for t in range(0, 60):
|
for t in range(0, 300):
|
||||||
try:
|
try:
|
||||||
self.interface = list(operations.getNetworkInfo())[0] # Get first network interface
|
self.interface = list(operations.getNetworkInfo())[0] # Get first network interface
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
@ -38,7 +38,7 @@ import sys
|
||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
from .windows.operations import * # @UnusedWildImport
|
from .windows.operations import * # @UnusedWildImport
|
||||||
osType = 'Windows'
|
osType = 'Windows'
|
||||||
osVersion = '.'.join(map(str,getWindowsVersion()[:3]))+' '+getWindowsVersion()[4]
|
osVersion = getWindowsVersion()
|
||||||
else:
|
else:
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
from .macos.operations import * # @UnusedWildImport
|
from .macos.operations import * # @UnusedWildImport
|
||||||
|
|
|
@ -99,7 +99,18 @@ def getDomainName():
|
||||||
|
|
||||||
|
|
||||||
def getWindowsVersion():
|
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_LOGOFF = 0x00000000
|
||||||
EWX_SHUTDOWN = 0x00000001
|
EWX_SHUTDOWN = 0x00000001
|
||||||
|
@ -136,6 +147,7 @@ def renameComputer(newName):
|
||||||
computerName = win32api.GetComputerNameEx(win32con.ComputerNamePhysicalDnsHostname)
|
computerName = win32api.GetComputerNameEx(win32con.ComputerNamePhysicalDnsHostname)
|
||||||
raise Exception('Error renaming computer from {} to {}: {}'.format(computerName, newName, error))
|
raise Exception('Error renaming computer from {} to {}: {}'.format(computerName, newName, error))
|
||||||
|
|
||||||
|
|
||||||
NETSETUP_JOIN_DOMAIN = 0x00000001
|
NETSETUP_JOIN_DOMAIN = 0x00000001
|
||||||
NETSETUP_ACCT_CREATE = 0x00000002
|
NETSETUP_ACCT_CREATE = 0x00000002
|
||||||
NETSETUP_ACCT_DELETE = 0x00000004
|
NETSETUP_ACCT_DELETE = 0x00000004
|
||||||
|
|
|
@ -3,13 +3,13 @@
|
||||||
Name "OpenGnsys Agent"
|
Name "OpenGnsys Agent"
|
||||||
|
|
||||||
# OpenGnsys Actor version
|
# OpenGnsys Actor version
|
||||||
!define OGA_VERSION 1.1.0
|
!define /file OGA_VERSION "src\VERSION"
|
||||||
|
|
||||||
# General Symbol Definitions
|
# General Symbol Definitions
|
||||||
!define REGKEY "SOFTWARE\OGAgent"
|
!define REGKEY "SOFTWARE\OGAgent"
|
||||||
!define VERSION ${OGA_VERSION}.0
|
!define VERSION ${OGA_VERSION}.0
|
||||||
!define COMPANY "OpenGnsys Project"
|
!define COMPANY "OpenGnsys Project"
|
||||||
!define URL http://opengnsys.es
|
!define URL https://opengnsys.es
|
||||||
|
|
||||||
# MultiUser Symbol Definitions
|
# MultiUser Symbol Definitions
|
||||||
!define MULTIUSER_EXECUTIONLEVEL Admin
|
!define MULTIUSER_EXECUTIONLEVEL Admin
|
||||||
|
@ -20,7 +20,6 @@ Name "OpenGnsys Agent"
|
||||||
!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUE "Path"
|
!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUE "Path"
|
||||||
|
|
||||||
# MUI Symbol Definitions
|
# MUI Symbol Definitions
|
||||||
#!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
|
|
||||||
!define MUI_ICON "src\img\oga.ico"
|
!define MUI_ICON "src\img\oga.ico"
|
||||||
!define MUI_FINISHPAGE_NOAUTOCLOSE
|
!define MUI_FINISHPAGE_NOAUTOCLOSE
|
||||||
!define MUI_UNICON "src\img\oga.ico"
|
!define MUI_UNICON "src\img\oga.ico"
|
||||||
|
@ -110,6 +109,10 @@ Section -post SEC0001
|
||||||
"1" "7" "1" "$INSTDIR\OGAgentService.exe" "" "" \
|
"1" "7" "1" "$INSTDIR\OGAgentService.exe" "" "" \
|
||||||
"" "" "" "" ""
|
"" "" "" "" ""
|
||||||
Pop $0 ; return error(1)/success(0)
|
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
|
# Install service
|
||||||
nsExec::Exec /OEM "$INSTDIR\OGAgentService.exe --startup auto install" # Add service after installation
|
nsExec::Exec /OEM "$INSTDIR\OGAgentService.exe --startup auto install" # Add service after installation
|
||||||
# Update recovery options
|
# Update recovery options
|
||||||
|
@ -156,8 +159,9 @@ Section -un.post UNSEC0001
|
||||||
SetShellVarContext all
|
SetShellVarContext all
|
||||||
RmDir /REBOOTOK $INSTDIR
|
RmDir /REBOOTOK $INSTDIR
|
||||||
SetRebootFlag true
|
SetRebootFlag true
|
||||||
MessageBox MB_OK|MB_USERICON "Your system needs to reboot to complete uninstallation."
|
MessageBox MB_YESNO "$(^RebootMessage)" IDNO donotreboot
|
||||||
Reboot # Reboot is needed after uninstalling, so new installs works fine
|
Reboot # Reboot is needed after uninstalling, so new installs works fine
|
||||||
|
donotreboot:
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
# Installer functions
|
# Installer functions
|
||||||
|
@ -182,3 +186,7 @@ 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)"
|
||||||
LangString ^UninstallLink ${LANG_GERMAN} "deinstallieren $(^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."
|
||||||
|
|
Loading…
Reference in New Issue