public AdvancedOptionsFrm(SettingsFile settings)
 {
     Settings = settings;
     InitializeComponent();
 }
Esempio n. 2
0
        public void CheckInstall()
        {
            if(!File.Exists(InstalledFile))
            {
                try
                {
                    MessageBox.Show(Resources.FirstTimeSetup, Resources.Title);

                    if (!Directory.Exists(InstallPath))
                        Directory.CreateDirectory(InstallPath);

                    if (!Directory.Exists(ScriptPath))
                        Directory.CreateDirectory(ScriptPath);

                    if (!Directory.Exists(ResourcePath))
                        Directory.CreateDirectory(ResourcePath);

                    File.Create(InstalledFile).Dispose();

                    SettingsFile s = new SettingsFile
                    {
                        BhoCreatedVersion = CurrentVersion(),
                        LastUpdateCheckDate = DateTime.Now
                    };

                    if (File.Exists(SettingsFile))
                        File.Delete(SettingsFile);

                    Db.WriteFile(SettingsFile, JsonConvert.SerializeObject(s));
                    MessageBox.Show(Resources.FirstTimeSetupDone, Resources.Title);
                }
                catch (Exception ex)
                {
                    if (LogAndCheckDebugger(ex, "Installer"))
                        throw;
                }
            }

            _prefs.LoadData();

            // Has BHO been updated? Settings file needs to be updated
            _prefs.CheckUpdateStatus();

            _installChecked = true;
        }