コード例 #1
0
        private void FormLauncher_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (!TestDlg32Reg)
            {
                RegRun.UnRegLib("/s " + Application.StartupPath + "/lib/COMDLG32.OCX");
            }
            if (!TestComCTLReg)
            {
                RegRun.UnRegLib("/s " + Application.StartupPath + "/lib/MSCOMCTL.OCX");
            }

            try
            {
                RegUst.UnRegFile(".ust");
                RegUst.UnRegFile(".uar");
            }
            catch (Exception errorMsg)
            {
                MessageBox.Show(errorMsg.Message);
            }
            notifyIcon.ShowBalloonTip(5000, "UTAURtLibHelper - 启动器模式", "UTAU已退出", ToolTipIcon.Info);

            if (Directory.Exists(@".\lib"))
            {
                Directory.Delete(@".\lib");
            }
        }
コード例 #2
0
        private void FormLauncher_Load(object sender, EventArgs e)
        {
            if (!TestDlg32Reg)
            {
                RegRun.RegLib("/s " + Application.StartupPath + "/lib/COMDLG32.OCX");
            }
            if (!TestComCTLReg)
            {
                RegRun.RegLib("/s " + Application.StartupPath + "/lib/MSCOMCTL.OCX");
            }

            try
            {
                RegUst.RegFile(utauFile, ".ust");
                RegUst.RegFile(utauFile, ".uar");
            }
            catch (Exception errorMsg)
            {
                MessageBox.Show(errorMsg.Message);
            }

            WindowState = FormWindowState.Minimized;

            ShowInTaskbar      = false;
            notifyIcon.Visible = true;

            runUTAU(utauFile);
            notifyIcon.ShowBalloonTip(1000);
        }
コード例 #3
0
        public FormLauncher(string pathString)
        {
            InitializeComponent();

            TestDlg32Reg    = RegRun.RegTest(@"TypeLib\{F9043C88-F6F2-101A-A3C9-08002B2F49FB}\1.2\0\win32");
            TestComCTLReg   = RegRun.RegTest(@"TypeLib\{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}\2.0");
            utauFile        = pathString;
            notifyIcon.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
        }
コード例 #4
0
 private void btnReg_Click(object sender, EventArgs e)
 {
     if (FileName == null || FileName == "")
     {
         MessageBox.Show("请选择文件");
     }
     else
     {
         RegRun.RegLib(SystemFile + FileName);
     }
 }
コード例 #5
0
 private void btnMSCOMCTL_MouseDown(object sender, MouseEventArgs MouseE)
 {
     if (MouseE.Button == MouseButtons.Right || MouseE.Button == MouseButtons.Middle)
     {
         DialogResult Res = MessageBox.Show("是否反注册MSCOMCTL.OCX?", "反注册", MessageBoxButtons.OKCancel);
         if (Res == DialogResult.OK)
         {
             RegRun.UnRegLib(SystemFile + "MSCOMCTL.OCX");
         }
     }
 }
コード例 #6
0
        private void btnMSCOMCTL_Click(object sender, EventArgs e)
        {
            try
            {
                File.Copy(Source + "MSCOMCTL.OCX", SystemFile + "MSCOMCTL.OCX", false);
                MessageBox.Show("MSCOMCTL.OCX 写入成功");
            }
            catch (Exception errorMsg)
            {
                MessageBox.Show(errorMsg.Message + "\r\nMSCOMCTL.OCX 文件未写入");
            }

            RegRun.RegLib(SystemFile + "MSCOMCTL.OCX");
        }
コード例 #7
0
        private void btnReg_Click(object sender, EventArgs e)
        {
            FileVersionInfo info     = FileVersionInfo.GetVersionInfo(libFile);
            String          FileName = info.OriginalFilename;

            try
            {
                File.Copy(libFile, SystemFile + FileName, false);
                MessageBox.Show(FileName + " 写入成功。");
            }
            catch (Exception errorMsg)
            {
                MessageBox.Show(errorMsg.Message + "\r\n" + FileName + " 文件未写入。");
            }

            RegRun.RegLib(SystemFile + FileName);
        }
コード例 #8
0
        private void btnOneKey_Click(object sender, EventArgs e)
        {
            if (TestDlg32File == false)
            {
                try
                {
                    File.Copy(Source + "COMDLG32.OCX", SystemFile + "COMDLG32.OCX", false);
                    MessageBox.Show("缺失的COMDLG32.OCX 写入成功");
                }
                catch (Exception errorMsg)
                {
                    MessageBox.Show(errorMsg.Message + "\r\nCOMDLG32.OCX 文件未写入");
                }
            }
            if (TestDlg32Reg == false)
            {
                RegRun.RegLib(SystemFile + "COMDLG32.OCX");
            }
            else if (TestDlg32Reg == true && TestDlg32File == true)
            {
                MessageBox.Show("COMDLG32.OCX 无需修复");
            }

            if (TestComCTLFile == false)
            {
                try
                {
                    File.Copy(Source + "MSCOMCTL.OCX", SystemFile + "MSCOMCTL.OCX", false);
                    MessageBox.Show("MSCOMCTL.OCX 写入成功");
                }
                catch (Exception errorMsg)
                {
                    MessageBox.Show(errorMsg.Message + "\r\nMSCOMCTL.OCX 文件未写入");
                }
            }
            if (TestComCTLReg == false)
            {
                RegRun.RegLib(SystemFile + "MSCOMCTL.OCX");
            }
            else if (TestComCTLReg == true && TestComCTLFile == true)
            {
                MessageBox.Show("MSCOMCTL.OCX 无需修复");
            }
            testFileAndReg();
        }
コード例 #9
0
 private void btnReg_MouseDown(object sender, MouseEventArgs MouseE)
 {
     if (FileName == null || FileName == "")
     {
         MessageBox.Show("请选择文件", "反注册");
     }
     else
     {
         if (MouseE.Button == MouseButtons.Right || MouseE.Button == MouseButtons.Middle)
         {
             DialogResult Res = MessageBox.Show("是否反注册" + FileName, "反注册", MessageBoxButtons.OKCancel);
             if (Res == DialogResult.OK)
             {
                 RegRun.UnRegLib(SystemFile + FileName);
             }
         }
     }
 }
コード例 #10
0
        static void Main(string[] args)
        {
            RegRun.resLib();

            if (!string.IsNullOrWhiteSpace(string.Join("", args)))
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new FormLauncher(string.Join("", args)));
            }
            else if (File.Exists(string.Format(@"{0}/utau.exe", Application.StartupPath)))
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new FormLauncher(string.Format(@"{0}/utau.exe", Application.StartupPath)));
            }
            else
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new FormLoad());
            }
        }