Jump to content

Recommended Posts

Posted (edited)

Iam trying to make a program that checks software versions but know i wanna add a function but dont know where to start.

the programm must install all programms where a X is selected, (when i press on the button)

#include <GUIConstants.au3>
#NoTrayIcon


GUICreate("Pc Info", 500, 360)  ; will create a dialog box that when displayed is centered
;Cecklist;00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
$versie1 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Novell", "CurrentVersion")
$versie2 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\McAfee\ePolicy Orchestrator\Application Plugins\VIRUSCAN8600", "Version")
$versie3 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\McAfee\ePolicy Orchestrator\Application Plugins\VSEMAS850000", "Version")
$versie4 = FileGetVersion("C:\Programme\WinRAR\WinRAR.exe")
$versie5 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{A8AD990E-355A-4413-8647-A9B168978423}_is1","DisplayVersion")
$versie6 = FileGetVersion("C:\Programme\Adobe\Acrobat 7.0\Reader\AcroRd32.exe")
$versie7 = FileGetVersion("C:\Programme\Baan\bin\becs.exe")
$versie8 = FileGetVersion("C:\Programme\Microsoft Office\OFFICE11\OUTLOOK.EXE")
$versie9 = FileGetVersion("C:\Programme\CCleaner\ccleaner.exe")
$versie10 = FileGetVersion("C:\Programme\FreePDF_XP\freepdf.exe")
$versie11 = FileGetVersion("C:\Programme\gs\gs8.51\bin\gswin32c.exe")
$versie16 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\ePolicy Orchestrator\Application Plugins\EPOAGENT3000", "Version")
$versie17 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Novell\ZENworks\ZfD\Agent", "Version")
;Cecklist;00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Dim $BIOS
Dim $Processors
_ComputerGetBIOS($BIOS)
_ComputerGetProcessors($Processors)

If @error Then
    $error = @error
    $extended = @extended
    Switch $extended
        Case 1
            _ErrorMsg("Array contains no information.")
        Case 2
            _ErrorMsg("$colItems isnt an object.")
    EndSwitch
EndIf

For $i = 1 To $BIOS[0][0] Step 1
GUICtrlCreateLabel ("Computername:  "& @ComputerName,  10, 5, 300)
GUICtrlCreateLabel ("Bios Version:  " & $BIOS[$i][0],  10, 17, 300)
GUICtrlCreateLabel ("CPU:       " & $Processors[$i][0],  10, 29, 300)
GUICtrlCreateLabel ("Anzahl CPU's:  " & $Processors[$i][7],  10, 41, 300)
GUICtrlCreateLabel ("Geschwindigkeit:" & $Processors[$i][9],  10, 53, 300)
GUICtrlCreateLabel ("Chassis Type:  " & _ChassisType(),  10, 65, 300)


GUICtrlCreateLabel ("----------------------------------------------------------------------------------------------------------------------------------------------------------------------", 1, 110,700)
$Button_updateall = GuiCtrlCreateButton   ("Update Software", 1, 90)
GUICtrlCreateLabel ("Software       PC        Aktuelle Version      Computer Version", 10 , 123, 700)

GUICtrlCreateLabel ("----------------------------------------------------------------------------------------------------------------------------------------------------------------------", 1, 135,700)
If $versie1 = "4.91" Then
    GUICtrlCreateLabel ("Novell Client          V            4.91"&"            "&$versie1, 10 , 145, 700)
Else
    GUICtrlCreateLabel ("Novell Client          X    4.91"&"   "&$versie1, 10 , 145, 700)
EndIf
If $versie2 = "8.5.0.781" Then
    GUICtrlCreateLabel ("Mcafee         V            8.5.0.781"&"           "&$versie2, 10 , 160, 700)
Else
    GUICtrlCreateLabel ("Mcafee         X        8.5.0.781"&"   "&$versie2, 10 , 160, 700)
EndIf
If $versie3 = "8.5.0.163" Then
    GUICtrlCreateLabel ("Mcafee Antispyware V        8.5.0.163" &"      "&$versie3, 10 , 175, 700)
Else
    GUICtrlCreateLabel ("Mcafee Antispyware X        8.5.0.163" &"      "&$versie3, 10 , 175, 700)
EndIf
If $versie4 = "3.42.0.0" Then
    GUICtrlCreateLabel ("WinRAR     V        3.42.0.0" &"       "&$versie4, 10 , 190, 700)
Else
    GUICtrlCreateLabel ("WinRAR     X        3.42.0.0" &"       "&$versie4, 10 , 190, 700)
EndIf
If $versie5 = "1.1.0.2" Then
    GUICtrlCreateLabel ("UltraVNC       V        1.1.0.2" &"            "&$versie5, 10 , 205, 700)
Else
    GUICtrlCreateLabel ("UltraVNC       X        1.1.0.2" &"            "&$versie5, 10 , 205, 700)
EndIf
If $versie6 = "7.0.8.218" Then
    GUICtrlCreateLabel ("AdobeReader        V        7.0.8.218" &"      "&$versie6, 10 , 220, 700)
Else
    GUICtrlCreateLabel ("AdobeReader        X        7.0.8.218" &"      "&$versie6, 10 , 220, 700)
EndIf
If $versie7 = "6.1.3.82" Then
    GUICtrlCreateLabel ("Baan           V        B40c.81 - (6.1.3.82)" &"   "&$versie7, 10 , 235, 700)
Else
    GUICtrlCreateLabel ("Baan           X        B40c.81 - (6.1.3.82)" &"   "&$versie7, 10 , 235, 700)
EndIf
If $versie11 = "851" Then
    GUICtrlCreateLabel ("Ghostscript        V        851            "&$versie11, 10 , 250, 700)
Else
    GUICtrlCreateLabel ("Ghostscript        X        851            "&$versie11, 10 , 250, 700)
EndIf
If $versie10 = "3.7.0.2" Then
    GUICtrlCreateLabel ("FreePDF        V        3.7.0.2" &"            "&$versie10, 10 , 265, 700)
Else
    GUICtrlCreateLabel ("FreePDF        X        3.7.0.2" &"            "&$versie10, 10 , 265, 700)
EndIf
If $versie9 = "1.34" Then
    GUICtrlCreateLabel ("CCleaner       X        1.34           "&$versie9, 10 , 280, 700)
Else
    GUICtrlCreateLabel ("CCleaner       X        1.34           "&$versie9, 10 , 280, 700)
EndIf

If $versie8 = "11.0.8118.0" Then
    GUICtrlCreateLabel ("Office         V        2003 - (11.0.8118.0)" &"   "&$versie8, 10 , 295, 700)
Else
    GUICtrlCreateLabel ("Office         X        2003 - (11.0.8118.0)" &"   "&$versie8, 10 , 295, 700)
EndIf

If $versie16 = "3.6.0.453" Then
    GUICtrlCreateLabel ("ePolicy Client     V        3.6.0.453" &"      "&$versie16, 10 , 310, 700)
Else
    GUICtrlCreateLabel ("ePolicy Client     X        3.6.0.453" &"      "&$versie16, 10 , 310, 700)
EndIf
If $versie17 = "7.0.100.60706" Then
    GUICtrlCreateLabel ("Zenworks       V        7.0.100.60706" &"      "&$versie17, 10 , 325, 700)
Else
    GUICtrlCreateLabel ("Zenworks       X        7.0.100.60706" &"      "&$versie17, 10 , 325, 700)
EndIf

GUICtrlCreateLabel ("----------------------------------------------------------------------------------------------------------------------------------------------------------------------",  1,350,700)


GUISetState (@SW_SHOW)


                                    

Next

Func _ErrorMsg($message, $time = 0)
    MsgBox(48 + 262144, "Error!", $message, $time)
EndFunc

Func _ComputerGetBIOS(ByRef $aBIOSInfo)
    Local $cI_Compname = @ComputerName, $wbemFlagReturnImmediately = 0x10, $wbemFlagForwardOnly = 0x20
    Local $colItems, $objWMIService, $objItem
    Dim $aBIOSInfo[1][25], $i = 1
    
    $objWMIService = ObjGet("winmgmts:\\" & $cI_Compname & "\root\CIMV2")
    $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
    
    If IsObj($colItems) Then
        For $objItem In $colItems
            ReDim $aBIOSInfo[UBound($aBIOSInfo) + 1][25]
            $aBIOSInfo[$i][0]  = $objItem.Name
            
            $i += 1
        Next
        $aBIOSInfo[0][0] = UBound($aBIOSInfo) - 1
        If $aBIOSInfo[0][0] < 1 Then
            SetError(1, 1, 0)
        EndIf
    Else
        SetError(1, 2, 0)
    EndIf
EndFunc ;_ComputerGetBIOS
Func _ComputerGetProcessors(ByRef $aProcessorInfo)
    Local $cI_Compname = @ComputerName, $wbemFlagReturnImmediately = 0x10, $wbemFlagForwardOnly = 0x20
    Local $colItems, $objWMIService, $objItem
    Dim $aProcessorInfo[1][42], $i = 1
    
    $objWMIService = ObjGet("winmgmts:\\" & $cI_Compname & "\root\CIMV2")
    $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Processor", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
    
    If IsObj($colItems) Then
        For $objItem In $colItems
            ReDim $aProcessorInfo[UBound($aProcessorInfo) + 1][42]
            $aProcessorInfo[$i][0]  = StringStripWS($objItem.Name, 1)
            $aProcessorInfo[$i][9]  = $objItem.CurrentClockSpeed
            $aProcessorInfo[$i][8]  = $objItem.CreationClassName
            $aProcessorInfo[$i][7]  = $objItem.CpuStatus

        Next
        $aProcessorInfo[0][0] = UBound($aProcessorInfo) - 1
        If $aProcessorInfo[0][0] < 1 Then
            SetError(1, 1, 0)
        EndIf
    Else
        SetError(1, 2, 0)
    EndIf
EndFunc ;_ComputerGetProcessors
Func _ChassisType($strComputer = "localhost")
    Local $wbemFlagReturnImmediately = 0x10, $wbemFlagForwardOnly = 0x20
    Local $colItems = "", $objItem, $objWMIService
    Local $ChassisType[25] = [24, 'Other', 'Unknown', 'Desktop', 'Low Profile Desktop', 'Pizza Box', 'Mini Tower', _
            'Tower', 'Portable', 'Laptop', 'Notebook', 'Hand Held', 'Docking Station', 'All in One', _
            'Sub Notebook', 'Space-Saving', 'Lunch Box', 'Main System Chassis', 'Expansion Chassis', _
            'SubChassis', 'Bus Expansion Chassis', 'Peripheral Chassis', 'Storage Chassis', _
            'Rack Mount Chassis', 'Sealed-Case PC']
    
    $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
    $colItems = $objWMIService.ExecQuery ("SELECT * FROM Win32_SystemEnclosure", "WQL", _
            $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
    
    If IsObj($colItems) Then
        For $objItem In $colItems
            $strChassisTypes = $objItem.ChassisTypes (0)
            Return $ChassisType[$strChassisTypes] & @LF
        Next
    EndIf
    Return
EndFunc 
While 1
    $msg = GUIGetMsg()
        Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    


    Case $msg = $Button_updateall
MsgBox(0, "", "hoi")
    EndSelect
Wend
Edited by realkiller
Posted

thats is a good idea how do i do that?

Change all your GuiCtrlCreateLabel's to GuiCtrlCreateCheckbox(), and look at the examples in the help file on how to read the "Checked" status. To make it easier to loop through the selections, save all the control IDs in an array. Post what you get and we can tweak it further.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...