Uninstall problems with Office PIA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I've developed a solution with VS2003, which automates Excel XP. I created a
setup project featuring install of the Primary Interop Assembly
'microsoft.office.interop.excel.dll' in the GAC. I added a condition: If the
dll already exists (correct version) in the GAC then a new install will be
canceled. This condition run. But if I uninstall my program, the entry in the
GAC will be removed. Why?
 
Maik said:
Hello,

I've developed a solution with VS2003, which automates Excel XP. I created
a
setup project featuring install of the Primary Interop Assembly
'microsoft.office.interop.excel.dll' in the GAC. I added a condition: If
the
dll already exists (correct version) in the GAC then a new install will be
canceled. This condition run. But if I uninstall my program, the entry in
the
GAC will be removed. Why?

You should not add the condition, just add the assembly to the GAC, if this
version is already installed it's reference count will be incremented. So
when you uninstall you won't delete the assembly from the GAC, you only
decrement the reference count.

Willy.
 
I've solved the problem. But I have another Question. How can I check if my
assembly in the GAC is used by another program? I use this information for
the uninstall procedure.
 
Thanks. I've deleted the condition. The setup runs perfect.

I have thought out following setting. I install a new Primary Interop
Assembly with my setup. After two weeks a second program refers to this
assembly. If I uninstall my program, will the assembly be removed from the
GAC?

Maik
 
Maik said:
I've solved the problem. But I have another Question. How can I check if
my
assembly in the GAC is used by another program? I use this information for
the uninstall procedure.

You don't have to care about it, each GAC assembly is ref counted, when you
install an assembly (same version) it's counter is incremented if already
present else it's set to 1.
If you uninstall the ref counter is decremented and the assembly will be
removed when the ref counter reaches 0.

Willy.
 
Back
Top