Uninstall using the Setup project in vb 2003

Add-in Express™ Support Service
That's what is more important than anything else

Uninstall using the Setup project in vb 2003
Installer leaving files behind... 
Jeff Gilbert




Posts: 36
Joined: 2006-03-31
I noticed the installer is leaving files behind. I did a search of my hard drive to determine where the files are being placed and noticed that the files are accumulating from each time I uninstall and reinstall the setup from the Setup project. The leftover files are in direcories that look like:

C:\Documents and Settings\Compaq_Owner\Local Settings\Application Data\assembly\dl2\3YGTTYK5.TEY\BEE6PLBT.XP4\c5786e91\006dfb51_89eec601

And it seems to have a copy of each output file in there including all the supporting dll's etc... Is there a way to tell the install to remove them? Or am I missing a setting somewhere that will clean up during uninstall?
Posted 15 Oct, 2006 22:34:29 Top
Jeff Gilbert




Posts: 36
Joined: 2006-03-31
Part of the reason that I ask is because of some strange behavior. I just installed a new version with fixes on a test machine. But, it still running one of those cached versions. It's not running the version that was just installed.

After uninstall the toolbar goes away but the files are still there. After installing the new version the toolbar comes back but it's the old toolbar and dll's running... not the new one. It's like it's getting confused with the various versions that are sitting on the machine that didn't get uninstalled on previous uninstalls. The only thing I've been able to do thus far is delete these files manually then it picks up the newer dll's.
Posted 15 Oct, 2006 22:40:54 Top
Sergey Grischenko


Add-in Express team


Posts: 7235
Joined: 2004-07-05
Hi Jeff.

The location you mentioned above is the dll cashe.
Did you change the version of the add-in assembly (in the AssemblyInfo file) and setup project (in the setup project properties) in the new verison of the add-in?
Posted 16 Oct, 2006 11:37:58 Top
Jeff Gilbert




Posts: 36
Joined: 2006-03-31
You caught me on the versioning. During testing I hadn't changed the Product code or version info on the setup project.

Even so... shouldn't the uninstall be getting rid of the stuff in the dll cache? Or is that a special flag that needs to be set in the installer?
Posted 16 Oct, 2006 12:53:41 Top
Jeff Gilbert




Posts: 36
Joined: 2006-03-31
I looked at this post, http://www.add-in-express.com/forum/read.php?FID=5&TID=1484. I'm having the same Shadow copy issue. My addin and associated files are getting copied and then on reinstallation there are copies of the previous dll's still on the machine.

Is there no way to modify this behavior? It's very very frustrating. I just need a way to reliabily uninstall to make sure future versions installs are using the correct dll's. Is there some way to reliably programatically find the dll cache dir's?
Posted 16 Oct, 2006 17:35:30 Top
Sergey Grischenko


Add-in Express team


Posts: 7235
Joined: 2004-07-05
Jeff, do you use the ADX loader?
If so, the ADX Loader uses shadow copying to enable
in-place updates of shared assemblies. This allows you to update an assembly even if it is currently being used by the host application.
The side effect of shadow copying is that if your assembly is strong named and you have disabled version increment, the shadow copying mechanism will decide to use the cached copy of your assembly and not the new copy.
To ensure that your most current copy of assembly is loaded instead of a cached copy, you can do any of the following:

1. go to the shadow copy location and manually delete the cached copy
(use the Environment.GetFolderPath method to find the cache location).

2. manually increment the assembly version number. You do this by modifying the AssemblyVersion number in the AssemblyInfo file.

3. don't strong name your assembly until you are ready to release.

Also I would advise you to change the version of the setup project too.
But the product code of the setup shouldn't be changed for a product regardless whether the product version has been changed or not.
Posted 17 Oct, 2006 06:33:53 Top
Jeff Gilbert




Posts: 36
Joined: 2006-03-31
From a practical standpoint... when/where/how would be the best time to delete the shadow copy information? I can write a chunk of code to goto the correct location and delete the files, that's not the problem... the question is when is the time to do that programatically? I've got about 900 installations that this addin will be going out to and I need a clean way to distribute the addin, fixes and new versions etc.

I just need a nudge in the right direction.
Posted 23 Oct, 2006 04:00:28 Top
Sergey Grischenko


Add-in Express team


Posts: 7235
Joined: 2004-07-05
Hi Jeff.

I would suggest you to add a new custom action before the ADX action in the Install section of the Custom Actions editor in the setup project.
In this action you could delete all shadow copies of the add-in assembly.
Posted 23 Oct, 2006 09:36:21 Top
Jeff Gilbert




Posts: 36
Joined: 2006-03-31
I may be missing something... and don't take this as bitching... But, unless I am misunderstanding, it looks like I need to write a custom action dll in C++? I'm very proficient in all flavors of VB. But, in C++ it might as well be Swahili. If I am mistaken, is there a reference you could point me to, to help me get started on writing a custom action dll?

I wanted to throw out a few quotes...
"True RAD: you write functional code only"
"All pitfalls are bypassed"
"... you concentrate your efforts on the applied code only."

All of those quotes are true to the letter as far as the application goes... I whipped out a great looking and functional Addin in no time at all. But, I'm having problems with the basic element of distributing. I need to be able to distribute this to about 900 offices with about 3500 computers. Then after that, since I'm still not writing perfect code..., I will need to release new versions.

I may be oversimplifying things... but, would it be hard to write some functionality into the ADXLoader to undo the shadow copy it did initially? The install/uninstall process is the only weak point in an otherwise GREAT product.

If I'm missing something, please help me connect the dots.

Thanks,
Jeff
Posted 28 Oct, 2006 16:04:27 Top
Jeff Gilbert




Posts: 36
Joined: 2006-03-31
OK...
It seems I need to give up smoking crack and developing at the same time... (That was a joke for those that are overly analytical...) It turns out that it was a versioning issue coupled with a screwed up early version on my test system. After incrementing the Assmembly version manually and the setup project version everything appears to be working. The only caveat is that old shadow copies are still piling up on the installed machines, but at least it's using the correct version now.

So, sorry for the cranky nature of my previous post!

Thanks,
Jeff
Posted 29 Oct, 2006 19:56:24 Top