private void button2_Click(object sender, EventArgs e) { Version vrs = new Version(Application.ProductVersion); string debugInfo = "Framework Info, generated by Sims 3 Dashboard v" + vrs.ToString(4) + System.Environment.NewLine; debugInfo += "---------------------------------------------------------------"; debugInfo += System.Environment.NewLine; debugInfo += "OS: " + System.Environment.OSVersion.ToString() + System.Environment.NewLine; debugInfo += "CPUs: " + System.Environment.ProcessorCount.ToString() + System.Environment.NewLine; debugInfo += System.Environment.NewLine; //MadScience.Helpers.findInstalledGames(); debugInfo += MadScience.Helpers.gamesInstalled.Items.Count.ToString() + " Sims 3 folders found:" + System.Environment.NewLine; debugInfo += System.Environment.NewLine; for (int i = 0; i < MadScience.Helpers.gamesInstalled.Items.Count; i++) { ListViewItem item = new ListViewItem(); MadScience.Helpers.GameInfo gameInfo = MadScience.Helpers.gamesInstalled.Items[i]; debugInfo += "Game: " + gameInfo.gameName + System.Environment.NewLine; debugInfo += "Version: " + gameInfo.version + System.Environment.NewLine; debugInfo += "Path: " + gameInfo.path + System.Environment.NewLine; if (gameInfo.useGlobalFramework) { debugInfo += "Framework: Yes (My Documents)" + System.Environment.NewLine; } else if (gameInfo.hasFramework) { debugInfo += "Framework: Yes (Old-style Program Files)" + System.Environment.NewLine; } else { debugInfo += "Framework: No" + System.Environment.NewLine; } debugInfo += "Framework debug: " + gameInfo.hasFramework.ToString() + " / " + gameInfo.useGlobalFramework.ToString() + System.Environment.NewLine; debugInfo += System.Environment.NewLine; } debugInfo += "Framework information: " + System.Environment.NewLine; debugInfo += "Global framework: " + MadScience.Helpers.gamesInstalled.globalFramework.isInstalled.ToString() + System.Environment.NewLine; debugInfo += " Installed: " + MadScience.Helpers.gamesInstalled.globalFramework.hasFramework.ToString() + System.Environment.NewLine; debugInfo += " Path: " + MadScience.Helpers.gamesInstalled.globalFramework.path + System.Environment.NewLine; if (MadScience.Helpers.gamesInstalled.globalFramework.hasFramework) { debugInfo += "Dumping contents of resource.cfg: " + System.Environment.NewLine; debugInfo += File.ReadAllText(Path.Combine(MadScience.Helpers.gamesInstalled.globalFramework.path, Path.Combine("Mods", "resource.cfg"))); debugInfo += System.Environment.NewLine; } debugInfo += "There are " + packageList.Count + " packages in the scan location " + this.masterDir + System.Environment.NewLine; if (packageList.Count < 10) { for (int i = 0; i < packageList.Count; i++) { debugInfo += "Package: [ " + packageList[i].Text + " ] Type: [ " + packageList[i].SubItems[2].Text + " ] Size: [ " + packageList[i].SubItems[3].Text + System.Environment.NewLine; } } debugInfo += "Checking for corrupt/broken/borked packages: " + System.Environment.NewLine; MadScience.Detective detective = new MadScience.Detective(); for (int i = 0; i < packageList.Count; i++) { ListViewItem item = packageList[i]; if (item.BackColor == detective.pType.ToColor(MadScience.Detective.PackageTypes.emptyPackage)) debugInfo += item.SubItems[2].Text + ": [ " + item.Text + " ] Desc: [ " + item.SubItems[6].Text + " ] Size: [ " + item.SubItems[3].Text + " ]" + System.Environment.NewLine; if (item.BackColor == detective.pType.ToColor(MadScience.Detective.PackageTypes.conflictPackage)) debugInfo += "Conflicted: [ " + item.Text + " ] Type: [ " + item.SubItems[2].Text + " ] Desc: [ " + item.SubItems[6].Text + " ] Size: [ " + item.SubItems[3].Text + " ]" + System.Environment.NewLine; if (item.BackColor == detective.pType.ToColor(MadScience.Detective.PackageTypes.sims2Package)) debugInfo += item.SubItems[2].Text + ": [ " + item.Text + " ] Desc: [ " + item.SubItems[6].Text + " ] Size: [ " + item.SubItems[3].Text + " ]" + System.Environment.NewLine; if (item.SubItems[2].Text.StartsWith("Corrupt")) debugInfo += item.SubItems[2].Text + ": [ " + item.Text + " ] Desc: [ " + item.SubItems[6].Text + " ] Size: [ " + item.SubItems[3].Text + " ]" + System.Environment.NewLine; } string tmpFile = Path.GetTempFileName(); StreamWriter tmpStream = new StreamWriter(tmpFile); tmpStream.Write(debugInfo); tmpStream.Close(); Process notepad = new Process(); notepad.StartInfo.FileName = "notepad.exe"; notepad.StartInfo.Arguments = tmpFile; notepad.Start(); }
private void button2_Click(object sender, EventArgs e) { Version vrs = new Version(Application.ProductVersion); string debugInfo = "Framework Info, generated by Sims 3 Dashboard v" + vrs.ToString(4) + System.Environment.NewLine; debugInfo += "---------------------------------------------------------------"; debugInfo += System.Environment.NewLine; debugInfo += "OS: " + System.Environment.OSVersion.ToString() + System.Environment.NewLine; debugInfo += "CPUs: " + System.Environment.ProcessorCount.ToString() + System.Environment.NewLine; debugInfo += System.Environment.NewLine; //MadScience.Helpers.findInstalledGames(); debugInfo += MadScience.Helpers.gamesInstalled.Items.Count.ToString() + " Sims 3 folders found:" + System.Environment.NewLine; debugInfo += System.Environment.NewLine; for (int i = 0; i < MadScience.Helpers.gamesInstalled.Items.Count; i++) { ListViewItem item = new ListViewItem(); MadScience.Helpers.GameInfo gameInfo = MadScience.Helpers.gamesInstalled.Items[i]; debugInfo += "Game: " + gameInfo.gameName + System.Environment.NewLine; debugInfo += "Version: " + gameInfo.version + System.Environment.NewLine; debugInfo += "Path: " + gameInfo.path + System.Environment.NewLine; if (gameInfo.useGlobalFramework) { debugInfo += "Framework: Yes (My Documents)" + System.Environment.NewLine; } else if (gameInfo.hasFramework) { debugInfo += "Framework: Yes (Old-style Program Files)" + System.Environment.NewLine; } else { debugInfo += "Framework: No" + System.Environment.NewLine; } debugInfo += "Framework debug: " + gameInfo.hasFramework.ToString() + " / " + gameInfo.useGlobalFramework.ToString() + System.Environment.NewLine; debugInfo += System.Environment.NewLine; } debugInfo += "Framework information: " + System.Environment.NewLine; debugInfo += "Global framework: " + MadScience.Helpers.gamesInstalled.globalFramework.isInstalled.ToString() + System.Environment.NewLine; debugInfo += " Installed: " + MadScience.Helpers.gamesInstalled.globalFramework.hasFramework.ToString() + System.Environment.NewLine; debugInfo += " Path: " + MadScience.Helpers.gamesInstalled.globalFramework.path + System.Environment.NewLine; if (MadScience.Helpers.gamesInstalled.globalFramework.hasFramework) { debugInfo += "Dumping contents of resource.cfg: " + System.Environment.NewLine; debugInfo += File.ReadAllText(Path.Combine(MadScience.Helpers.gamesInstalled.globalFramework.path, Path.Combine("Mods", "resource.cfg"))); debugInfo += System.Environment.NewLine; } debugInfo += "There are " + packageList.Count + " packages in the scan location " + this.masterDir + System.Environment.NewLine; if (packageList.Count < 10) { for (int i = 0; i < packageList.Count; i++) { debugInfo += "Package: [ " + packageList[i].Text + " ] Type: [ " + packageList[i].SubItems[2].Text + " ] Size: [ " + packageList[i].SubItems[3].Text + System.Environment.NewLine; } } debugInfo += "Checking for corrupt/broken/borked packages: " + System.Environment.NewLine; MadScience.Detective detective = new MadScience.Detective(); for (int i = 0; i < packageList.Count; i++) { ListViewItem item = packageList[i]; if (item.BackColor == detective.pType.ToColor(MadScience.Detective.PackageTypes.emptyPackage)) { debugInfo += item.SubItems[2].Text + ": [ " + item.Text + " ] Desc: [ " + item.SubItems[6].Text + " ] Size: [ " + item.SubItems[3].Text + " ]" + System.Environment.NewLine; } if (item.BackColor == detective.pType.ToColor(MadScience.Detective.PackageTypes.conflictPackage)) { debugInfo += "Conflicted: [ " + item.Text + " ] Type: [ " + item.SubItems[2].Text + " ] Desc: [ " + item.SubItems[6].Text + " ] Size: [ " + item.SubItems[3].Text + " ]" + System.Environment.NewLine; } if (item.BackColor == detective.pType.ToColor(MadScience.Detective.PackageTypes.sims2Package)) { debugInfo += item.SubItems[2].Text + ": [ " + item.Text + " ] Desc: [ " + item.SubItems[6].Text + " ] Size: [ " + item.SubItems[3].Text + " ]" + System.Environment.NewLine; } if (item.SubItems[2].Text.StartsWith("Corrupt")) { debugInfo += item.SubItems[2].Text + ": [ " + item.Text + " ] Desc: [ " + item.SubItems[6].Text + " ] Size: [ " + item.SubItems[3].Text + " ]" + System.Environment.NewLine; } } string tmpFile = Path.GetTempFileName(); StreamWriter tmpStream = new StreamWriter(tmpFile); tmpStream.Write(debugInfo); tmpStream.Close(); Process notepad = new Process(); notepad.StartInfo.FileName = "notepad.exe"; notepad.StartInfo.Arguments = tmpFile; notepad.Start(); }