void BtnDatabaseClick(object sender, EventArgs e)
        {
            var dir = textDatabase.Text;

            if (!OpenBveLocalRegistry.IsPathValid(dir))
            {
                dir = "";
            }
            else
            {
                while (!Directory.Exists(dir))
                {
                    dir = dir == Path.GetDirectoryName(dir) ? "" : Path.GetDirectoryName(dir);
                }
            }
            var ofd = new OpenFileDialog()
            {
                Filter           = "Packages.xml|packages.xml",
                InitialDirectory = dir
            };

            if (ofd.ShowDialog() == DialogResult.OK)
            {
                textDatabase.Text = Path.GetDirectoryName(ofd.FileName);
            }
        }
        void BrowseBtnClick(object sender, EventArgs e)
        {
            var target = grpInsDir.Controls[(sender as Button).Name.Replace("btn", "text")] as TextBox;
            var fbd    = new OpenBve.FolderSelectDialog();
            var dir    = target.Text;

            if (!OpenBveLocalRegistry.IsPathValid(dir))
            {
                dir = "";
            }
            else
            {
                while (!Directory.Exists(dir))
                {
                    dir = dir == Path.GetDirectoryName(dir) ? "" : Path.GetDirectoryName(dir);
                }
            }
            fbd.InitialDirectory = dir;
            if (fbd.Show())
            {
                target.Text = fbd.FileName;
            }
        }