
Signature
Phil Wilson
[MVP Windows Installer]
>I am trying to install and uninstall assemblies from GAC.
> I created a batch file which has following command in it:
[quoted text clipped - 8 lines]
> Assembly folder and also from the GAC.
> Any suugestions?
does that mean there is already an assembly of that name in the GAC?
Yes, GAC has an assembly with same name. But I run Uninstall batch file
before Install Batch file.
Is that the only option in your command?
Yes, that is only option I have specified in my command.
Does /uf make any difference?
No, using /uf didnt make any difference.
How about if you specify more of the assembly name?
Well, I didnt try this option but for my purpose I am creating an installer
which in Pre install event uninstalls all the assemblies from the GAC and in
POSTInstall event installs new assemblies in GAC.
Please let me know if you require more information.
> You're using /if to force replacement - does that mean there is already an
> assembly of that name in the GAC? Is that the only option in your command
[quoted text clipped - 14 lines]
> > Assembly folder and also from the GAC.
> > Any suugestions?
Phil Wilson - 07 Aug 2007 22:48 GMT
You mean a setup&deployment project? That "pre-install" event sounds like
you're running this code in a setup project, which might mean you're running
custom actions in the context of Windows Installer, and that might be
affecting things because in an Installer class you're running impersonated
on an msiexec.exe process.
If you are actually using a setup&deployment project, you should know that
you can get the setup project to install/uninstall assemblies in the GAC
without running any code at all.
I'd also point out that gacutil is not redistributable and is not in most
.NET FW redists, so it won't exist on client systems.

Signature
Phil Wilson
[MVP Windows Installer]
> does that mean there is already an assembly of that name in the GAC?
> Yes, GAC has an assembly with same name. But I run Uninstall batch file
[quoted text clipped - 36 lines]
>> > Assembly folder and also from the GAC.
>> > Any suugestions?
Walter Wang [MSFT] - 08 Aug 2007 04:37 GMT
Hi Matt,
I agree with Phil, if you're calling GacUtil from an installer, you first
need to be aware that GacUtil isn't redistributed with .NET Framework
Runtime; it's in the .NET Framework SDK.
Normally the setup tool may already have builtin support for installing and
uninstall assembly to/from GAC.
My wild guess is that gacuti.exe isn't found at all by the batch file, the
error is missed since you cannot see the output if it's executed silently.
Also, if you do need to call Gacutil.exe from your installer, you should
also be use the "-ir" or "-ur" switch since it can correctly
install/uninstall using reference counts. This will make sure other
programs that are using the shared assembly will not break when one program
is uninstalled.
#Global Assembly Cache Tool (Gacutil.exe)
http://msdn2.microsoft.com/en-us/library/ex0ss12c(vs.80,d=printer).aspx
<quote>
Be aware that using the /i and /u options alone does not support reference
counting. These options are appropriate for use during product development
but not for actual product installations.
</quote>
Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.