Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

VB provera instalacije

[es] :: Visual Basic 6 :: VB provera instalacije

[ Pregleda: 3458 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

kopca

Član broj: 14307
Poruke: 118
*.47.eunet.yu



Profil

icon VB provera instalacije07.08.2004. u 08:40 - pre 239 meseci
Da li u VB-u mogu proveriti da li je neki program instaliran ili ne?
kopca
 
Odgovor na temu

jc denton

Član broj: 2358
Poruke: 1705
195.252.113.*



Profil

icon Re: VB provera instalacije07.08.2004. u 13:00 - pre 239 meseci
Prezueto sa : http://www.winnetmag.com/Files/07/39314/Listing_02.txt

Code:

LISTING 2: ListApps.vbs

Option Explicit
Dim strComputer, strKey, strSubKey
Dim objRegistry
Dim arrSubKeys()
Dim strDisplayName, strDisplayVersion, strInstallLocation
Const HKEY_LOCAL_MACHINE = &H80000002

strComputer = "."
strKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"

' BEGIN CALLOUT A
Set objRegistry = GetObject("winmgmts:"   & _
    "{impersonationLevel=Impersonate}!\\" & _
    strComputer & "\root\default:StdRegProv")
' END CALLOUT A

' BEGIN CALLOUT B
objRegistry.EnumKey HKEY_LOCAL_MACHINE, strKey, arrSubKeys
' END CALLOUT B

' BEGIN CALLOUT C
On Error Resume Next
For Each strSubKey In arrSubKeys
    objRegistry.GetStringValue HKEY_LOCAL_MACHINE, _
        strKey & "\" & strSubKey, "DisplayName", strDisplayName
    objRegistry.GetStringValue HKEY_LOCAL_MACHINE, _
        strKey & "\" & strSubKey, "DisplayVersion", strDisplayVersion
    objRegistry.GetStringValue HKEY_LOCAL_MACHINE, _
        strKey & "\" & strSubKey, "InstallLocation", strInstallLocation
    WScript.Echo strSubKey
    WScript.Echo String(Len(strSubKey), "-")
    WScript.Echo "Display name:     " & strDisplayName
    WScript.Echo "Display version:  " & strDisplayVersion
    WScript.Echo "Install location: " & strInstallLocation
    WScript.Echo

    strDisplayName = vbEmpty
    strDisplayVersion = vbEmpty
    strInstallLocation = vbEmpty
Next
' END CALLOUT C

fire, walk with me
 
Odgovor na temu

[es] :: Visual Basic 6 :: VB provera instalacije

[ Pregleda: 3458 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.