Jump to content

Uninstaller Tool


NerdFencer
 Share

Recommended Posts

Here is an uninstaller tool that I put together. Amusingly it is faster than the built in windows one.

Features

  • Basic List of Programs to Uninstall
  • Renaming of Uninstall References
  • Removal of Uninstall References
  • Name Filtering EX: can show only programs with windows in the name
  • Extra info available for entries

Changes in Version 2:

-Added #RequireAdmin

-Fixed crashing bug

-Added support for multi-digit icon indexes

*Edit: Added Source

*Edit 2: Updated Source and added the Icon that I used in my compiled version, which I removed

Downloads of Previous Version: 22

Uninstall_Tool.au3

Icon.ico

Edited by NerdFencer

_________[u]UDFs[/u]_________-Mouse UDF-Math UDF-Misc Constants-Uninstaller Shell

Link to comment
Share on other sites

Link to comment
Share on other sites

Your script assume few things incorrectly. If you get an icon path as:

C:\Program File\AutoIt v3\AutoItv3.exe,33

then, because your script assume that only If StringLeft(StringRight($icon,2),1)=="," Then.., otherwise it's assumed that it's an icon path or something but this icon path doesn't exist.

Edit: gseller, try #RequireAdmin.

Edited by Authenticity
Link to comment
Share on other sites

Thanks for all the feedback :o

I have updated the original post with new code to address the issues that were pointed out.

In fixing Authenticity's incorrect assumption, I was able to get the error that snowman533 and gseller had been encountering. I think I fixed it, but it would be great if one or both of you could try the new version to make sure, that would be great. :D

_________[u]UDFs[/u]_________-Mouse UDF-Math UDF-Misc Constants-Uninstaller Shell

Link to comment
Share on other sites

Ok, I re downloaded your corrected code and icon and I am admin and still get the same error.. "_GuiImageList_addIcon: -1" I am running Autoit 3.3.0.0 and Windows XP SP2.. I got this same error running your compiled version too.. :D

Link to comment
Share on other sites

OK, here is the working function "Populate". Some icons may not be visible but works great. Thanks for the share NerdFencer. ;]

Func Populate($action = 0)
    Local $path = $uninstallpath
    Local $key, $name, $string, $icon, $iconindex, $temp
    For $i=1 To 999999
        $key = RegEnumKey($path,$i)
        If @error Then ExitLoop
        $name = RegRead($path &$key,"DisplayName")
        If Not(@error) And ($filtertext=="" Or StringInStr($name,$filtertext)>0) Then
            $string = RegRead($path &$key,"UninstallString")
            If Not(@error) Then
                If $action == 1 Then
                    $keys[$file] = $key
                    $string = ""
                    $temp = RegRead($path &$key,"Publisher")
                    If Not(@error) And Not($temp=="") Then $string = $string & "Publisher: " & $temp & @CRLF
                    $temp = RegRead($path &$key,"DisplayVersion")
                    If Not(@error) And Not($temp=="") Then $string = $string & "Version: " & $temp & @CRLF
                    $temp = RegRead($path &$key,"InstallDate")
                    If Not(@error) And StringLen($temp)==8 Then
                        $temp = ToMonth(StringLeft(StringRight($temp,4),2)) & StringRight($temp,2) & ", " & StringLeft($temp,4)
                        $string = $string & "Install Date: " & $temp & @CRLF
                    EndIf
                    $information[$file] = $string
                    RowAdd($name, $string)
                Else
                    $icon = RegRead($path &$key,"DisplayIcon")
                    If @error Then ContinueLoop
                    $iconindex = 0
                    $temp = StringSplit($icon,",")
                    If $temp[0]==2 Then
                        $iconindex = Number($temp[2])
                        $icon = $temp[1]
                    EndIf
                    $icon = FileGetLongName($icon)
                    If StringInStr($icon, '"') Then $icon = StringReplace($icon, '"', '')
                    If StringRight($icon, 3) = 'ico' Then
                            If FileExists($icon) Then _GUIImageList_AddIcon($Images, $icon)
                            ContinueLoop
                    EndIf
                    
                    If FileExists($icon) And IsNumber($iconindex) And $iconindex>=0 Then
                            ConsoleWrite($icon & @LF)
                            _GUIImageList_AddIcon($Images, $icon, $iconindex)
                    Else
                        $icon = RegRead($path &$key,"InstallLocation")&"\"
                        $iconindex = 0
                        Local $first = FileFindFirstFile($icon&"*.exe")
                        $icon = $icon & FileFindNextFile($first)
                        If Not(@error) Then
                            _GUIImageList_AddIcon($Images, $icon, $iconindex)
                        Else
                            _GUIImageList_AddIcon($Images, @SystemDir & "\Setup.exe", $iconindex)
                        EndIf
                    EndIf
                EndIf
            EndIf
        EndIf
    Next
    If $action == 0 Then
        _GUICtrlListView_SetImageList($list, $Images, 1)
    EndIf
EndFunc

Edit: Also, it's required to add Opt("ExpandEnvStrings", 1) in the header.

Edited by Authenticity
Link to comment
Share on other sites

Ok, I re downloaded your corrected code and icon and I am admin and still get the same error.. "_GuiImageList_addIcon: -1" I am running Autoit 3.3.0.0 and Windows XP SP2.. I got this same error running your compiled version too.. :D

Strange...

Would you place MsgBox(0,$iconindex,$icon) right before _GUIImageList_AddIcon($Images, $icon, $iconindex) on line 185 and tell me the values of iconindex and $icon on the entry that it fails on?

_________[u]UDFs[/u]_________-Mouse UDF-Math UDF-Misc Constants-Uninstaller Shell

Link to comment
Share on other sites

  • 1 month later...

I'm getting the ""_GuiImageList_addIcon: -1" error as well.

It's poping up from this bit of code (lines 198-206)

$icon = RegRead($path &$key,"InstallLocation")&"\"
                        $iconindex = 0
                        Local $first = FileFindFirstFile($icon&"*.exe")
                        $icon = $icon & FileFindNextFile($first)
                        If Not(@error) Then
                            ;*_GUIImageList_AddIcon($Images, $icon, $iconindex)
                        Else
                            _GUIImageList_AddIcon($Images, @SystemDir & "\Setup.exe", $iconindex)
                        EndIf

You'll see the line I've conneted out to stop the error. I don't get any icons for those entries but that doesn't worty me that much. :-)

Thanks for a great script. :) (even with this one little bug)

John Morrison

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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