Ejemplo n.º 1
0
        private void UpdateResolution(string profileDir)
        {
            string configfile = profileDir + "\\Documents\\Zwift\\prefs.xml";

            ConfigFix configFix = new ConfigFix(configfile);

            configFix.DisableFullScreen();
            configFix.UpdateResolution(ConfigSettings.Resolution);
        }
Ejemplo n.º 2
0
        private bool PreCheck()
        {
            string exefile = ConfigSettings.ZwiftLocation + "\\ZwiftApp.exe";

            if (!System.IO.File.Exists(exefile))
            {
                AddWarningMessage(@"ZwiftApp File is missing " + exefile, @"Error file missing");
                return(false);
            }


            for (int i = 1; i < ConfigSettings.Number + 1; i++)
            {
                string newDir = ConfigSettings.UserFolder + "\\zwift" + i.ToString("0#") + "\\Documents\\Zwift";

                if (!System.IO.Directory.Exists(newDir))
                {
                    DialogResult result = MessageBox.Show(newDir + @" is missing, create it?", @"Directory missing", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
                    if (result == DialogResult.OK)
                    {
                        try
                        {
                            FileTools.CopyToVirtualUSer(newDir);
                            //change perf.xml

                            ConfigFix configFix = new ConfigFix(newDir + "\\prefs.xml");
                            configFix.DisableFullScreen();
                            configFix.UpdateResolution(ConfigSettings.Resolution);
                        }
                        catch (Exception exception)
                        {
                            AddWarningMessage(@"Error " + exception.Message, @"Error updating files");
                            return(false);
                        }
                    }
                    else
                    {
                        return(false);
                    }
                }
            }



            return(true);
        }