Exemple #1
0
        /// <summary>
        /// Finds the in gac.
        /// </summary>
        /// <param name="assemblyMathcer">The assembly mathcer.</param>
        /// <returns></returns>
        public static object FindInGac(AssemInfo assemblyMathcer)
        {
            var fcGac = new ArrayList();

            ReadCache(fcGac, CacheType.GAC);
            foreach (object oAssemInfo in fcGac)
            {
                if (!string.IsNullOrEmpty(assemblyMathcer.sFusionName) &&
                    oAssemInfo.GetField <string>("sFusionName") == assemblyMathcer.sFusionName)
                {
                    return(oAssemInfo);
                }

                if (oAssemInfo.GetField <string>("Name") != assemblyMathcer.Name)
                {
                    continue;
                }


                if (!string.IsNullOrEmpty(assemblyMathcer.Version) &&
                    oAssemInfo.GetField <string>("Version") != assemblyMathcer.Version)
                {
                    continue;
                }

                if (!string.IsNullOrEmpty(assemblyMathcer.PublicKeyToken) &&
                    oAssemInfo.GetField <string>("PublicKeyToken") != assemblyMathcer.PublicKeyToken)
                {
                    continue;
                }
                return(oAssemInfo);
            }
            return(null);
        }
Exemple #2
0
 /// <summary>
 /// Gacs the uninstall.
 /// </summary>
 /// <param name="assemblyMathcer">The assembly mathcer.</param>
 /// <returns></returns>
 public static bool GacUninstall(AssemInfo assemblyMathcer)
 {
     return(GacUninstall(FindInGac(assemblyMathcer)));
 }