diff --git a/windows-collect/src/collect.py b/windows-collect/src/collect.py index 33b22110e9e9f70c0d37eb7bbff92da9ea145c11..b661177938180bc58f4fd9757058c4feb6b980a8 100644 --- a/windows-collect/src/collect.py +++ b/windows-collect/src/collect.py @@ -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): diff --git a/windows-collect/src/proinfodataAgent.py b/windows-collect/src/proinfodataAgent.py index 96b6069b2b38826e6c2bee052ab2975ca18c1a4f..d54401f80fa4799bf9073cdc8304df2792cbf581 100644 --- a/windows-collect/src/proinfodataAgent.py +++ b/windows-collect/src/proinfodataAgent.py @@ -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) diff --git a/windows-installer/src/installer.nsi b/windows-installer/src/installer.nsi index 7cb32e9e54cd78a401b11659f1ed4a537a85fb69..a0c3982827206ee72de27d16d84dd6a420cc857d 100644 --- a/windows-installer/src/installer.nsi +++ b/windows-installer/src/installer.nsi @@ -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