Esempio n. 1
0
        public static void RegisterComponentsInGMERegistry()
        {

            if (ComponentConfig.iconPath == null )
            {
                ComponentConfig.iconPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + '\\' + ComponentConfig.iconName;
            }

            GME.Util.MgaRegistrar registrar = new GME.Util.MgaRegistrar();
            if ((int)GME.MGA.Core.GMEInterfaceVersion_enum.GMEInterfaceVersion_Current != (int)((GME.MGA.Core.IGMEVersionInfo)registrar).version)
            {
                throw new RegistrationException("MgaInterfaceVersion mismatch: this assembly is using " +
                    (int)GME.MGA.Core.GMEInterfaceVersion_enum.GMEInterfaceVersion_Current +
                    " but the GME interface version is " + (int)((GME.MGA.Core.IGMEVersionInfo)registrar).version +
                    "\n\nPlease install a compatible GME version or update the interop dlls.");
            }

            registrar.RegisterComponent(ComponentConfig.progID, ComponentConfig.componentType, ComponentConfig.componentName, ComponentConfig.registrationMode);
            registrar.set_ComponentExtraInfo(ComponentConfig.registrationMode, ComponentConfig.progID, "Icon", ComponentConfig.iconPath);

            if (!ComponentConfig.paradigmName.Equals("*"))
            {
                foreach (String paradigm in ComponentConfig.paradigmName.Split(','))
                {
                    registrar.Associate(ComponentConfig.progID, paradigm, ComponentConfig.registrationMode);
                }
            }
        }
Esempio n. 2
0
        public void DLLRegisterServer(int regMode)
        {
            //register dll
            //same as:
            //post build event: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\regasm.exe $(TargetPath) /codebase

            RegistrationServices regAsm = new RegistrationServices();
            bool bResult = regAsm.RegisterAssembly(
                ComponentConfig.typeToRegister.Assembly,
                AssemblyRegistrationFlags.SetCodeBase);

            GME.Util.MgaRegistrar reg = new GME.Util.MgaRegistrar();
            if ((int)GME.MGA.Core.GMEInterfaceVersion_enum.GMEInterfaceVersion_Current != (int)((GME.MGA.Core.IGMEVersionInfo)reg).version)
            {
                throw new Exception("MgaInterfaceVersion mismatch: this assembly is using " +
                                    (int)GME.MGA.Core.GMEInterfaceVersion_enum.GMEInterfaceVersion_Current +
                                    " but the GME interface version is " + (int)((GME.MGA.Core.IGMEVersionInfo)reg).version +
                                    "\n\nPlease install a compatible GME version or update the interop dlls.");
            }
            reg.RegisterComponent(
                regAsm.GetProgIdForType(ComponentConfig.typeToRegister),
                GME.MGA.componenttype_enum.COMPONENTTYPE_INTERPRETER,
                ComponentConfig.componentName,
                regacc_translate(regMode));

            reg.set_ComponentExtraInfo(regacc_translate(regMode), regAsm.GetProgIdForType(ComponentConfig.typeToRegister), "Icon", ComponentConfig.iconId);

            if (!ComponentConfig.paradigmName.Equals("*"))
            {
                reg.Associate(regAsm.GetProgIdForType(ComponentConfig.typeToRegister), ComponentConfig.paradigmName, (GME.Util.regaccessmode_enum)regMode);
            }
        }
Esempio n. 3
0
        public static void RegisterComponentsInGMERegistry()
        {
            if (ComponentConfig.iconPath == null)
            {
                ComponentConfig.iconPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + '\\' + ComponentConfig.iconName;
            }

            GME.Util.MgaRegistrar registrar = new GME.Util.MgaRegistrar();
            if ((int)GME.MGA.Core.GMEInterfaceVersion_enum.GMEInterfaceVersion_Current != (int)((GME.MGA.Core.IGMEVersionInfo)registrar).version)
            {
                throw new RegistrationException("MgaInterfaceVersion mismatch: this assembly is using " +
                                                (int)GME.MGA.Core.GMEInterfaceVersion_enum.GMEInterfaceVersion_Current +
                                                " but the GME interface version is " + (int)((GME.MGA.Core.IGMEVersionInfo)registrar).version +
                                                "\n\nPlease install a compatible GME version or update the interop dlls.");
            }

            registrar.RegisterComponent(ComponentConfig.progID, ComponentConfig.componentType, ComponentConfig.componentName, ComponentConfig.registrationMode);
            registrar.set_ComponentExtraInfo(ComponentConfig.registrationMode, ComponentConfig.progID, "Icon", ComponentConfig.iconPath);
            registrar.set_ComponentExtraInfo(ComponentConfig.registrationMode, ComponentConfig.progID, "Tooltip", ComponentConfig.componentName);

            if (!ComponentConfig.paradigmName.Equals("*"))
            {
                foreach (String paradigm in ComponentConfig.paradigmName.Split(','))
                {
                    registrar.Associate(ComponentConfig.progID, paradigm, ComponentConfig.registrationMode);
                }
            }
        }
Esempio n. 4
0
        public static void UnregisterComponentsInGMERegistry()
        {
            GME.Util.MgaRegistrar registrar = new GME.Util.MgaRegistrar();
            if ((int)GME.MGA.Core.GMEInterfaceVersion_enum.GMEInterfaceVersion_Current != (int)((GME.MGA.Core.IGMEVersionInfo)registrar).version)
            {
                throw new RegistrationException("MgaInterfaceVersion mismatch: this assembly is using " +
                    (int)GME.MGA.Core.GMEInterfaceVersion_enum.GMEInterfaceVersion_Current +
                    " but the GME interface version is " + (int)((GME.MGA.Core.IGMEVersionInfo)registrar).version +
                    "\n\nPlease install a compatible GME version or update the interop dlls.");
            }

            registrar.UnregisterComponent(ComponentConfig.progID, ComponentConfig.registrationMode);
        }
Esempio n. 5
0
        public static void UnregisterComponentsInGMERegistry()
        {
            GME.Util.MgaRegistrar registrar = new GME.Util.MgaRegistrar();
            if ((int)GME.MGA.Core.GMEInterfaceVersion_enum.GMEInterfaceVersion_Current != (int)((GME.MGA.Core.IGMEVersionInfo)registrar).version)
            {
                throw new RegistrationException("MgaInterfaceVersion mismatch: this assembly is using " +
                                                (int)GME.MGA.Core.GMEInterfaceVersion_enum.GMEInterfaceVersion_Current +
                                                " but the GME interface version is " + (int)((GME.MGA.Core.IGMEVersionInfo)registrar).version +
                                                "\n\nPlease install a compatible GME version or update the interop dlls.");
            }

            registrar.UnregisterComponent(ComponentConfig.progID, ComponentConfig.registrationMode);
        }
 public static void CheckParadigmVersionUpgrade(MgaProject project)
 {
     GME.Util.MgaRegistrar registar = new GME.Util.MgaRegistrar();
     string MetaConnStr;
     object MetaGuid = null;
     object ProjectMetaGuid;
     project.BeginTransactionInNewTerr();
     try
     {
         registar.QueryParadigm(project.MetaName, out MetaConnStr, ref MetaGuid, GME.Util.regaccessmode_enum.REGACCESS_BOTH);
         ProjectMetaGuid = project.MetaGUID;
     }
     finally
     {
         project.AbortTransaction();
     }
     if (((Array)ProjectMetaGuid).Cast<byte>().SequenceEqual(((Array)MetaGuid).Cast<byte>()) == false)
     {
         Xunit.Assert.True(false, string.Format("Please upgrade {0} to the latest registered {1} paradigm", project.ProjectConnStr, project.MetaName));
     }
 }
Esempio n. 7
0
        public static void CheckParadigmVersionUpgrade(MgaProject project)
        {
            GME.Util.MgaRegistrar registar = new GME.Util.MgaRegistrar();
            string MetaConnStr;
            object MetaGuid = null;
            object ProjectMetaGuid;

            project.BeginTransactionInNewTerr();
            try
            {
                registar.QueryParadigm(project.MetaName, out MetaConnStr, ref MetaGuid, GME.Util.regaccessmode_enum.REGACCESS_BOTH);
                ProjectMetaGuid = project.MetaGUID;
            }
            finally
            {
                project.AbortTransaction();
            }
            if (((Array)ProjectMetaGuid).Cast <byte>().SequenceEqual(((Array)MetaGuid).Cast <byte>()) == false)
            {
                Xunit.Assert.True(false, string.Format("Please upgrade {0} to the latest registered {1} paradigm", project.ProjectConnStr, project.MetaName));
            }
        }
Esempio n. 8
0
        public void DLLRegisterServer(int regMode)
        {
            //register dll 
            //same as:
            //post build event: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\regasm.exe $(TargetPath) /codebase

            RegistrationServices regAsm = new RegistrationServices();
            bool bResult = regAsm.RegisterAssembly(
                ComponentConfig.typeToRegister.Assembly,
                AssemblyRegistrationFlags.SetCodeBase);

            GME.Util.MgaRegistrar reg = new GME.Util.MgaRegistrar();
            if ((int)GME.MGA.Core.GMEInterfaceVersion_enum.GMEInterfaceVersion_Current != (int)((GME.MGA.Core.IGMEVersionInfo)reg).version)
            {
                throw new Exception("MgaInterfaceVersion mismatch: this assembly is using " +
                    (int)GME.MGA.Core.GMEInterfaceVersion_enum.GMEInterfaceVersion_Current +
                    " but the GME interface version is " + (int)((GME.MGA.Core.IGMEVersionInfo)reg).version +
                    "\n\nPlease install a compatible GME version or update the interop dlls.");
            }
            reg.RegisterComponent(
                regAsm.GetProgIdForType(ComponentConfig.typeToRegister),
                GME.MGA.componenttype_enum.COMPONENTTYPE_INTERPRETER,
                ComponentConfig.componentName,
                regacc_translate(regMode));

            reg.set_ComponentExtraInfo(regacc_translate(regMode), regAsm.GetProgIdForType(ComponentConfig.typeToRegister), "Icon", ComponentConfig.iconId);

            if (!ComponentConfig.paradigmName.Equals("*"))
            {
                reg.Associate(regAsm.GetProgIdForType(ComponentConfig.typeToRegister), ComponentConfig.paradigmName, (GME.Util.regaccessmode_enum)regMode);
            }

        }