static RegistrationHelperTx()
 {
     if (Wow64Helper.IsWow64Process())
     {
         _appid   = _appidWow64;
         _appname = _appnameWow64;
     }
     else
     {
         _appid   = _appidNoWow64;
         _appname = _appnameNoWow64;
     }
 }
        private bool ValidateBitness(ApplicationSpec spec, out string message)
        {
            bool flag  = false;
            bool flag2 = true;

            message = string.Empty;
            if (Wow64Helper.IsWow64Supported())
            {
                flag = Wow64Helper.IsWow64Process();
                ICatalogObject obj2 = this.FindApplication(this._appColl, spec);
                if (obj2 == null)
                {
                    return(flag2);
                }
                ICatalogCollection collection = (ICatalogCollection)this._appColl.GetCollection(CollectionName.Components, obj2.Key());
                Populate(collection);
                int num = collection.Count();
                if (num <= 0)
                {
                    return(flag2);
                }
                Guid[] arr = new Guid[spec.ConfigurableTypes.Length];
                for (int i = 0; i < spec.ConfigurableTypes.Length; i++)
                {
                    arr[i] = Marshal.GenerateGuidForType(spec.ConfigurableTypes[i]);
                }
                for (int j = 0; j < num; j++)
                {
                    ICatalogObject obj3 = (ICatalogObject)collection.Item(j);
                    string         g    = (string)obj3.Key();
                    Guid           key  = new Guid(g);
                    if (this.FindIndexOf(arr, key) != -1)
                    {
                        int num4 = (int)obj3.GetValue("Bitness");
                        if (flag && (num4 == 2))
                        {
                            message = Resource.FormatString("Reg_Already64bit");
                            return(false);
                        }
                        if (!flag && (num4 == 1))
                        {
                            message = Resource.FormatString("Reg_Already32bit");
                            return(false);
                        }
                    }
                }
            }
            return(flag2);
        }