Ejemplo n.º 1
0
        private void btnLoaderRegister_Click(object sender, EventArgs e)
        {
            var fpuCW = cbLoaderDefaultFPU.Checked ? "default" : txtLoaderFpu.Text;

            if (cbLoaderManaged.Checked && !cbLoaderViaProxy.Checked)
            {
                AddinRegistrator.RegisterLoaderManagedAddin(cbApplication.Text, txtLoaderAddinRegKey.Text,
                                                            txtLoaderAddinDll.Text, txtLoaderAddinClassName.Text, txtLoaderLoaderDll.Text,
                                                            txtLoaderConfigFile.Text, fpuCW);
            }
            else if (!cbLoaderManaged.Checked && !cbLoaderViaProxy.Checked)
            {
                AddinRegistrator.RegisterLoaderNativeAddin(cbApplication.Text, txtLoaderAddinRegKey.Text,
                                                           txtLoaderAddinDll.Text, txtLoaderLoaderDll.Text);
            }
            else if (cbLoaderManaged.Checked && cbLoaderViaProxy.Checked)
            {
                AddinRegistrator.RegisterLoaderManagedProxyAddin(cbApplication.Text, txtLoaderAddinRegKey.Text,
                                                                 txtLoaderAddinDll.Text, txtLoaderAddinClassName.Text, txtLoaderLoaderDll.Text,
                                                                 txtLoaderConfigFile.Text, fpuCW, txtLoaderProxyDll.Text, txtLoaderProxyShortName.Text,
                                                                 txtLoaderProxyFullName.Text, txtLoaderAddinGuid.Text, txtLoaderAddinVersion.Text);
            }
            else if (!cbLoaderManaged.Checked && cbLoaderViaProxy.Checked)
            {
                AddinRegistrator.RegisterLoaderNativeProxyAddin(cbApplication.Text, txtLoaderAddinRegKey.Text,
                                                                txtLoaderAddinDll.Text, txtLoaderLoaderDll.Text, txtLoaderProxyDll.Text,
                                                                txtLoaderProxyShortName.Text,
                                                                txtLoaderProxyFullName.Text, txtLoaderAddinGuid.Text, txtLoaderAddinVersion.Text);
            }
            UpdateAddinLists();
        }
Ejemplo n.º 2
0
 private void btnProxyRegister_Click(object sender, EventArgs e)
 {
     AddinRegistrator.RegisterProxyAddin(cbApplication.Text, txtProxyRegKeyName.Text,
                                         txtProxyShortName.Text, txtSignedAddinDLL.Text, txtProxyDll.Text, txtProxyFullName.Text,
                                         txtProxyGuid.Text, txtProxyVersion.Text);
     UpdateAddinLists();
 }
Ejemplo n.º 3
0
 private void btnRemoveSelectedAddin_Click(object sender, EventArgs e)
 {
     AddinRegistrator.UnregisterAddin(cbApplication.Text, cbAddinToRemove.Text);
     UpdateAddinLists();
 }
Ejemplo n.º 4
0
 private void btnUnregisterAllAddins_Click(object sender, EventArgs e)
 {
     AddinRegistrator.ClearRegisteredAddIns(cbApplication.Text);
     UpdateAddinLists();
 }
Ejemplo n.º 5
0
 private void btnViewUnregister_Click_1(object sender, EventArgs e)
 {
     AddinRegistrator.UnregisterAddin(cbApplication.Text, lstAddinsList.SelectedItem.ToString());
     UpdateAddinLists();
 }
Ejemplo n.º 6
0
 private void btnRegisterSignedAddin_Click(object sender, EventArgs e)
 {
     AddinRegistrator.RegisterSignedAddin(cbApplication.Text, txtSignedRegKeyName.Text,
                                          txtSignedAddinDLL.Text);
     UpdateAddinLists();
 }
Ejemplo n.º 7
0
        private static void Main(string[] args)
        {
            if (args.Count() == 0)
            {
                // launch the WinForms application like normal
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new Interractive());
            }
            else
            {
                ConsoleHelper.InitConsoleHandles();
                try
                {
                    //AttachConsole(ATTACH_PARENT_PROCESS);
                    try
                    {
                        if (Options.Instance.isToBeCleared)
                        {
                            AddinRegistrator.ClearRegisteredAddIns(Options.Instance.Application);
                        }
                        switch (Options.Instance.RegisterMode)
                        {
                        case RegisterModeType.Unknown:
                            break;

                        case RegisterModeType.Unregister:
                            AddinRegistrator.UnregisterAddin(Options.Instance.Application,
                                                             Options.Instance.AddinRegistryKeyName);
                            break;

                        case RegisterModeType.Signed:
                            AddinRegistrator.RegisterSignedAddin(Options.Instance.Application,
                                                                 Options.Instance.AddinRegistryKeyName,
                                                                 Options.Instance.AddinDllPath);
                            break;

                        case RegisterModeType.Proxy:
                            AddinRegistrator.RegisterProxyAddin(Options.Instance.Application,
                                                                Options.Instance.AddinRegistryKeyName,
                                                                Options.Instance.AddinShortNameProxy, Options.Instance.AddinDllPath,
                                                                Options.Instance.ProxyDllPath,
                                                                Options.Instance.AddinNameProxy, Options.Instance.AddinGuidProxy.ToString(),
                                                                Options.Instance.AddinVersionProxy);
                            break;

                        case RegisterModeType.LoaderManaged:
                            AddinRegistrator.RegisterLoaderManagedAddin(Options.Instance.Application,
                                                                        Options.Instance.AddinRegistryKeyName,
                                                                        Options.Instance.AddinDllPath, Options.Instance.AddinClassName,
                                                                        Options.Instance.LoaderDllPath,
                                                                        Options.Instance.AddinConfigFile, Options.Instance.FpuCW);
                            break;

                        case RegisterModeType.LoaderManagedProxy:
                            AddinRegistrator.RegisterLoaderManagedProxyAddin(Options.Instance.Application,
                                                                             Options.Instance.AddinRegistryKeyName,
                                                                             Options.Instance.AddinDllPath, Options.Instance.AddinClassName,
                                                                             Options.Instance.LoaderDllPath,
                                                                             Options.Instance.AddinConfigFile, Options.Instance.FpuCW,
                                                                             Options.Instance.ProxyDllPath,
                                                                             Options.Instance.AddinShortNameProxy, Options.Instance.AddinNameProxy,
                                                                             Options.Instance.AddinGuidProxy.ToString(),
                                                                             Options.Instance.AddinVersionProxy);
                            break;

                        case RegisterModeType.LoaderNative:
                            AddinRegistrator.RegisterLoaderNativeAddin(Options.Instance.Application,
                                                                       Options.Instance.AddinRegistryKeyName,
                                                                       Options.Instance.AddinDllPath, Options.Instance.LoaderDllPath);
                            break;

                        case RegisterModeType.LoaderNativeProxy:
                            AddinRegistrator.RegisterLoaderNativeProxyAddin(Options.Instance.Application,
                                                                            Options.Instance.AddinRegistryKeyName,
                                                                            Options.Instance.AddinDllPath, Options.Instance.LoaderDllPath,
                                                                            Options.Instance.ProxyDllPath,
                                                                            Options.Instance.AddinShortNameProxy, Options.Instance.AddinNameProxy,
                                                                            Options.Instance.AddinGuidProxy.ToString(),
                                                                            Options.Instance.AddinVersionProxy);
                            break;

                        default:
                            throw new InvalidOperationException(string.Format("Unknown action type {0}",
                                                                              Options.Instance.RegisterMode));
                        }
                        Console.WriteLine("Operation completed successfuly");
                    }
                    catch (Exception e)
                    {
                        Console.Error.WriteLine(e.ToString());
                        Console.WriteLine("Return");
                        ConsoleHelper.ReleaseConsoleHandles();
                        Environment.Exit(-2);
                    }
                }
                finally
                {
                    ConsoleHelper.ReleaseConsoleHandles();
                }
            }
        }