ca143508 Posted June 5, 2006 Share Posted June 5, 2006 Guys, I have a text file that has listed in it all the aoftware installed on my machine. I want to take that information and drop it into a list on my Gui so that it is viewable while the application runs. Does anyone have any code or can help me out with this? Any help is greatly appreciated. Cheers, Mike. Link to comment Share on other sites More sharing options...
Uten Posted June 5, 2006 Share Posted June 5, 2006 The samples for GUICtrlCreateListView and FileReadLine in the beta help file should take you a long way. Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
Valuater Posted June 5, 2006 Share Posted June 5, 2006 if you show us some code... maybe we can help direct you 8) Link to comment Share on other sites More sharing options...
ca143508 Posted June 5, 2006 Author Share Posted June 5, 2006 Func SoftwareAudit() $RegKey = "HKey_Local_machine\software\microsoft\windows\currentversion\uninstall\" $Count = 1 FileWriteLine(@WorkingDir & @Computername & ".txt","Software Audit of " & @UserName & "'s Computer." & @CRLF & "" & @CRLF) While 1 $Key = RegEnumKey($RegKey, $Count) If @error <> 0 Then ExitLoop $ProductName = RegRead($RegKey & "\" & $Key,"DisplayName") If $ProductName = "" Then $Count = $Count + 1 ContinueLoop EndIf FileWriteLine(@WorkingDir & @Computername & ".txt",$ProductName) $Count = $Count + 1 WEnd MsgBox(0,"" & $ApplicationTitle,"The audit is now complete. ") EndFunc So this code gives me the list of software installed. The next part I want to do is take what it gathers and display it within my GUI. Cheers Link to comment Share on other sites More sharing options...
exodius Posted June 5, 2006 Share Posted June 5, 2006 (edited) I think with some adapatation this will do the trick. You may want to do some If Then statements at some point to strip out the Windows Updates since this grabs those two and you probably don't care so much about them... Or maybe you do and want to consider them in a different way. BTW, in your FileWriteLines, you need a "\" in between @WorkingDir and @Computername because @WorkingDir doesn't include it. expandcollapse popupDim $ApplicationTitle #include <GUIConstants.au3> #include <File.au3> #include <Array.au3> SoftwareAudit() GUI() Func SoftwareAudit() $RegKey = "HKey_Local_machine\software\microsoft\windows\currentversion\uninstall\" $Count = 1 While 1 $Key = RegEnumKey($RegKey, $Count) If @error <> 0 Then ExitLoop $ProductName = RegRead($RegKey & "\" & $Key, "DisplayName") If $ProductName = "" Then $Count = $Count + 1 ContinueLoop EndIf FileWriteLine(@WorkingDir & "\" & @ComputerName & ".txt", $ProductName) $Count = $Count + 1 WEnd EndFunc ;==>SoftwareAudit Func GUI() GUICreate("My GUI") GUICtrlCreateCombo("", 10, 10, 300) Dim $Array _FileReadToArray(@ComputerName & ".txt", $Array) _ArraySort($Array) FileDelete(@WorkingDir & "\" & @ComputerName & ".txt") For $x = 0 To UBound($Array) - 1 If StringStripCR($Array[$x]) <> "" Then GUICtrlSetData(-1, StringStripCR($Array[$x]), StringStripCR($Array[1])) EndIf Next GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc ;==>GUI Edited June 5, 2006 by exodius 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