diff --git a/RobloxLegacy/Installer.cs b/RobloxLegacy/Installer.cs index d10dbae..38776b8 100644 --- a/RobloxLegacy/Installer.cs +++ b/RobloxLegacy/Installer.cs @@ -32,11 +32,11 @@ public class Installer public static void DeployBootstrapper() { var bootstrapperPath = Process.GetCurrentProcess()?.MainModule?.FileName ?? throw new Exception("Could not find bootstrapper"); - var installPath = Path.Combine(InstallPath, "RobloxLegacy.exe"); - if(bootstrapperPath == installPath) // already installed + var newExePath = Path.Combine(InstallPath, "RobloxLegacy.exe"); + if(bootstrapperPath == newExePath) // already installed return; Directory.CreateDirectory(InstallPath); - File.Copy(bootstrapperPath, installPath, true); - SetShortcuts(installPath); + File.Copy(bootstrapperPath, newExePath, true); + SetShortcuts(newExePath); } } \ No newline at end of file diff --git a/RobloxLegacy/Resources/AppSettings.xml b/RobloxLegacy/Resources/AppSettings.xml new file mode 100644 index 0000000..1b4f10e --- /dev/null +++ b/RobloxLegacy/Resources/AppSettings.xml @@ -0,0 +1,5 @@ + + + content + http://www.roblox.com + diff --git a/RobloxLegacy/icon.ico b/RobloxLegacy/Resources/icon.ico similarity index 100% rename from RobloxLegacy/icon.ico rename to RobloxLegacy/Resources/icon.ico diff --git a/RobloxLegacy/RobloxLegacy.csproj b/RobloxLegacy/RobloxLegacy.csproj index 18ab570..3e979d6 100644 --- a/RobloxLegacy/RobloxLegacy.csproj +++ b/RobloxLegacy/RobloxLegacy.csproj @@ -6,7 +6,7 @@ enable enable RandomServer - icon.ico + Resources\icon.ico @@ -20,8 +20,10 @@ - lptch.dll + Resources\lptch.dll + + diff --git a/RobloxLegacy/Utilities/Resource.cs b/RobloxLegacy/Utilities/Resource.cs index d1c04c4..2ec2890 100644 --- a/RobloxLegacy/Utilities/Resource.cs +++ b/RobloxLegacy/Utilities/Resource.cs @@ -7,7 +7,7 @@ public class Resource(string name) private Stream? GetStream() { var assembly = Assembly.GetExecutingAssembly(); - return assembly.GetManifestResourceStream(name); + return assembly.GetManifestResourceStream($"RobloxLegacy.Resources.{name}"); } public byte[]? GetBytes() diff --git a/RobloxLegacy/VersionManager.cs b/RobloxLegacy/VersionManager.cs index a969386..d64a14d 100644 --- a/RobloxLegacy/VersionManager.cs +++ b/RobloxLegacy/VersionManager.cs @@ -55,6 +55,14 @@ public class VersionManager : IDisposable fastZip.ExtractZip(tempFile, extractPath, null); } + private void WriteAppSettings() + { + var appSettings = new Resource($"AppSettings.xml").GetBytes(); + if (appSettings == null) + throw new Exception("Failed to get AppSettings resource"); + File.WriteAllBytesAsync(Path.Combine(GetVersionPath(_currentVersion), "AppSettings.xml"), appSettings); + } + private void PatchStudio() { Logger.Info("Patching application..."); @@ -64,7 +72,7 @@ public class VersionManager : IDisposable Patcher.RenameImports(exePath, ["KERNEL32.dll", "MFPlat.DLL"], DllName); // now we can write the dll to the folder - var dllContents = new Resource($"RobloxLegacy.{DllName}").GetBytes(); + var dllContents = new Resource(DllName).GetBytes(); if (dllContents == null) throw new Exception("Failed to get dll resource"); File.WriteAllBytesAsync(Path.Combine(GetVersionPath(_currentVersion), DllName), dllContents); @@ -99,6 +107,7 @@ public class VersionManager : IDisposable } _currentVersion = version.UploadHash; + WriteAppSettings(); Registry.SaveVersion(_appData.PackageName, version.UploadHash); // need to patch the executable