I have tried making the installer for an application from scratch and I succeeded in creating it. The batch file that I created can now install and uninstall an application easily. Though it doesn’t provide massive options and functionality, it will do the basic functionality of a Microsoft Windows Installer (MSI). You just have to use the WMI class Win32_Product along with the Uninstall method. The code for following operation that I got working is,
Code:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colSoftware = objWMIService.ExecQuery _
("Select * from Win32_Product " _
& "Where Name = 'Personnel database'")
For Each objSoftware in colSoftware
objSoftware.Uninstall()
Next
Try it out and see if it works for you or not. This is just the basic syntax of the batch file that I created. You will need to alter it according to your need.
Bookmarks