Exemple #1
0
        private void accept_Click(object sender, EventArgs e)
        {
            Agreement  am = (Agreement)this.stepPanel.Controls[0];
            InstallDir id = new InstallDir();

            id.install.Click += new EventHandler(install_Click);
            id.custom.Click  += new EventHandler(custom_Click);
            dir = RegistryHelper.FindPrevioudInstallDir(Settings.appKey /*"{485D8730-5233-4F7F-832C-84D142B5C1FA}"*/, Environment.Is64BitOperatingSystem);
            if (string.IsNullOrEmpty(dir))
            {
                dir = RegistryHelper.GetDefaultProgramDir(Environment.Is64BitOperatingSystem);
                dir = Path.Combine(Path.Combine(dir, Settings.company), Settings.appName);
            }
            if (string.IsNullOrEmpty(dir))
            {
                dir = @"C:\Program files\";
                dir = Path.Combine(Path.Combine(dir, Settings.company), Settings.appName);
            }
            //dir += @"ZJSoft\ZLPlayer\";

            if (!dir.EndsWith("\\"))
            {
                dir += "\\";
            }
            id.dir.Text = dir;

            this.stepPanel.Controls.RemoveAt(0);
            this.stepPanel.Controls.Add(id);
            am.accept.Click -= new EventHandler(accept_Click);
            am.cancel.Click -= new EventHandler(cancel_Click);
            am.Dispose();
        }
Exemple #2
0
        private void custom_Click(object sender, EventArgs e)
        {
            custom = true;
            InstallDir id = (InstallDir)this.stepPanel.Controls[0];

            id.install.Click -= new EventHandler(install_Click);
            id.custom.Click  -= new EventHandler(custom_Click);
            Options op = new Options();

            //op.status.PControl = op;
            op.install.Click += new EventHandler(install_Click);
            op.dir.Text       = dir;
            string    drivePath = dir.Substring(0, 3);
            DriveInfo info      = new DriveInfo(drivePath);

            op.disk.Text     = "Required disk space:" + GetSizeInfo(tsize) + "(Available space:" + GetSizeInfo(info.AvailableFreeSpace) + ")";
            op.folder.Click += new EventHandler(folder_Click);
            op.flac.Checked  = RegistryHelper.IsFileAss(".flac", "ZLP.FLAC");
            op.m4a.Checked   = RegistryHelper.IsFileAss(".m4a", "ZLP.M4A");
            op.mp3.Checked   = RegistryHelper.IsFileAss(".mp3", "ZLP.MP3");
            op.cue.Checked   = RegistryHelper.IsFileAss(".cue", "ZLP.CUE");
            op.aac.Checked   = RegistryHelper.IsFileAss(".aac", "ZLP.aac");
            op.tta.Checked   = RegistryHelper.IsFileAss(".tta", "ZLP.TTA");
            op.ofr.Checked   = RegistryHelper.IsFileAss(".ofr", "ZLP.OFR");
            op.tak.Checked   = RegistryHelper.IsFileAss(".tak", "ZLP.TAK");
            op.wav.Checked   = RegistryHelper.IsFileAss(".wav", "ZLP.WAV");
            op.wv.Checked    = RegistryHelper.IsFileAss(".wv", "ZLP.WV");
            op.ogg.Checked   = RegistryHelper.IsFileAss(".ogg", "ZLP.OGG");
            op.ape.Checked   = RegistryHelper.IsFileAss(".ape", "ZLP.APE");
            this.stepPanel.Controls.RemoveAt(0);
            this.stepPanel.Controls.Add(op);
            id.Dispose();
        }
Exemple #3
0
        private void install_Click(object sender, EventArgs e)
        {
            //
            UserControl uc;

            if (!custom)
            {
                InstallDir id = (InstallDir)this.stepPanel.Controls[0];
                id.install.Click -= new EventHandler(install_Click);
                id.custom.Click  -= new EventHandler(custom_Click);
                uc = id;
            }
            else
            {
                Options op = (Options)this.stepPanel.Controls[0];
                op.install.Click -= new EventHandler(install_Click);
                uc  = op;
                dir = op.dir.Text;
                Settings.createDesktopshortcut = op.desktop.Checked;
                Settings.createTaskbar         = op.taskbar.Checked;
                Settings.createStartMenu       = op.startMenu.Checked;

                string regist   = "/reg";
                string unregist = "";
                if (op.flac.Checked)
                {
                    regist += "flac|";
                }
                else
                {
                    unregist += "flac,";
                }
                if (op.aac.Checked)
                {
                    regist += "aac|";
                }
                else
                {
                    unregist += "aac,";
                }
                if (op.ape.Checked)
                {
                    regist += "ape|";
                }
                else
                {
                    unregist += "ape,";
                }
                if (op.cue.Checked)
                {
                    regist += "cue|";
                }
                else
                {
                    unregist += "cue,";
                }
                if (op.m4a.Checked)
                {
                    regist += "m4a|";
                }
                else
                {
                    unregist += "m4a,";
                }
                if (op.mp3.Checked)
                {
                    regist += "mp3|";
                }
                else
                {
                    unregist += "mp3,";
                }
                if (op.ofr.Checked)
                {
                    regist += "ofr|";
                }
                else
                {
                    unregist += "ofr,";
                }
                if (op.ogg.Checked)
                {
                    regist += "ogg|";
                }
                else
                {
                    unregist += "ogg,";
                }
                if (op.tak.Checked)
                {
                    regist += "tak|";
                }
                else
                {
                    unregist += "tak,";
                }
                if (op.tta.Checked)
                {
                    regist += "tta|";
                }
                else
                {
                    unregist += "tta,";
                }
                if (op.wav.Checked)
                {
                    regist += "wav|";
                }
                else
                {
                    unregist += "wav,";
                }
                if (op.wv.Checked)
                {
                    regist += "wv|";
                }
                else
                {
                    unregist += "wv,";
                }
                Settings.fileAss = regist + unregist;
            }

            bool  canCreateNew;
            Mutex m = new Mutex(true, Settings.mutexName, out canCreateNew);

            if (!canCreateNew)
            {
                CloseApp ca = new CloseApp();
                ca.richTextBox1.AppendText("ZLPlayer.exe");
                ca.continueBtn.Click += new EventHandler(continueBtn_Click);
                this.stepPanel.Controls.RemoveAt(0);
                this.stepPanel.Controls.Add(ca);
                uc.Dispose();

                return;
            }
            m.ReleaseMutex();
            Installing iti = new Installing();

            this.stepPanel.Controls.RemoveAt(0);
            this.stepPanel.Controls.Add(iti);
            uc.Dispose();
            this.inStatus = InstallStatue.ZJInstalling;
            backgroundWorker2.RunWorkerAsync();
        }
Exemple #4
0
        private void accept_Click(object sender, EventArgs e)
        {
            Agreement am = (Agreement)this.stepPanel.Controls[0];
            InstallDir id = new InstallDir();
            id.install.Click += new EventHandler(install_Click);
            id.custom.Click += new EventHandler(custom_Click);
            dir = RegistryHelper.FindPrevioudInstallDir(Settings.appKey/*"{485D8730-5233-4F7F-832C-84D142B5C1FA}"*/, Environment.Is64BitOperatingSystem);
            if (string.IsNullOrEmpty(dir))
            {
                dir = RegistryHelper.GetDefaultProgramDir(Environment.Is64BitOperatingSystem);
                dir = Path.Combine(Path.Combine(dir, Settings.company), Settings.appName);
            }
            if (string.IsNullOrEmpty(dir))
            {
                dir = @"C:\Program files\";
                dir = Path.Combine(Path.Combine(dir, Settings.company), Settings.appName);
            }
            //dir += @"ZJSoft\ZLPlayer\";

            if (!dir.EndsWith("\\"))
                dir += "\\";
            id.dir.Text = dir;

            this.stepPanel.Controls.RemoveAt(0);
            this.stepPanel.Controls.Add(id);
            am.accept.Click -= new EventHandler(accept_Click);
            am.cancel.Click -= new EventHandler(cancel_Click);
            am.Dispose();
        }