gettyhd Posted January 9, 2008 Share Posted January 9, 2008 anyone know what the script is to check for a software version before it executes. I'm trying to include a "if" statement, "if you will" to check the software version. if the version exist.....I want autoit to exit, but if it doesn't continue with installation. Help! Link to comment Share on other sites More sharing options...
SpookMeister Posted January 9, 2008 Share Posted January 9, 2008 (edited) You could look at the file date for the program executable... or whatever applicable file would be appropriate. Edited January 9, 2008 by SpookMeister [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted January 10, 2008 Moderators Share Posted January 10, 2008 You can also check the registry for a version key. Link to comment Share on other sites More sharing options...
Kerros Posted January 10, 2008 Share Posted January 10, 2008 FileGetVersion ( "filename" [,"stringname"] ) Kerros===============================================================How to learn scripting: Figure out enough to be dangerous, then ask for assistance. Link to comment Share on other sites More sharing options...
Danny35d Posted January 10, 2008 Share Posted January 10, 2008 (edited) gettyhd welcome to autoitUDF _SoftwareList() give you a 2 dimensional array with the software name and version.Array[n][0] = Software NameArray[n][1] = Software Version#include <Array.au3> $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") $List = _SoftwareList() _ArrayDisplay($List) $List = _SoftwareList('microsoft .net framework 1.1') _ArrayDisplay($List) Func _SoftwareList($sSoftwareName = '') Dim $aSoftwareList[1][2] $objInstaller = ObjCreate('WindowsInstaller.Installer') $Products = $objInstaller.Products For $Product In $Products If $sSoftwareName <> '' And $sSoftwareName <> $objInstaller.ProductInfo($Product, 'ProductName') Then ContinueLoop ReDim $aSoftwareList[UBound($aSoftwareList) + 1][2] $aSoftwareList[UBound($aSoftwareList) - 1][0] = $objInstaller.ProductInfo($Product, 'ProductName') $aSoftwareList[UBound($aSoftwareList) - 1][1] = $objInstaller.ProductInfo($Product, 'VersionString') Next $aSoftwareList[0][0] = UBound($aSoftwareList) - 1 Return ($aSoftwareList) EndFunc ;==>_SoftwareList Func MyErrFunc() $HexNumber = Hex($oMyError.number, 8) ConsoleWrite("We intercepted a COM Error !" & @CRLF & _ "Number is: " & $HexNumber & @CRLF & _ "Windescription is: " & $oMyError.windescription) SetError(1) ; something to check for when this function returns EndFunc ;==>MyErrFuncEdit: Forgot to add MyErrFunc() UDF Edited January 10, 2008 by Danny35d AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now