Ejemplo n.º 1
0
        private static void CreateFolders()
        {
            var atsw = new Fs17RegWork(true);

            var ofd = new FolderBrowserDialog {
                Description         = @"Navigate to where you want the top folder for FS17",
                ShowNewFolderButton = false
            };

            ofd.ShowDialog();
            if (!ofd.SelectedPath.FolderExists())
            {
                return;
            }
            var pth = ofd.SelectedPath;

            FolderCreator.CreatePublicFolders(pth + "\\FS17Repo");
            atsw.Write(Fs17RegKeys.FS17_REPO, pth + "\\FS17Repo\\");
            var tmp = pth + "\\FS17Repo\\";

            FolderCreator.CreatePublicFolders(tmp + "FS17Extraction");
            atsw.Write(Fs17RegKeys.FS17_EXTRACTION, tmp + "FS17Extraction");
            FolderCreator.CreatePublicFolders(tmp + "FS17Profiles");
            atsw.Write(Fs17RegKeys.FS17_PROFILES, tmp + "Fs17Profiles\\");
            FolderCreator.CreatePublicFolders(tmp + "FS17Groups");
            atsw.Write(Fs17RegKeys.FS17_GROUPS, tmp + "FS17Groups\\");
            FolderCreator.CreatePublicFolders(tmp + "FS17Xml");
            atsw.Write(Fs17RegKeys.FS17_XML, tmp + "FS17Xml\\");
            FolderCreator.CreatePublicFolders(tmp + "FS17Work");
            atsw.Write(Fs17RegKeys.FS17_WORK, tmp + "FS17Work\\");

            ofd = new FolderBrowserDialog {
                Description         = @"Navigate to Farming Simulator 2017 Mod Folder",
                ShowNewFolderButton = false
            };
            ofd.ShowDialog();
            if (ofd.SelectedPath.FolderExists())
            {
                atsw.Write(Fs17RegKeys.FS17_GAME_MOD_FOLDER, ofd.SelectedPath + "\\");
                var t   = ofd.SelectedPath.LastIndexOf("\\", StringComparison.OrdinalIgnoreCase);
                var fix = ofd.SelectedPath.Substring(0, t) + "\\";
                atsw.Write(Fs17RegKeys.FS17_GAME_SETTINGS_XML, fix + "gameSettings.xml");
            }

            MsgBx.Msg("All folders have been created for FS17", "Game Intializer");
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Starts the FS17.
        /// </summary>
        public void StartFs17()
        {
            var fs17 = new Fs17RegWork(true);
            var gam  = fs17.Read(Fs17RegKeys.FS17_START_GAME_PATH);

            if (gam.IsNullOrEmpty())
            {
                var ofd = new OpenFileDialog {
                    CheckFileExists = true,
                    Title           = @"Navigate to the Farming Simulator 2017 Exe"
                };

                ofd.ShowDialog();
                gam = ofd.FileName;
                fs17.Write(Fs17RegKeys.FS17_START_GAME_PATH, ofd.FileName);
            }

            Process.Start(gam);
        }