|
|
Title | Uninstall a program |
Description | This example shows how to uninstall a program in Visual Basic 6. It uses the st6unst.exe program, passing it the log file created during program installation. |
Keywords | uninstall, deinstall, uninstallation |
Categories | Software Engineering |
|
|
Use the st6unst.exe program (VB6) in the Windows directory, passing is the log file created during program installation.
To use this example, build an installation package for program Test using the Package and Deployment Wizard. Install the program and run it.
Then run program Uninstall. Tell it where to find the log file created during the installation.
Program Uninstall uses the following code to run program st6unst.exe in the Windows directory.
|
|
Private Sub Command1_Click()
Shell WindowsDirectory() & _
"\st6unst.exe -n """ & _
Text1.Text & """"
End Sub
' Return the windows directory.
Private Function WindowsDirectory() As String
Dim buf As String * 256
Dim return_len As Long
return_len = GetWindowsDirectory(buf, Len(buf))
WindowsDirectory = Left$(buf, return_len)
End Function
|
|
|
|
|
|