|
-
Feb 13th, 2008, 09:26 AM
#1
Thread Starter
Addicted Member
[2008] How to run a file upon uninstall ?
Hello,
I have a setup project on VS 08 and I am asking how can I run a .exe file during uninstall?
The exe removes two registry keys my program may create so I need to include this additional uninstall .exe file to make sure no registry keys are left behind uninstallation.
I tried: Custom Actions -> Uninstall -> and added my uinstall.exe file but still it did not launch upon uninstallation :S
-
Feb 13th, 2008, 08:11 PM
#2
Re: [2008] How to run a file upon uninstall ?
You would do it with a Custom Action. If you don't know how to use them properly then I suggest a visit to MSDN for some reading on the subject.
Basically you should create a new class library project and add an InstallerClass to it. You then add an event handler for the appropriate event, e.g. AfterUninstall. You then add that as your Custom Action and when your app's uninstaller raises that event your method will be executed.
-
Feb 14th, 2008, 02:48 PM
#3
Thread Starter
Addicted Member
Re: [2008] How to run a file upon uninstall ?
Hmm I am not sure what you exactly mean by that.
I am using the 'Setup' from the 'New Project' list where you can select New Form, New Project, New DLL, etc...
Here's a screenshot of a file I included in my setup and the file itself works I have tried, however, it's never being launched during uninstallation 
-
Feb 14th, 2008, 02:56 PM
#4
Fanatic Member
Re: [2008] How to run a file upon uninstall ?
You need to write the code for that. If you look at
Code:
System.Configuration.Install.Installer
class there are 2 events that you can use BeforeUninstall and AfterUninstall where you can call an exe or a batch file from there.
CLanguage; 
IF Post = HelpFull Then
RateMe
Else
Say("Shut UP")
End If
DotNet rocks
VB 6, VB.Net 2003, 2005, 2008, 2010, SQL 2005, WM 5.0,ahem ?OpenRoad?
-
Feb 14th, 2008, 06:51 PM
#5
Re: [2008] How to run a file upon uninstall ?
I know you're creating a Setup project. I said you need to create ANOTHER project, this time a Class Library. To it you add an InstallerClass. In that InstallerClass you handle the appropriate event. You then add that InstallerClass to your Setup project via the Custom Actions editor.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|