Beispiel #1
0
        } // начинает распаковку

        private void Extr_ExtractionFinishedFix(object sender, EventArgs e)
        {
            try
            {
                progressBar1.Value = 0;
                if (File.Exists(varPath.Launcherfolder + "launcher.ini"))
                {
                    IniRW fixInstallDone = new IniRW(varPath.Launcherfolder + "launcher.ini");
                    fixInstallDone.WritePrivateString("Build", "version", MergeValues.InstallVersionserver); // повтор, может потереть
                    fixInstallDone.WritePrivateString("Build", "update", MergeValues.UpdateVersionserver);   // записывает значения обновления
                    fixInstallDone.WritePrivateString("Install", "installed", "true");
                }
                else
                {
                    MessageBox.Show("При исправлении произошла ошибка");
                }

                //MergeValues.Checker();              // блок сравнения значений сервер/локал
                Merge();

                btn_UPDATE.Visible = false;
                btn_PLAY.Enabled   = true;
                File.Delete(varPath.Launcherfolder + "fix.7z");
            }
            catch (Exception error)
            {
                MessageBox.Show(error.ToString());
            }
        } // распаковка завершена
Beispiel #2
0
        } // начинает распаковку

        private void Extr_ExtractionFinishedInstall(object sender, EventArgs e)
        {
            try
            {
                progressBar1.Value = 0;
                if (!File.Exists(varPath.Launcherfolder + "launcher.ini"))
                {
                    File.Create(varPath.Launcherfolder + "launcher.ini");
                }
                IniRW installDone = new IniRW(varPath.Launcherfolder + "launcher.ini");
                installDone.WritePrivateString("Build", "version", MergeValues.InstallVersionserver);
                installDone.WritePrivateString("Install", "installed", "true");

                MergeValues.Checker(); // блок сравнения значений сервер/локал

                btn_PLAY.Enabled = true;
                File.Delete(varPath.Launcherfolder + "install.7z"); // удаляет архив с установщиком
                Merge();
                if (!MainValues.Updated)
                {
                    InstallFix();
                }
            }
            catch (Exception error)
            {
                MessageBox.Show(error.ToString());
            }
        } // распаковка завершена
        /// <summary>
        /// Sets the standard password.
        /// <remarks>
        /// Modifies the config .ini file of UltraVNC to set the new password. In order for the change
        /// to take effect, a restart is required. This restart might be initiated through the
        /// Restart method.
        /// </remarks>
        /// </summary>
        /// <param name="pwd">New password. Only the first 8 characters are actually used.</param>
        public void SetPassword(string pwd)
        {
            Trace.WriteLine("Trying to set VNC password... ");

            string enc_pwd = EncryptPassword(pwd);
            IniRW rw = new IniRW(UltraVNCPath + "\\ultravnc.ini");
            rw.WriteValue("ultravnc", "passwd", enc_pwd);

            Trace.WriteLine("done.");
        }