Skip to content
Snippets Groups Projects
Commit 0e8941a7 authored by Edileuton Henrique de Oliveira's avatar Edileuton Henrique de Oliveira
Browse files

Fix Windows agent update

parent ea85d027
No related branches found
No related tags found
1 merge request!7Fix Update
......@@ -37,11 +37,12 @@ def getRegistryValue(key, subkey, value):
key = getattr(_winreg, key)
handle = _winreg.OpenKey(key, subkey)
(value, type) = _winreg.QueryValueEx(handle, value)
return value
return value.split('\n')[0]
# Return INEP
def getINEP():
return getRegistryValue("HKEY_LOCAL_MACHINE", "SOFTWARE\\ProInfoData", "INEP")[:-1]
return getRegistryValue("HKEY_LOCAL_MACHINE", "SOFTWARE\\ProInfoData", "INEP")
# Return Windows version
def getOSInfo(key):
......
......@@ -104,10 +104,10 @@ def callClient(args):
# Get proxy information from Windows registry
def getProxyInfo():
phost = collect.getRegistryValue("HKEY_LOCAL_MACHINE", "SOFTWARE\\ProInfoData", "ProxyHost")[:-1]
pport = collect.getRegistryValue("HKEY_LOCAL_MACHINE", "SOFTWARE\\ProInfoData", "ProxyPort")[:-1]
puser = collect.getRegistryValue("HKEY_LOCAL_MACHINE", "SOFTWARE\\ProInfoData", "ProxyUser")[:-1]
ppass = collect.getRegistryValue("HKEY_LOCAL_MACHINE", "SOFTWARE\\ProInfoData", "ProxyPass")[:-1]
phost = collect.getRegistryValue("HKEY_LOCAL_MACHINE", "SOFTWARE\\ProInfoData", "ProxyHost")
pport = collect.getRegistryValue("HKEY_LOCAL_MACHINE", "SOFTWARE\\ProInfoData", "ProxyPort")
puser = collect.getRegistryValue("HKEY_LOCAL_MACHINE", "SOFTWARE\\ProInfoData", "ProxyUser")
ppass = collect.getRegistryValue("HKEY_LOCAL_MACHINE", "SOFTWARE\\ProInfoData", "ProxyPass")
return (phost, pport, puser, ppass)
# Check for updates
......@@ -295,8 +295,8 @@ if not elapsedTime():
# Collect data
try:
collectData = collect.collect()
except:
log.write("ERROR(8): Failed to collect data.")
except Exception, e:
log.write("ERROR(8): Failed to collect data: " + str(e))
log.close()
sys.exit(8)
......
......@@ -121,16 +121,6 @@ Function .onInit
está em execução."
Abort
;Kill proinfodataAgent.exe process
StrCpy $0 "proinfodataAgent.exe"
DetailPrint "Killing all processes called '$0'"
KillProc::KillProcesses
;Kill datasidAgent.exe process
StrCpy $0 "netmon.exe"
DetailPrint "Killing all processes called '$0'"
KillProc::KillProcesses
;Verify if INEP exists in Windows registry
ClearErrors
ReadRegStr $R2 HKLM "SOFTWARE\${PRODUCT_NAME}" "INEP"
......@@ -143,7 +133,17 @@ FunctionEnd
;Main installer section
Section "SeçãoPrincipal" SEC01
SetOutPath "$INSTDIR"
SetOverwrite ifnewer
SetOverwrite on
;Kill proinfodataAgent.exe process
StrCpy $0 "proinfodataAgent.exe"
DetailPrint "Killing all processes called '$0'"
KillProcDLL::KillProc "proinfodataAgent.exe"
;Kill netmon.exe process
StrCpy $0 "netmon.exe"
DetailPrint "Killing all processes called '$0'"
KillProcDLL::KillProc "netmon.exe"
;Verify INEP in Windows registry. If not exists, creates a new one.
ClearErrors
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment