public static FirstParameters CreateDefaultFirstParameters(string directoryToCurrentPluginInfo) { FirstParameters fp = new FirstParameters(); RegistryKey rk = Registry.CurrentUser.OpenSubKey("Software").OpenSubKey("Microsoft").OpenSubKey("Windows").OpenSubKey("CurrentVersion").OpenSubKey("Explorer").OpenSubKey("Shell folders"); fp.pathToViewParameters = rk.GetValue("AppData").ToString() + @"\WinBalans\"; fp.pathToCurrentPluginInfo = directoryToCurrentPluginInfo + "CyverAss.ini"; fp.firstTimeStarted = 0; return(fp); }
public General() { redr = false; pluginlist = new ArrayList(); tp = new TempParameters(); if ((FirstParameters.Load(tp.basedirectory)) != null) { fp = FirstParameters.Load(tp.basedirectory); } else { fp = FirstParameters.CreateDefaultFirstParameters(this.tp.basedirectory); } if (fp.firstTimeStarted == 1) { fp = FirstParameters.CreateDefaultFirstParameters(this.tp.basedirectory); pm = ViewParameters.CreateDefaultViewParameters(); pi = PluginInfo.CreateDefaultPluginInfo(); } else { try { pm = ViewParameters.Load(fp.pathToViewParameters); } catch (Exception e) { MessageBox.Show(e.Message, "Ошибка!", MessageBoxButtons.OK, MessageBoxIcon.Error); Application.Exit(); } try { pi = PluginInfo.Load(fp.pathToCurrentPluginInfo); } catch (Exception e) { MessageBox.Show(e.Message, "Ошибка!", MessageBoxButtons.OK, MessageBoxIcon.Error); Application.Exit(); } } Update_curas(); InitializeComponent(); }