Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions ProjectSrc/App.config

This file was deleted.

4 changes: 2 additions & 2 deletions ProjectSrc/Bootstrapper/FileManifest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private FileManifest(string data, bool remapExtraContent = false)

if (eof)
break;
else if (remapExtraContent && path.StartsWith("ExtraContent", Program.StringFormat))
else if (remapExtraContent && path.StartsWith("ExtraContent", App.StringFormat))
path = path.Replace("ExtraContent", "content");

// ~~ AWFUL TEMPORARY HACK. ~~
Expand Down Expand Up @@ -66,7 +66,7 @@ public static async Task<FileManifest> Get(ClientVersionInfo info, bool remapExt
{
string versionGuid = info.VersionGuid;

string fileManifestUrl = $"{Program.BaseUrl}/channel/common/{versionGuid}-rbxManifest.txt";
string fileManifestUrl = $"{App.BaseUrl}/channel/common/{versionGuid}-rbxManifest.txt";
string fileManifestData;

using (WebClient http = new WebClient())
Expand Down
2 changes: 1 addition & 1 deletion ProjectSrc/Bootstrapper/PackageManifest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private PackageManifest(string data)
public static async Task<PackageManifest> Get(ClientVersionInfo info)
{
string versionGuid = info.VersionGuid;
string pkgManifestUrl = $"{Program.BaseUrl}/channel/common/{versionGuid}-rbxPkgManifest.txt";
string pkgManifestUrl = $"{App.BaseUrl}/channel/common/{versionGuid}-rbxPkgManifest.txt";
string pkgManifestData;

using (WebClient http = new WebClient())
Expand Down
77 changes: 37 additions & 40 deletions ProjectSrc/Bootstrapper/StudioBootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using System.Net;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Windows.Forms;

using Newtonsoft.Json;
using RobloxDeployHistory;
Expand All @@ -17,6 +16,7 @@
namespace RobloxStudioModManager
{
public delegate void MessageFeed(string message);
public delegate Task<bool> ConfirmPrompt(string message, string title);

public class StudioBootstrapper
{
Expand All @@ -32,6 +32,7 @@ public class StudioBootstrapper

public event MessageFeed EchoFeed;
public event MessageFeed StatusFeed;
public event ConfirmPrompt ConfirmFeed;

private readonly IBootstrapperState mainState;
private readonly VersionManifest versionData;
Expand All @@ -51,7 +52,7 @@ public class StudioBootstrapper

public int Progress = 0;
public int MaxProgress = 0;
public ProgressBarStyle ProgressBarStyle = ProgressBarStyle.Continuous;
public BootstrapProgressStyle ProgressBarStyle = BootstrapProgressStyle.Determinate;

public object ProgressLock = new object();

Expand All @@ -68,7 +69,7 @@ public class StudioBootstrapper

public StudioBootstrapper(IBootstrapperState state = null)
{
mainState = state ?? Program.State;
mainState = state ?? App.State;
versionData = mainState.VersionData;
channelData = mainState.ChannelData;
fileRegistry = mainState.FileManifest;
Expand Down Expand Up @@ -108,7 +109,7 @@ private static string computeSignature(Stream source)
string result = BitConverter
.ToString(hash)
.Replace("-", "")
.ToLower(Program.Format);
.ToLower(App.Format);

return result;
}
Expand Down Expand Up @@ -234,7 +235,7 @@ private void deleteUnusedFiles()

if (!fileManifest.ContainsKey(fileName))
foreach (string pkgName in BadManifests)
if (fileName.StartsWith(pkgName, Program.StringFormat))
if (fileName.StartsWith(pkgName, App.StringFormat))
lookupKey = fileName.Substring(pkgName.Length + 1);

if (!fileManifest.ContainsKey(lookupKey))
Expand Down Expand Up @@ -275,10 +276,10 @@ private void deleteUnusedFiles()
public static async Task<ClientVersionInfo> GetTargetVersionInfo(string targetVersion = "", VersionManifest versionData = null, ChannelManifest channelData = null)
{
if (versionData == null)
versionData = Program.State.VersionData;
versionData = App.State.VersionData;

if (channelData == null)
channelData = Program.State.ChannelData;
channelData = App.State.ChannelData;

var logData = await StudioDeployLogs.Get();
HashSet<DeployLog> targets = logData.CurrentLogs;
Expand All @@ -299,18 +300,18 @@ public static async Task<ClientVersionInfo> GetTargetVersionInfo(string targetVe
public static async Task<ClientVersionInfo> GetCurrentVersionInfo(string targetVersion = "", VersionManifest versionData = null, ChannelManifest channelData = null)
{
if (versionData == null)
versionData = Program.State.VersionData;
versionData = App.State.VersionData;

if (channelData == null)
channelData = Program.State.ChannelData;
channelData = App.State.ChannelData;

if (!string.IsNullOrEmpty(targetVersion))
{
var result = GetTargetVersionInfo(targetVersion, versionData);
return await result.ConfigureAwait(false);
}

var logData = await StudioDeployLogs.Get(Program.AllowUnsupportedVersions, channelData.ChannelName, channelData.ChannelToken);
var logData = await StudioDeployLogs.Get(App.AllowUnsupportedVersions, channelData.ChannelName, channelData.ChannelToken);
var build = logData.CurrentLogs.LastOrDefault();
var info = new ClientVersionInfo(build);

Expand All @@ -325,7 +326,7 @@ private string fixFilePath(string pkgName, string filePath)
string pkgDir = pkgName.Replace(".zip", "");

if (BadManifests.Contains(pkgDir))
if (!filePath.StartsWith(pkgDir, Program.StringFormat))
if (!filePath.StartsWith(pkgDir, App.StringFormat))
filePath = pkgDir + '\\' + filePath;

if (RemapExtraContent)
Expand Down Expand Up @@ -361,7 +362,7 @@ private async Task<bool> packageExists(Package package)
echo($"Verifying availability of: {package.Name}");

string pkgName = package.Name;
var zipFileUrl = new Uri($"{Program.BaseUrl}/channel/common/{buildVersion}-{pkgName}");
var zipFileUrl = new Uri($"{App.BaseUrl}/channel/common/{buildVersion}-{pkgName}");

var request = WebRequest.Create(zipFileUrl) as HttpWebRequest;
request.Headers.Set("UserAgent", UserAgent);
Expand All @@ -382,7 +383,7 @@ private async Task<byte[]> installPackage(Package package)
{
byte[] result = null;
string pkgName = package.Name;
string zipFileUrl = $"{Program.BaseUrl}/channel/common/{buildVersion}-{pkgName}";
string zipFileUrl = $"{App.BaseUrl}/channel/common/{buildVersion}-{pkgName}";

using (var localHttp = new WebClient())
{
Expand Down Expand Up @@ -452,7 +453,7 @@ private void extractPackage(Package package)

int numFiles = archive.Entries
.Select(entry => entry.FullName)
.Where(name => !name.EndsWith("/", Program.StringFormat))
.Where(name => !name.EndsWith("/", App.StringFormat))
.Count();

string localRootDir = null;
Expand All @@ -468,10 +469,10 @@ private void extractPackage(Package package)
if (entry.Length == 0)
skip = true;

if (entry.Name.EndsWith(".robloxrc", Program.StringFormat))
if (entry.Name.EndsWith(".robloxrc", App.StringFormat))
skip = true;

if (entry.Name.EndsWith(".luarc", Program.StringFormat))
if (entry.Name.EndsWith(".luarc", App.StringFormat))
skip = true;

if (skip)
Expand Down Expand Up @@ -512,7 +513,7 @@ private void extractPackage(Package package)
}
else
{
var query = fileManifest.SkipWhile(pair => !pair.Key.EndsWith(entryPath, Program.StringFormat)).Take(1);
var query = fileManifest.SkipWhile(pair => !pair.Key.EndsWith(entryPath, App.StringFormat)).Take(1);
newFileSig = query.Any() ? query.First().Value : null;
}
}
Expand All @@ -539,7 +540,7 @@ private void extractPackage(Package package)
if (filePath != file)
appendNewManifestEntry(filePath, newFileSig);

if (filePath.EndsWith(entryPath, Program.StringFormat))
if (filePath.EndsWith(entryPath, App.StringFormat))
{
// We can infer what the root extraction
// directory is for the files in this package!
Expand Down Expand Up @@ -646,25 +647,21 @@ private async Task<bool> shutdownStudioProcesses()

if (initialRunning.Count > 0)
{
DialogResult result = DialogResult.OK;
bool proceed = true;

if (mainState == Program.State)
if (mainState == App.State)
{
result = MessageBox.Show
proceed = ConfirmFeed == null || await ConfirmFeed.Invoke
(
"All Roblox Studio processes need to be closed in order to update Roblox Studio!\n" +
"Press Ok once you've saved your work, or\n" +
"Press Cancel to skip this update temporarily.",

"Notice",
MessageBoxButtons.OKCancel,
MessageBoxIcon.Warning,
MessageBoxDefaultButton.Button1,
MessageBoxOptions.DefaultDesktopOnly
);
"Notice"
).ConfigureAwait(true);
}

if (result == DialogResult.Cancel)
if (!proceed)
{
safeToContinue = true;
cancelled = true;
Expand Down Expand Up @@ -707,7 +704,7 @@ private async Task<bool> shutdownStudioProcesses()

Progress = 0;
MaxProgress = retries * granularity;
ProgressBarStyle = ProgressBarStyle.Continuous;
ProgressBarStyle = BootstrapProgressStyle.Determinate;

for (int i = 0; i < retries; i++)
{
Expand Down Expand Up @@ -775,7 +772,7 @@ public async Task<bool> Bootstrap(string targetVersion = "")
using (var http = new WebClient())
{
var json = await http
.DownloadStringTaskAsync(Program.BaseConfigUrl + "KnownRoots.json")
.DownloadStringTaskAsync(App.BaseConfigUrl + "KnownRoots.json")
.ConfigureAwait(false);

var knownRoots = JsonConvert.DeserializeObject<Dictionary<string, KnownRoot>>(json);
Expand Down Expand Up @@ -826,7 +823,7 @@ public async Task<bool> Bootstrap(string targetVersion = "")

Progress = 0;
MaxProgress = 0;
ProgressBarStyle = ProgressBarStyle.Continuous;
ProgressBarStyle = BootstrapProgressStyle.Determinate;

// Verify all of these packages are available to install.
foreach (Package package in pkgManifest)
Expand Down Expand Up @@ -864,7 +861,7 @@ await Task

Progress = 1;
MaxProgress = 1;
ProgressBarStyle = ProgressBarStyle.Marquee;
ProgressBarStyle = BootstrapProgressStyle.Indeterminate;

var timeout = Task.Delay(2000);
await timeout.ConfigureAwait(false);
Expand Down Expand Up @@ -974,11 +971,11 @@ await Task
versionData.VersionGuid = buildVersion;
versionData.VersionOverload = targetVersion;

ProgressBarStyle = ProgressBarStyle.Marquee;
ProgressBarStyle = BootstrapProgressStyle.Indeterminate;
}
else
{
ProgressBarStyle = ProgressBarStyle.Marquee;
ProgressBarStyle = BootstrapProgressStyle.Indeterminate;
echo("Update cancelled. Launching on current version.");
}
}
Expand All @@ -989,8 +986,8 @@ await Task

using (var http = new WebClient())
{
OAuth2Config_JSON = await http.DownloadStringTaskAsync(Program.BaseConfigUrl + "OAuth2Config.json");
AppSettings_XML = await http.DownloadStringTaskAsync(Program.BaseConfigUrl + "AppSettings.xml");
OAuth2Config_JSON = await http.DownloadStringTaskAsync(App.BaseConfigUrl + "OAuth2Config.json");
AppSettings_XML = await http.DownloadStringTaskAsync(App.BaseConfigUrl + "AppSettings.xml");
}

string appSettings = Path.Combine(studioDir, "AppSettings.xml");
Expand All @@ -1006,19 +1003,19 @@ await Task
// Only update the registry protocols if the main registry
// is the global one assigned to the program itself.

if (mainState == Program.State)
if (mainState == App.State)
{
setStatus("Configuring Roblox Studio...");
echo("Updating registry protocols...");

var studioPath = GetLocalStudioPath();
Program.UpdateStudioRegistryProtocols(studioPath);
App.UpdateStudioRegistryProtocols(studioPath);
}

if (ApplyModManagerPatches && string.IsNullOrEmpty(OverrideStudioDirectory))
{
echo("Applying flag configuration...");
FlagEditor.ApplyFlags();
FlagManager.ApplyFlags();

// Secret feature only for me :(
// Feel free to patch in your own thing if you want.
Expand All @@ -1029,7 +1026,7 @@ await Task
#endif
}

ProgressBarStyle = ProgressBarStyle.Marquee;
ProgressBarStyle = BootstrapProgressStyle.Indeterminate;
MaxProgress = 1;
Progress = 1;

Expand Down
5 changes: 0 additions & 5 deletions ProjectSrc/FodyWeavers.xml

This file was deleted.

Loading