Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Uninstall a product with VB6 code

0 views
Skip to first unread message

Juan Marcial

unread,
Oct 10, 2008, 4:47:01 PM10/10/08
to
Hi-
I need uninstall a VB6 application. This application was installed with a
msi package.

I try:
Shell "msiexec /x package.msi"
But I don’t know the path of package.msi, then fail.
What can I do?
Suggestions...

Thanks in advanced.
--
Juan Marcial
Ingeniero de Software

MikeD

unread,
Oct 10, 2008, 5:07:18 PM10/10/08
to

"Juan Marcial" <eslend...@hotmail.com> wrote in message
news:10F465CE-EAE6-483A...@microsoft.com...

> Hi-
> I need uninstall a VB6 application. This application was installed with a
> msi package.
>
> I try:
> Shell "msiexec /x package.msi"
> But I don’t know the path of package.msi, then fail.
> What can I do?
> Suggestions...
>


Is there an uninstall shortcut for the app in the Start Menu?

Have you gone to Add/Remove Programs in Control Panel (assuming WinXP or
earlier, off-hand don't remember how to get to that under Vista).

Have you tried re-running the app's Setup? Frequently, when that's run for
an installed application, it provides an option to uninstall and/or repair
(especially if it uses Windows Installer, as you said this one does).

Have you contacted the author of the program for instructions on how to
uninstall it?

--
Mike

P.S. I really don't see this as being a VB-related question. It's
irrelevant that the app was written with VB6.


mayayana

unread,
Oct 10, 2008, 6:27:07 PM10/10/08
to
If you look in
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall
you'll see that most (all?) uninstall strings for
MSI installs use a GUID rather than a path.

Try the MSI group for a better explanation:

microsoft.public.msi.platformsdk


> I need uninstall a VB6 application. This application was installed with a
> msi package.
>
> I try:
> Shell "msiexec /x package.msi"

> But I donā?Tt know the path of package.msi, then fail.

Harvey Triana

unread,
Oct 11, 2008, 6:15:25 AM10/11/08
to
Can get GUID with this funcion:

Private Function GetGUID(pAppName As String) As String
Dim ws
Dim pc
Dim subkey
Dim subkeys
Dim app
Dim r
Dim kp
Dim RawGuid
Dim Guid

Const HKEY_LOCAL_MACHINE = &H80000002

On Error Resume Next

Set ws = CreateObject("WScript.Shell")
pc = "."
Set r = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
pc & "\root\default:StdRegProv")
kp = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
r.EnumKey HKEY_LOCAL_MACHINE, kp, subkeys

For Each subkey In subkeys
app = ws.RegRead("HKLM\" & kp & "\" & subkey & "\DisplayName")
If InStr(app, pAppName) > 0 Then
RawGuid = ""
Guid = ""
RawGuid = ws.RegRead("HKLM\" & kp & "\" & subkey &
"\UninstallString")
Guid = Mid(RawGuid, InStr(RawGuid, "{"), 38)
If Not Guid = "" Then
GetGUID = Guid
Exit For
End If
End If
Next
Set ws = Nothing
End Function
--
<Harvey Triana />
http://vexpert.mvps.org

"mayayana" <mayaX...@rcXXn.com> escribió en el mensaje de noticias
news:%23VjIMcy...@TK2MSFTNGP05.phx.gbl...

Harvey Triana

unread,
Oct 11, 2008, 7:29:51 AM10/11/08
to
Juan-
Warning. If runs VB6's Unistall to unistall a VB6 application maybe it
removes VB runtime - great problem here. Instead of write a VBScript for
this.

Regards,


--
<Harvey Triana />
http://vexpert.mvps.org

"Harvey Triana" <harvey...@hotmail.com> escribió en el mensaje de
noticias news:O2PUMp4K...@TK2MSFTNGP06.phx.gbl...

mayayana

unread,
Oct 11, 2008, 8:57:08 AM10/11/08
to
> RawGuid = ws.RegRead("HKLM\" & kp & "\" & subkey &
> "\UninstallString")
> Guid = Mid(RawGuid, InStr(RawGuid, "{"), 38)

With that you're getting the GUID for use with
the Windows Installer object model? Why
not just run the UninstallString, like one would
do for any other software? At this point in the
function you've already done all the work of
hunting it down.


Juan Marcial

unread,
Oct 16, 2008, 9:27:00 AM10/16/08
to
Thanks Harvey. Just that i need.

--
Juan Marcial
Ingeniero de Software


"Harvey Triana" wrote:

> >>> But I donâ?Tt know the path of package.msi, then fail.

0 new messages