From 77c3c5f5c17272b2d07e6fc208623ed271e19352 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Diego=20G=C3=B3mez?=
<72423267+Haruki1707@users.noreply.github.com>
Date: Sat, 12 Mar 2022 19:26:26 -0600
Subject: [PATCH] EZ_Updater updated to avoid admin rights problem & custom
args added to ShortCute
---
ShortCutes/Program.cs | 2 +-
ShortCutes/Properties/AssemblyInfo.cs | 4 ++--
ShortCutes/ShortCutes.csproj | 2 +-
ShortCutes/ShortCutesForm.cs | 8 +++++++-
ShortCutes/UI-forms/MessageForm.cs | 7 +++----
ShortCutes/src/Roslyn Form Code.cs | 9 +++++++--
6 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/ShortCutes/Program.cs b/ShortCutes/Program.cs
index 1be6d2d..ae09020 100644
--- a/ShortCutes/Program.cs
+++ b/ShortCutes/Program.cs
@@ -12,7 +12,7 @@ namespace ShortCutes
static class Program
{
[STAThread]
- static void Main()
+ static void Main(string[] args)
{
if (IsUserAdministrator() == false)
{
diff --git a/ShortCutes/Properties/AssemblyInfo.cs b/ShortCutes/Properties/AssemblyInfo.cs
index 60761d2..adcafa1 100644
--- a/ShortCutes/Properties/AssemblyInfo.cs
+++ b/ShortCutes/Properties/AssemblyInfo.cs
@@ -32,6 +32,6 @@
// Puede especificar todos los valores o usar los valores predeterminados de número de compilación y de revisión
// utilizando el carácter "*", como se muestra a continuación:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.4")]
-[assembly: AssemblyFileVersion("1.4")]
+[assembly: AssemblyVersion("1.4.1")]
+[assembly: AssemblyFileVersion("1.4.1")]
[assembly: NeutralResourcesLanguage("en")]
diff --git a/ShortCutes/ShortCutes.csproj b/ShortCutes/ShortCutes.csproj
index 05b8cb3..5a357ec 100644
--- a/ShortCutes/ShortCutes.csproj
+++ b/ShortCutes/ShortCutes.csproj
@@ -212,7 +212,7 @@
4.1.0
- 0.5.0.3
+ 0.5.3.1
6.0.0
diff --git a/ShortCutes/ShortCutesForm.cs b/ShortCutes/ShortCutesForm.cs
index d2247c1..a757f70 100644
--- a/ShortCutes/ShortCutesForm.cs
+++ b/ShortCutes/ShortCutesForm.cs
@@ -80,7 +80,13 @@ public ShortCutes()
private async void ShortCutes_Shown(object sender, EventArgs e)
{
- if (await Updater.CheckUpdateAsync("Haruki1707", "ShortCutes")) new MessageForm("", 4).ShowDialog();
+ if (await Updater.CheckUpdateAsync("Haruki1707", "ShortCutes"))
+ {
+ if (Updater.CannotWriteOnDir)
+ MessageForm.Error(Updater.Message);
+ else
+ new MessageForm("", 4).ShowDialog();
+ }
}
public static void Form1_UIThreadException(object sender, ThreadExceptionEventArgs t)
diff --git a/ShortCutes/UI-forms/MessageForm.cs b/ShortCutes/UI-forms/MessageForm.cs
index 9a25198..711568d 100644
--- a/ShortCutes/UI-forms/MessageForm.cs
+++ b/ShortCutes/UI-forms/MessageForm.cs
@@ -143,13 +143,12 @@ private void UIChange(object sender, EventArgs e)
Messagelbl.Text = Updater.Message;
progressBar1.Value = Updater.ProgressPercentage;
- switch (Updater.State)
+ switch (Updater.ShortState)
{
- case UpdaterState.Canceled:
- case UpdaterState.InstallFailed:
+ case UpdaterShortState.Canceled:
OKbtn.Visible = true;
break;
- case UpdaterState.Installed:
+ case UpdaterShortState.Installed:
Application.Restart();
break;
}
diff --git a/ShortCutes/src/Roslyn Form Code.cs b/ShortCutes/src/Roslyn Form Code.cs
index bc02874..050d428 100644
--- a/ShortCutes/src/Roslyn Form Code.cs
+++ b/ShortCutes/src/Roslyn Form Code.cs
@@ -20,6 +20,7 @@ public class CuteLauncher : Form
private string GameName = "%GAME%";
private int standarHeight = %HEIGHT%;
private bool WaitForWindowChange = %WAITCHANGE%;
+ private static string ExtraArgs = "";
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
public CuteLauncher()
@@ -110,7 +111,7 @@ private void ExecuteEmu_Tick(object sender, EventArgs e)
//Emulator execution
ShortCute.StartInfo.WorkingDirectory = "..\\";
ShortCute.StartInfo.FileName = "..\\" + Emulator;
- ShortCute.StartInfo.Arguments = "%ARGUMENTS%";
+ ShortCute.StartInfo.Arguments = "%ARGUMENTS%" + ExtraArgs;
ShortCute.Start();
TimerSC.Interval = 100;
@@ -193,8 +194,12 @@ protected override CreateParams CreateParams
}
[STAThread]
- static void Main()
+ static void Main(string[] args)
{
+ if (args.Length > 0)
+ foreach (string arg in args)
+ ExtraArgs += " " + arg;
+
Application.EnableVisualStyles();
Application.Run(new CuteLauncher());
}