![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Sep 2005
Posts: 4
Rep Power: 0
![]() |
Program removal
I want to write a program which will uninstall annother specific program, and run a registry file afterward ( to clean what was left behind by that program in the registry. ).
I'm not trying to make an advanced add/remove programs utility like others on the market, this is for one specific program at a time and would need to be rewritten for every different program that needed to be deleted. So my idea is basically to have it run the program's existing uninstall utility then run the file I created for removing the registry keys. What I've done so far: I've allready discovered all the keys and created the file to remove the keys from the registry and found that the uninstall information is located in an XML document that appears to require something inside windows to run it, but I'm not entirely positive what that may be. My knowledge of VB isn't too advanced, and I honestly really have no idea if this is even possible. But I'm here to learn, not just copy and paste, I'm not looking for someone to tell me exactly what to do, just a "Yeah it's possible" or a "No Way", and if it is possible, a point in the right direction. |
|
|
|
|
|
#2 |
|
Programmer
|
Well if you are going to use VB6, then you will need to do a bunch of work to get it to read the registry beyond what VB6 allows you to do. You will need to use Win32 APIs for Enumerating/Reading/Writing/Deleting Registry keys.
If you are going to use VB.NET then you have the ability to use the Registry Class that comes with .NET and it allows you to easily do these things. If you want to simply run the original install program then change those keys you can do it by ShellExecute Win32 API. You can use that to call the .reg file as well (but you will be prompted by Windows if you want to install the registry keys.) If you are going to replace the existing uninstaller with your own, then you also need to modify Software/Microsoft/Windows/CurrentVersion/Uninstall path to point to your app instead of the original uninstaller. Hope this helps, Chi |
|
|
|
|
|
#3 | |
|
Newbie
Join Date: Sep 2005
Posts: 4
Rep Power: 0
![]() |
Quote:
Anyway, if the quoted method above would work in VB 6.0, then that's great. I also have Visual C++ at my disposal, but I know nothing about it, and also don't have any books on it, though I'm sure I could look for instruction on the web. The setup file of this program is strange though, it dosn't seem to use the windows uninstall shield either. I tried out C++'s debugger on the process that starts and figured out that it points to a seperate setup.exe in the program's folders. In that same folder is the uninstall.XML file, but when this EXE is run manually, it says that setup.XML is missing. Copying setup.XML into this folder only makes it ask for a non-existant diskette, and copying uninstall.XML into the other folder apparently does nothing. So, there's some instruction that takes place beteween clicking on uninstall in the Add/Remove programs window and when it accesses the setup.exe in the program's folder. Not sure weither any of this is really important because I havn't learned how to use ShellExecute yet, but I'm working on that right now. Thanks alot for your help man. |
|
|
|
|
|
|
#4 |
|
Newbie
Join Date: Sep 2005
Posts: 4
Rep Power: 0
![]() |
Found the registry entry you were talking about too, there's a few keys in here, one has the path for the .exe in the folder with uninstall.xml in it with a special instruction... bingo.
![]() EDIT: Sorry about the double post people, I got excited when I found it and am an idgit. |
|
|
|
|
|
#5 |
|
Newbie
Join Date: Sep 2005
Posts: 4
Rep Power: 0
![]() |
Program complete as of now, will only work when the program itself is in a default extraction location, as with default locations for the target and it's registry keys. Want to update later so that it will be able to search the HDD for the program and the registry keys, and not need to be extracted to a specific location, but this will work for now. Also added a button to restart the computer using the same method! Only works in full in windows XP as far as I know, havn't tested it on other systems yet.
Thanks again for all your help, it was quite simple once I found the special instruction and learned how to use ShellExecute. I immagine the next step will be a bit more difficult, but I immagine I'll be able to figure it out using your same post. If not I could allways switch to VB.NET which I'm sure would make things a bit easier. -Matt |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|