Search the Community
Showing results for tags '_versioncompare'.
-
Hi I am trying to check a number of applications are up to date and install the update if required. This will run as a shutdown script, pushed out through Group Policy. I am querying various registry keys to determine if The software is actually installed The software is at the correct version Once the need for update is determined then it calls another function to run the update. If the software is up to date or not installed, it moves down to the next software section which changes the registry key variables and calls the registry query function again I have managed to get the function for (un)installs to work but I am having trouble with the registry query function #NoTrayIcon #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> #include <FileConstants.au3> ; Here we go! ;########################################################################################################## ;Declare variables Global $RegKey86, $RegKey64, $RegValueName, $RegValueData, $CheckVersion86, $CheckVersion64 ; 7Zip ;########################################################################################################## _7Zip_Function() Func _7Zip_Function() ; Registry location and values that are checked for current software version ; Ensure the x64 key is preceeded with 'HKLM64' $RegKey86="HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\7-Zip" $RegKey64="HKLM64\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\7-Zip" $RegValueName="DisplayVersion" $RegValueData="16.04" ; Excecution ; --------------------------------------------------------------------------------------------------------- If _CheckSW() = 1 Then _UninstallOldVer() _InstallSW() EndIf EndFunc ;==>_7Zip_Function ; Functions ;########################################################################################################## Func _CheckSW() $CheckVersion86=RegRead ($RegKey86, $RegValueName) $CheckVersion64=RegRead ($RegKey64, $RegValueName) If $CheckVersion86=$RegValueData Or $CheckVersion64=$RegValueData Then Return 0 ElseIf $CheckVersion86="" And $CheckVersion64="" Then Return 0 Else Return 1 EndIf EndFunc ;==>CheckSW
- 11 replies