Sign in to follow this  
Followers 0
cppman

Uninstall Information

1 post in this topic

#1 ·  Posted (edited)

A few UDF's to:

_GetUninstallInfo() returns:

$avArray[0] - Display Name

$avArray[1] - Display Icon

$avArray[2] - Publisher

$avArray[3] - Install Directory

$avArray[4] - Uninstaller Location

$avArray[5] - URL To the author's help website.

$avArray[6] - URL to the author's about website.

$avArray[7] - URL To update the application.

$avArray[8] - Application Version.

and

_IsInstalled() returns:

1 if the application is installed.

-1 if not.

#include <array.au3>
;==================================
; Function Name:    _IsInstalled($OfficialAppName)
; Description:    Returns whether the specified application is installed or not.
; Parameter(s):  $OfficialAppName. Must be the REAL application name.
; Requirement(s):   AutoIt3 Beta.
; Return Value(s):  On Success - Returns whether the specified application is installed or not.
;                  On Failure - -1
; Author(s):        chris95219
;==================================

Func _IsInstalled($OfficialAppName); Application Name
    $HKEYVAL1 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & $OfficialAppName & "\", "DisplayName")
    If $HKEYVAL1 <> "" Then
        $Ret = 1
    Else
        If $KEYVAL1 == "" Then
            $Ret = -1
        EndIf
    EndIf
    Return $Ret
EndFunc

;==================================
; Function Name:    _GetUninstallInfo($OfficialAppName)
; Description:    Returns an array containing information such as icon, uninstaller location, and so on...
; Parameter(s):  $OfficialAppName. Must be the REAL application name.
; Requirement(s):   AutoIt3 Beta.
; Return Value(s):  On Success - returns
;                   $avArray[0] - Display Name
;                   $avArray[1] - Display Icon
;                   $avArray[2] - Publisher
;                   $avArray[3] - Install Directory
;                   $avArray[4] - Uninstaller Location
;                   $avArray[5] - URL To the author's help website.
;                   $avArray[6] - URL to the author's about website.
;                   $avArray[7] - URL To update the application.
;                   $avArray[8] - Application Version.
;                  On Failure - -1
; Author(s):        chris95219
;==================================
Func _GetUninstallInfo($OfficialAppName)
    $HKEYVAL1 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & $OfficialAppName & "\", "DisplayName")
    If $HKEYVAL1 == "" Then
        Return -1
    Else
        $DisplayName = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & $OfficialAppName & "\", "DisplayName")
        $DisplayIcon = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & $OfficialAppName & "\", "DisplayIcon")
        $UninstallerPath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & $OfficialAppName & "\", "UninstallString")
        $Publisher = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & $OfficialAppName & "\", "Publisher")
        $InstallPath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & $OfficialAppName & "\", "InstallLocation")
        $HelpLink = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & $OfficialAppName & "\", "HelpLink")
        $AboutURL = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & $OfficialAppName & "\", "URLInfoAbout")
        $UpdateURL = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & $OfficialAppName & "\", "URLUpdateInfo")
        $Version = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & $OfficialAppName & "\", "VersionMajor") & "." & RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & $OfficialAppName & "\", "VersionMinor")
        Return _ArrayCreate($DisplayName, $DisplayIcon, $Publisher, $InstallPath, $UninstallerPath, $HelpLink, $AboutURL, $UpdateURL, $Version)
    EndIf
EndFunc
Edited by CHRIS95219

Share this post


Link to post
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
Sign in to follow this  
Followers 0