This repository has been archived by the owner on Jun 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
RealNickk
committed
Oct 28, 2022
1 parent
15449da
commit e9f8478
Showing
76 changed files
with
3,307 additions
and
2,369 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,8 @@ | ||
using System; | ||
|
||
public class Class1 | ||
{ | ||
public Class1() | ||
{ | ||
} | ||
} |
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
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 |
---|---|---|
@@ -1,18 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /> | ||
</startup> | ||
<runtime> | ||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
<dependentAssembly> | ||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> | ||
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" /> | ||
</dependentAssembly> | ||
<dependentAssembly> | ||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> | ||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" /> | ||
</dependentAssembly> | ||
</assemblyBinding> | ||
</runtime> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /> | ||
</startup> | ||
<runtime> | ||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
<dependentAssembly> | ||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> | ||
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" /> | ||
</dependentAssembly> | ||
<dependentAssembly> | ||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> | ||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" /> | ||
</dependentAssembly> | ||
</assemblyBinding> | ||
</runtime> | ||
</configuration> |
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
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 |
---|---|---|
@@ -1,40 +1,39 @@ | ||
using System.Runtime.InteropServices; | ||
|
||
namespace Starlight.Cli | ||
namespace Starlight.Cli; | ||
|
||
internal class Native | ||
{ | ||
internal class Native | ||
{ | ||
#if DEBUG | ||
[DllImport("kernel32.dll")] | ||
public static extern bool IsDebuggerPresent(); | ||
#endif | ||
|
||
[DllImport("user32.dll")] | ||
public static extern bool ShowWindow(int hWnd, int nCmdShow); | ||
[DllImport("user32.dll")] | ||
public static extern bool ShowWindow(int hWnd, int nCmdShow); | ||
|
||
[DllImport("user32.dll")] | ||
public static extern int FindWindow(string lpClassName, string lpWindowName); | ||
[DllImport("user32.dll")] | ||
public static extern int FindWindow(string lpClassName, string lpWindowName); | ||
|
||
[DllImport("kernel32.dll")] | ||
public static extern int GetConsoleWindow(); | ||
|
||
[DllImport("user32.dll")] | ||
public static extern int GetWindowThreadProcessId(int hWnd, out int lpdwProcessId); | ||
[DllImport("kernel32.dll")] | ||
public static extern int GetConsoleWindow(); | ||
|
||
public const uint STD_OUTPUT_HANDLE = 0xFFFFFFF5; | ||
|
||
[DllImport("kernel32.dll")] | ||
public static extern uint GetStdHandle(uint nStdHandle); | ||
|
||
[DllImport("kernel32.dll")] | ||
public static extern void SetStdHandle(uint nStdHandle, uint handle); | ||
|
||
[DllImport("kernel32.dll")] | ||
public static extern bool AllocConsole(); | ||
[DllImport("user32.dll")] | ||
public static extern int GetWindowThreadProcessId(int hWnd, out int lpdwProcessId); | ||
|
||
[DllImport("kernel32.dll")] | ||
public static extern bool FreeConsole(); | ||
public const uint STD_OUTPUT_HANDLE = 0xFFFFFFF5; | ||
|
||
[DllImport("kernel32.dll")] | ||
public static extern uint GetStdHandle(uint nStdHandle); | ||
|
||
[DllImport("kernel32.dll")] | ||
public static extern void SetStdHandle(uint nStdHandle, uint handle); | ||
|
||
[DllImport("kernel32.dll")] | ||
public static extern bool AllocConsole(); | ||
|
||
[DllImport("kernel32.dll")] | ||
public static extern bool FreeConsole(); | ||
|
||
public const int SW_HIDE = 0; | ||
} | ||
} | ||
public const int SW_HIDE = 0; | ||
} |
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
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 |
---|---|---|
@@ -1,37 +1,36 @@ | ||
using CommandLine; | ||
using Starlight.Core; | ||
using System; | ||
using System.Reflection; | ||
using System; | ||
using System.IO; | ||
using System.Reflection; | ||
using CommandLine; | ||
using Starlight.SchemeLaunch; | ||
|
||
namespace Starlight.Cli.Verbs; | ||
|
||
namespace Starlight.Cli.Verbs | ||
[Verb("hook", HelpText = "Hook Roblox's scheme.")] | ||
public class Hook : VerbBase | ||
{ | ||
[Verb("hook", HelpText = "Hook Roblox's scheme.")] | ||
public class Hook : VerbBase | ||
protected override int Init() | ||
{ | ||
return 0; | ||
} | ||
|
||
protected override int InternalInvoke() | ||
{ | ||
protected override int Init() | ||
var binDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); | ||
if (binDir is null) | ||
{ | ||
return 0; | ||
Console.WriteLine("Failed to get current assembly directory."); | ||
return 1; | ||
} | ||
|
||
protected override int InternalInvoke() | ||
var launcherBin = Path.Combine(binDir, "Starlight.Launcher.exe"); | ||
if (Scheme.Hook(launcherBin)) | ||
{ | ||
var binDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); | ||
if (binDir is null) | ||
{ | ||
Console.WriteLine("Failed to get current assembly directory."); | ||
return 1; | ||
} | ||
|
||
var launcherBin = Path.Combine(binDir, "Starlight.Launcher.exe"); | ||
if (Scheme.Hook(launcherBin)) | ||
{ | ||
Console.WriteLine("Hooked scheme. You can now launch with Starlight from the browser."); | ||
return 0; | ||
} | ||
|
||
Console.WriteLine("Failed to hook scheme."); | ||
return 1; | ||
Console.WriteLine("Hooked scheme. You can now launch with Starlight from the browser."); | ||
return 0; | ||
} | ||
|
||
Console.WriteLine("Failed to hook scheme."); | ||
return 1; | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,43 +1,46 @@ | ||
using CommandLine; | ||
using System; | ||
using Starlight.Core; | ||
using System; | ||
using CommandLine; | ||
using Starlight.Bootstrap; | ||
using Starlight.Except; | ||
|
||
namespace Starlight.Cli.Verbs | ||
namespace Starlight.Cli.Verbs; | ||
|
||
[Verb("install", HelpText = "Install a Roblox client.")] | ||
public class Install : VerbBase | ||
{ | ||
[Verb("install", HelpText = "Install a Roblox client.")] | ||
public class Install : VerbBase | ||
[Option('h', "hash", Required = false, Default = null, HelpText = "The hash of the client to install.")] | ||
public string Hash { get; set; } | ||
|
||
protected override int Init() | ||
{ | ||
[Option('h', "hash", Required = false, Default = null, HelpText = "The hash of the client to install.")] | ||
public string Hash { get; set; } | ||
if (string.IsNullOrEmpty(Hash)) | ||
Hash = Bootstrapper.GetLatestHash(); | ||
|
||
protected override int Init() | ||
try | ||
{ | ||
if (string.IsNullOrEmpty(Hash)) | ||
Hash = Bootstrapper.GetLatestHash(); | ||
|
||
var client = Bootstrapper.QueryClient(Hash); | ||
if (client is null) | ||
return 0; | ||
|
||
Bootstrapper.QueryClient(Hash); | ||
Console.WriteLine($"Roblox version-{Hash} is already installed."); | ||
return 1; | ||
|
||
} | ||
catch (ClientNotFoundException) | ||
{ | ||
return 0; | ||
} | ||
} | ||
|
||
protected override int InternalInvoke() | ||
protected override int InternalInvoke() | ||
{ | ||
Console.WriteLine($"Installing Roblox version-{Hash}..."); | ||
try | ||
{ | ||
Console.WriteLine($"Installing Roblox version-{Hash}..."); | ||
try | ||
{ | ||
Bootstrapper.Install(Hash); | ||
Console.WriteLine("Roblox has been installed successfully."); | ||
return 0; | ||
} | ||
catch (BootstrapException ex) | ||
{ | ||
Console.WriteLine($"Failed to install Roblox: {ex.Message}"); | ||
return 1; | ||
} | ||
Bootstrapper.Install(Hash); | ||
Console.WriteLine("Roblox has been installed successfully."); | ||
return 0; | ||
} | ||
catch (BadIntegrityException ex) | ||
{ | ||
Console.WriteLine($"Failed to install Roblox: {ex.Message}"); | ||
return 1; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.
e9f8478
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI failed because sxlib does not exist on the CI server.
TODO: AppVeyor