Uninstall of an addin crashes Visual Studio
Hi. I have a native C++ addin for VS2003 that registers a bunch of commands and a custom toolbar.
As an uninstall custom action I run a VB script similar to the one here:http://support.microsoft.com/?kbid=555322
However during uninstall I'm getting a Visual Studio crash dialog. The script itself works fine. It gets rid of the commands and the toolbar. The only problem is the crash.
I reduced the script to just this:
Set objDTE = CreateObject("VisualStudio.DTE.7.1")
objDTE.Quit
and even just this:
Set objDTE = CreateObject("VisualStudio.DTE.7.1")
But it still causes a crash. BTW, running the script alone causes no crash. Just when it is executed as part of the uninstaller.
Any ideas what to do?
Thanks
Ivo
[921 byte] By [
Ivo] at [2007-12-24]
Hi Ivo,
I wrote that article. If the script works fine outside the uninstaller, could it be that the problem is not the script? I mean, if, for testing purposes, you remove the script from the uninstaller, do you get the crash still? If so, the problem is something else. If not , it is something specific that you are doing with the script in your uninstaller.
I have used that technique with my Innosetup uninstaller with no problems...
Thanks for the reply
If I comment out the whole script the uninstaller works fine. I'm using the default setup project that is generated by the VS wizard and just add uninstall.vbs to the uninstall custom actions.
I also have On Error Resume Next. The reason is that if anything goes wrong during the execution the uninstaller stops and rolls back. It is really hard to get rid of the addin after that.
I've had 2 problems with the script. The first one was using "dte.Quit;" instead of "dte.Quit". The second was that dte.Commands.Item("Mycommand") crashes if there is no such command instead of returning NULL (or whatever the VBS equivalent is). I'm a real noob when it comes to VBS and the only way I know how to handle errors is "On Error Resume Next"... Is there a better way?
Ivo
Ivo at 2007-10-8 >

I meant "Is there a better way of handling errors in VBS"
. So I can catch dte.Commands.Item("Mycommand") failing and continue to the next command.
BTW, when I tried the uninstall yesterday it didn't crash. Weird...
Ivo
Ivo at 2007-10-8 >
