mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Convert AssemblyLoadStatus to a generic enum
i might need this for other things
This commit is contained in:
parent
f564e409ba
commit
8b74470f6c
@ -1,9 +0,0 @@
|
|||||||
namespace Bloxstrap.Enums
|
|
||||||
{
|
|
||||||
enum AssemblyLoadStatus
|
|
||||||
{
|
|
||||||
NotAttempted,
|
|
||||||
Failed,
|
|
||||||
Successful
|
|
||||||
}
|
|
||||||
}
|
|
9
Bloxstrap/Enums/GenericTriState.cs
Normal file
9
Bloxstrap/Enums/GenericTriState.cs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
namespace Bloxstrap.Enums
|
||||||
|
{
|
||||||
|
public enum GenericTriState
|
||||||
|
{
|
||||||
|
Successful,
|
||||||
|
Failed,
|
||||||
|
Unknown
|
||||||
|
}
|
||||||
|
}
|
@ -4,7 +4,7 @@ namespace Bloxstrap.Utility
|
|||||||
{
|
{
|
||||||
internal static class Shortcut
|
internal static class Shortcut
|
||||||
{
|
{
|
||||||
private static AssemblyLoadStatus _loadStatus = AssemblyLoadStatus.NotAttempted;
|
private static GenericTriState _loadStatus = GenericTriState.Unknown;
|
||||||
|
|
||||||
public static void Create(string exePath, string exeArgs, string lnkPath)
|
public static void Create(string exePath, string exeArgs, string lnkPath)
|
||||||
{
|
{
|
||||||
@ -17,18 +17,18 @@ namespace Bloxstrap.Utility
|
|||||||
{
|
{
|
||||||
ShellLink.Shortcut.CreateShortcut(exePath, exeArgs, exePath, 0).WriteToFile(lnkPath);
|
ShellLink.Shortcut.CreateShortcut(exePath, exeArgs, exePath, 0).WriteToFile(lnkPath);
|
||||||
|
|
||||||
if (_loadStatus != AssemblyLoadStatus.Successful)
|
if (_loadStatus != GenericTriState.Successful)
|
||||||
_loadStatus = AssemblyLoadStatus.Successful;
|
_loadStatus = GenericTriState.Successful;
|
||||||
}
|
}
|
||||||
catch (FileNotFoundException ex)
|
catch (FileNotFoundException ex)
|
||||||
{
|
{
|
||||||
App.Logger.WriteLine(LOG_IDENT, $"Failed to create a shortcut for {lnkPath}!");
|
App.Logger.WriteLine(LOG_IDENT, $"Failed to create a shortcut for {lnkPath}!");
|
||||||
App.Logger.WriteException(LOG_IDENT, ex);
|
App.Logger.WriteException(LOG_IDENT, ex);
|
||||||
|
|
||||||
if (_loadStatus == AssemblyLoadStatus.Failed)
|
if (_loadStatus == GenericTriState.Failed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_loadStatus = AssemblyLoadStatus.Failed;
|
_loadStatus = GenericTriState.Failed;
|
||||||
|
|
||||||
Frontend.ShowMessageBox(
|
Frontend.ShowMessageBox(
|
||||||
$"{App.ProjectName} was unable to create shortcuts for the Desktop and Start menu. They will be created the next time Roblox is launched.",
|
$"{App.ProjectName} was unable to create shortcuts for the Desktop and Start menu. They will be created the next time Roblox is launched.",
|
||||||
|
Loading…
Reference in New Issue
Block a user