Skip to content

Commit

Permalink
Bug fixes for shortcut creation and launcher mode on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ZachAR3 committed Jul 21, 2023
1 parent 03e7853 commit c0b2354
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
12 changes: 6 additions & 6 deletions Scripts/Installer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private void Initiate()
_extractWarning.Visible = false;
_downloadWarning.Visible = false;
_clearShadersWarning.Visible = false;

_downloadButton.GrabFocus();
AddVersions();
}
Expand Down Expand Up @@ -154,9 +154,9 @@ private void CreateShortcut()
{
String linuxShortcutName = "yuzu-ea.desktop";
String windowsShortcutName = "yuzu-ea.lnk";
String iconPath = $@"{Globals.Instance.Settings.SaveDirectory}/Icon.png";
String iconPath = Path.Join(Globals.Instance.Settings.SaveDirectory, "Icon.png");

string executable = OS.GetExecutablePath();
string executable = _autoUpdate ? OS.GetExecutablePath() : Globals.Instance.Settings.ExecutablePath;
string launcherFlag = null;
if (_autoUpdate)
{
Expand Down Expand Up @@ -234,6 +234,7 @@ [Desktop Entry]
var windowsShortcut = new WindowsShortcut
{
Path = executable,
IconLocation = Globals.Instance.Settings.ExecutablePath,
Arguments = launcherFlag
};

Expand All @@ -253,7 +254,6 @@ [Desktop Entry]
Tools.Instance.AddError(
$@"cannot create shortcut, ensure app is running as admin. Placing instead at {yuzuShortcutPath}. Exception:{shortcutError}");
windowsShortcut.Save(yuzuShortcutPath);
throw;
}

}
Expand Down Expand Up @@ -369,7 +369,7 @@ private void UnpackAndSetPermissions()
}
else if (_osUsed == "Windows")
{
if (_autoUnpackButton.ButtonPressed)
if (_autoUnpackButton.ButtonPressed || _autoUpdate)
{
System.IO.Compression.ZipFile.ExtractToDirectory(yuzuPath, Globals.Instance.Settings.SaveDirectory);
String yuzuWindowsDirectory = $@"{Globals.Instance.Settings.SaveDirectory}/{_windowsFolderName}";
Expand All @@ -385,8 +385,8 @@ private void UnpackAndSetPermissions()
if (currentExecutablePath != newExecutablePath)
{
File.Move(currentExecutablePath, newExecutablePath);
Globals.Instance.Settings.ExecutablePath = newExecutablePath;
}
Globals.Instance.Settings.ExecutablePath = newExecutablePath;
}
}
}
Expand Down
Loading

0 comments on commit c0b2354

Please sign in to comment.