-
Notifications
You must be signed in to change notification settings - Fork 418
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Abstract differences in handling player and studio
- Loading branch information
1 parent
765cccf
commit d15e910
Showing
6 changed files
with
174 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Bloxstrap.AppData | ||
{ | ||
public abstract class CommonAppData | ||
{ | ||
// in case a new package is added, you can find the corresponding directory | ||
// by opening the stock bootstrapper in a hex editor | ||
private IReadOnlyDictionary<string, string> _commonMap { get; } = new Dictionary<string, string>() | ||
{ | ||
{ "Libraries.zip", @"" }, | ||
{ "shaders.zip", @"shaders\" }, | ||
{ "ssl.zip", @"ssl\" }, | ||
|
||
// the runtime installer is only extracted if it needs installing | ||
{ "WebView2.zip", @"" }, | ||
{ "WebView2RuntimeInstaller.zip", @"WebView2RuntimeInstaller\" }, | ||
|
||
{ "content-avatar.zip", @"content\avatar\" }, | ||
{ "content-configs.zip", @"content\configs\" }, | ||
{ "content-fonts.zip", @"content\fonts\" }, | ||
{ "content-sky.zip", @"content\sky\" }, | ||
{ "content-sounds.zip", @"content\sounds\" }, | ||
{ "content-textures2.zip", @"content\textures\" }, | ||
{ "content-models.zip", @"content\models\" }, | ||
|
||
{ "content-textures3.zip", @"PlatformContent\pc\textures\" }, | ||
{ "content-terrain.zip", @"PlatformContent\pc\terrain\" }, | ||
{ "content-platform-fonts.zip", @"PlatformContent\pc\fonts\" }, | ||
|
||
{ "extracontent-luapackages.zip", @"ExtraContent\LuaPackages\" }, | ||
{ "extracontent-translations.zip", @"ExtraContent\translations\" }, | ||
{ "extracontent-models.zip", @"ExtraContent\models\" }, | ||
{ "extracontent-textures.zip", @"ExtraContent\textures\" }, | ||
{ "extracontent-places.zip", @"ExtraContent\places\" }, | ||
}; | ||
|
||
public virtual IReadOnlyDictionary<string, string> PackageDirectoryMap { get; set; } | ||
|
||
public CommonAppData() | ||
{ | ||
if (PackageDirectoryMap is null) | ||
{ | ||
PackageDirectoryMap = _commonMap; | ||
return; | ||
} | ||
|
||
var merged = new Dictionary<string, string>(); | ||
|
||
foreach (var entry in _commonMap) | ||
merged[entry.Key] = entry.Value; | ||
|
||
foreach (var entry in PackageDirectoryMap) | ||
merged[entry.Key] = entry.Value; | ||
|
||
PackageDirectoryMap = merged; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Bloxstrap.AppData | ||
{ | ||
internal interface IAppData | ||
{ | ||
string ProductName { get; } | ||
|
||
string BinaryType { get; } | ||
|
||
string RegistryName { get; } | ||
|
||
string ExecutableName { get; } | ||
|
||
string StartEvent { get; } | ||
|
||
IReadOnlyDictionary<string, string> PackageDirectoryMap { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Bloxstrap.AppData | ||
{ | ||
public class RobloxPlayerData : CommonAppData, IAppData | ||
{ | ||
public string ProductName { get; } = "Roblox"; | ||
|
||
public string BinaryType { get; } = "WindowsPlayer"; | ||
|
||
public string RegistryName { get; } = "RobloxPlayer"; | ||
|
||
public string ExecutableName { get; } = "RobloxPlayerBeta.exe"; | ||
|
||
public string StartEvent { get; } = "www.roblox.com/robloxStartedEvent"; | ||
|
||
public override IReadOnlyDictionary<string, string> PackageDirectoryMap { get; set; } = new Dictionary<string, string>() | ||
{ | ||
{ "RobloxApp.zip", @"" } | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Bloxstrap.AppData | ||
{ | ||
public class RobloxStudioData : CommonAppData, IAppData | ||
{ | ||
public string ProductName { get; } = "Roblox Studio"; | ||
|
||
public string BinaryType { get; } = "WindowsStudio64"; | ||
|
||
public string RegistryName { get; } = "RobloxStudio"; | ||
|
||
public string ExecutableName { get; } = "RobloxStudioBeta.exe"; | ||
|
||
public string StartEvent { get; } = "www.roblox.com/robloxStudioStartedEvent"; | ||
|
||
public override IReadOnlyDictionary<string, string> PackageDirectoryMap { get; set; } = new Dictionary<string, string>() | ||
{ | ||
{ "RobloxStudio.zip", @"" }, | ||
{ "redist.zip", @"" }, | ||
{ "LibrariesQt5.zip", @"" }, | ||
|
||
{ "content-studio_svg_textures.zip", @"content\studio_svg_textures\"}, | ||
{ "content-qt_translations.zip", @"content\qt_translations\" }, | ||
{ "content-api-docs.zip", @"content\api_docs\" }, | ||
|
||
{ "extracontent-scripts.zip", @"ExtraContent\scripts\" }, | ||
|
||
{ "BuiltInPlugins.zip", @"BuiltInPlugins\" }, | ||
{ "BuiltInStandalonePlugins.zip", @"BuiltInStandalonePlugins\" }, | ||
|
||
{ "ApplicationConfig.zip", @"ApplicationConfig\" }, | ||
{ "Plugins.zip", @"Plugins\" }, | ||
{ "Qml.zip", @"Qml\" }, | ||
{ "StudioFonts.zip", @"StudioFonts\" } | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.