diff --git a/TimeHACK.Engine/SaveSystem.cs b/TimeHACK.Engine/SaveSystem.cs index f7dc954..5a90902 100644 --- a/TimeHACK.Engine/SaveSystem.cs +++ b/TimeHACK.Engine/SaveSystem.cs @@ -168,10 +168,10 @@ public static void CheckFiles() SaveDirectoryInfo(ProfileProgramsDirectory, "The Microsoft Network", true, "The Microsoft Network", true); SaveDirectoryInfo(ProfileMyComputerDirectory, "Windows", true, "Windows", true); - CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Accessories"), "wordpad.exe", "wordpad"); - CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Internet Explorer"), "ie20.exe", "ie"); - CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Internet Explorer"), "lnfinst.exe", "iebrokeninstaller"); - CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "The Microsoft Network"), "msnver.txt", "5900"); + CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Accessories"), "wordpad.exe", "wordpad", 16, 183296); + CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Internet Explorer"), "ie20.exe", "ie", 8, 512); + CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Internet Explorer"), "lnfinst.exe", "iebrokeninstaller", 8, 512); + CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "The Microsoft Network"), "msnver.txt", "5900", 12, 4); CreateWindowsDirectory(); } @@ -185,8 +185,7 @@ public static void CreateWindowsDirectory() SaveDirectoryInfo(ProfileWindowsDirectory, "Help", true, "Help", true); SaveDirectoryInfo(ProfileWindowsDirectory, "Temp", true, "Temp", true); SaveDirectoryInfo(ProfileWindowsDirectory, "Desktop", true, "Desktop", true); - - CreateWindowsFile(ProfileWindowsDirectory, "c", "", 8, 515); + CreateWindowsFile(ProfileWindowsDirectory, "calc.exe", "calc", 13, 59392); CreateWindowsFile(ProfileWindowsDirectory, "emm386.exe", "emm386", 10, 125495); CreateWindowsFile(ProfileWindowsDirectory, "explorer.exe", "explorer", 0, 204288); @@ -196,7 +195,7 @@ public static void CreateWindowsDirectory() CreateWindowsFile(ProfileWindowsDirectory, "write.exe", "wordpad", 16, 5120); } - public static void CreateWindowsFile(string filepath, string filename, string contents, int fileicon = 8, int bytes = 512) + public static void CreateWindowsFile(string filepath, string filename, string contents, int fileicon, int bytes) { File.WriteAllText(Path.Combine(filepath, filename), contents); THFileInfo info = new THFileInfo(); @@ -251,7 +250,7 @@ public static void UpgradeFileSystem(string oldOS, string newOS) // Add Address Book into existance! SaveDirectoryInfo(ProfileProgramsDirectory, "Outlook Express", false, "Outlook Express", true); - CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Outlook Express"), "WAB.exe", "addressbook"); + CreateWindowsFile(Path.Combine(ProfileProgramsDirectory, "Outlook Express"), "WAB.exe", "addressbook", 8, 512); // There is no "The Microsoft Network" folder! diff --git a/TimeHACK.Main/GlobalPrograms/WinClassicDownloader.cs b/TimeHACK.Main/GlobalPrograms/WinClassicDownloader.cs index 2df5ef2..2cea80b 100644 --- a/TimeHACK.Main/GlobalPrograms/WinClassicDownloader.cs +++ b/TimeHACK.Main/GlobalPrograms/WinClassicDownloader.cs @@ -38,10 +38,10 @@ private void dlTimer_Tick(object sender, EventArgs e) switch (appName.Text) { case "Downloading: FTP Client": - CreateWindowsFile(Path.Combine(ProfileWindowsDirectory, "Desktop"), "FTP Client Setup.exe", "ftp client setup", 11); + CreateWindowsFile(Path.Combine(ProfileWindowsDirectory, "Desktop"), "FTP Client Setup.exe", "ftp client setup", 11, 56291); break; case "Downloading: Web Chat 1998": - CreateWindowsFile(Path.Combine(ProfileWindowsDirectory, "Desktop"), "Web Chat Setup.exe", "web chat setup", 11); + CreateWindowsFile(Path.Combine(ProfileWindowsDirectory, "Desktop"), "Web Chat Setup.exe", "web chat setup", 11, 34846); break; } /* if (appName.Text == "Downloading: Guess The Number") diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.cs b/TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.cs index 3debce7..08cbf78 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/Win95WindowsExplorer.cs @@ -150,24 +150,24 @@ void RefreshAll() { itm = this.mainView.Items.Add(Path.GetFileName(str)); itm.Tag = str; } - else return; + else break; } - else return; - } else { + else break; + } + else { if (!(Path.GetFileName(str) == "_data.info")) { itm = this.mainView.Items.Add(Path.GetFileName(str)); itm.Tag = str; } - else return; + else break; } FileSystemFolderInfo fsfi = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(CurrentDirectory, "_data.info"))); - foreach(var item in fsfi.Files) + foreach (var item in fsfi.Files) { Debug.Print(item.Name + " " + Path.GetFileName(str)); - if (item.Name == Path.GetFileName(str)) { itm.ImageIndex = item.FileIcon; return; } + if (item.Name == Path.GetFileName(str)) { itm.ImageIndex = item.FileIcon; break; } } - itm.ImageIndex = 8; } } catch (Exception ex) { //wm.StartInfobox95("Exploring - C:", "Error with the file explorer \n" + ex.Message, Properties.Resources.Win95Info); add illegal operation dialog here later diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicNotepad.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicNotepad.cs index 3117d9c..581b789 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicNotepad.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/WinClassicNotepad.cs @@ -110,10 +110,13 @@ private void saveToolStripMenuItem_Click(object sender, EventArgs e) { ActivateSaveFileDialog(".txt"); string selectedPath = Program.OpenFileExplorerAsDialogAndReturnGivenPath(); + List pathList = selectedPath.Split('\\').ToList(); + pathList.RemoveAt(selectedPath.Split('\\').Count() - 1); if (selectedPath != "") { - File.WriteAllText(selectedPath, mainText.Text); + SaveSystem.CreateWindowsFile(pathList.ToString(), selectedPath.Split('\\').Last(), mainText.Text, 12, mainText.Text.Length); + //File.WriteAllText(selectedPath, mainText.Text); } } catch { }