From e21b83915234488040d8239573cbe2bac9c0020a Mon Sep 17 00:00:00 2001 From: Charles Malouin <62019735+Vysp3r@users.noreply.github.com> Date: Fri, 23 Sep 2022 13:38:24 -0400 Subject: [PATCH 1/7] :bug: Fix Steam not showing up on fresh install --- src/models/location.vala | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/models/location.vala b/src/models/location.vala index 333ab2c..ffaeb8e 100644 --- a/src/models/location.vala +++ b/src/models/location.vala @@ -36,14 +36,17 @@ namespace ProtonPlus.Models { string[] steam_locations = new string[] { home_dir + "/.local/share/Steam", home_dir + "/.steam/root", home_dir + "/.steam/steam", home_dir + "/.steam/debian-installation" }; string steam_dir = steam_locations[0]; foreach (var item in steam_locations) { - var dir = Posix.opendir (item); - - if (dir != null) { - steam_dir = item; + if (Posix.opendir (item) != null) { + steam_dir = item + "/compatibilitytools.d"; + break; } } - locations[0] = new Location ("Steam", steam_dir + "/compatibilitytools.d", ProtonPlus.Models.CompatibilityTool.Steam (), new ProtonPlus.Models.Launcher ("Steam")); + if (Posix.opendir (steam_dir) == null) { + Posix.mkdir (steam_dir, 0777); + } + + locations[0] = new Location ("Steam", steam_dir, ProtonPlus.Models.CompatibilityTool.Steam (), new ProtonPlus.Models.Launcher ("Steam")); locations[1] = new Location ("Steam (Flatpak)", home_dir + "/.var/app/com.valvesoftware.Steam/data/Steam/compatibilitytools.d", ProtonPlus.Models.CompatibilityTool.Steam (), new ProtonPlus.Models.Launcher ("Steam")); locations[2] = new Location ("Steam (Snap)", home_dir + "/snap/steam/common/.steam/root/compatibilitytools.d", ProtonPlus.Models.CompatibilityTool.Steam (), new ProtonPlus.Models.Launcher ("Steam")); locations[3] = new Location ("Lutris", home_dir + "/.local/share/lutris/runners/wine", ProtonPlus.Models.CompatibilityTool.Lutris (), new ProtonPlus.Models.Launcher ("Lutris")); From ab53ad3d301bd37f724b409322af7750ab284f9f Mon Sep 17 00:00:00 2001 From: Charles Malouin <62019735+Vysp3r@users.noreply.github.com> Date: Fri, 23 Sep 2022 14:47:42 -0400 Subject: [PATCH 2/7] :bug: Fix Kron4ek Wine-Builds Vanilla not showing properly --- src/models/compatibilitytool.vala | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/models/compatibilitytool.vala b/src/models/compatibilitytool.vala index e658f91..70f5ae6 100644 --- a/src/models/compatibilitytool.vala +++ b/src/models/compatibilitytool.vala @@ -13,7 +13,7 @@ namespace ProtonPlus.Models { this.AssetPosition = asset_position; } - public Release[] GetReleases () { + public GLib.List GetReleases () { // Get the json from the Tool endpoint string json = ProtonPlus.Manager.HTTP.GET (Endpoint); @@ -24,10 +24,10 @@ namespace ProtonPlus.Models { Json.Array rootNodeArray = rootNode.get_array (); // Create an array of Version with the size of the root node array - Release[] releases = new Release[rootNodeArray.get_length ()]; + GLib.List releases = new GLib.List (); // Execute a loop with the number of items contained in the Version array and fill it - for (var i = 0; i < releases.length; i++) { + for (var i = 0; i < rootNodeArray.get_length (); i++) { string label = ""; string download_url = ""; string page_url = ""; @@ -45,14 +45,12 @@ namespace ProtonPlus.Models { var tempNodeArray = objRoot.get_array_member ("assets"); // Verify weither the temp node array has values and if so it set the endpoint to the given download url - if (tempNodeArray.get_length () > 0) { + if (tempNodeArray.get_length () >= AssetPosition) { var test = tempNodeArray.get_element (AssetPosition); Json.Object objAsset = test.get_object (); download_url = objAsset.get_string_member ("browser_download_url"); + releases.append (new Release (label, download_url, page_url)); // Currently here to prevent showing release with an invalid download_url } - - // Insert in the Version array a new Version with the current node information - releases[i] = new Release (label, download_url, page_url); } // Return the Version array @@ -71,7 +69,7 @@ namespace ProtonPlus.Models { return model; } - public static Gtk.ListStore GetReleasesModel (Release[] releases) { + public static Gtk.ListStore GetReleasesModel (GLib.List releases) { Gtk.ListStore model = new Gtk.ListStore (2, typeof (string), typeof (Release)); Gtk.TreeIter iter; From 8478a8b8e18e8ac031bf66bd2f0ccd2e2e6f5fcc Mon Sep 17 00:00:00 2001 From: Charles Malouin <62019735+Vysp3r@users.noreply.github.com> Date: Fri, 23 Sep 2022 23:37:04 -0400 Subject: [PATCH 3/7] :bug: Fix installed tools showing files --- src/models/compatibilitytool.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/compatibilitytool.vala b/src/models/compatibilitytool.vala index 70f5ae6..26b36a4 100644 --- a/src/models/compatibilitytool.vala +++ b/src/models/compatibilitytool.vala @@ -162,7 +162,7 @@ namespace ProtonPlus.Models { int count = 0; while ((dirEnt = Posix.readdir (dir)) != null) { - if(count++ > 1) { + if(count++ > 1 && dirEnt.d_type == 4) { string name = (string) dirEnt.d_name; installedReleases.append (new Release(name, "", "")); } From 5af1dbb523a37ca1b14f272f2a9728b5cea4eecb Mon Sep 17 00:00:00 2001 From: Charles Malouin <62019735+Vysp3r@users.noreply.github.com> Date: Fri, 23 Sep 2022 23:41:21 -0400 Subject: [PATCH 4/7] :bug: Fix selector closing after an installation --- src/windows/home.vala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/windows/home.vala b/src/windows/home.vala index ac77820..fabcbc7 100644 --- a/src/windows/home.vala +++ b/src/windows/home.vala @@ -135,10 +135,10 @@ namespace ProtonPlus.Windows { } private void btnAddVersion_Clicked () { - var dialogShowVersion = new ProtonPlus.Windows.Selector (this, currentLocation); - dialogShowVersion.response.connect ((response_id) => { + var dialogAddVersion = new ProtonPlus.Windows.Selector (this, currentLocation); + dialogAddVersion.response.connect ((response_id) => { if (response_id == Gtk.ResponseType.APPLY) cbInstallLocation_Changed (); - dialogShowVersion.close (); + if (response_id == Gtk.ResponseType.CANCEL) dialogAddVersion.close (); }); } From d93ac5344d85b0bd13eeaed4ad7b69e505bc64c2 Mon Sep 17 00:00:00 2001 From: Charles Malouin <62019735+Vysp3r@users.noreply.github.com> Date: Fri, 23 Sep 2022 23:57:45 -0400 Subject: [PATCH 5/7] :bug: Fix extraction not always working --- src/manager/file.vala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/manager/file.vala b/src/manager/file.vala index 8f60498..86a8179 100644 --- a/src/manager/file.vala +++ b/src/manager/file.vala @@ -2,8 +2,8 @@ namespace ProtonPlus.Manager { public class File { public static void Extract (string install_location, string archive_name) { Archive.Read archive = new Archive.Read (); - archive.support_format_tar (); - archive.support_filter_gzip (); + archive.support_format_all (); + archive.support_filter_all (); int flags; flags = Archive.ExtractFlags.ACL; @@ -15,7 +15,7 @@ namespace ProtonPlus.Manager { ext.set_standard_lookup (); ext.set_options (flags); - if (archive.open_filename (install_location + archive_name, 1536000) != Archive.Result.OK) return; + if (archive.open_filename (install_location + archive_name, 1920000) != Archive.Result.OK) return; ssize_t r; From 64331b15f561f0586c9c2fe6de96c8adb4898793 Mon Sep 17 00:00:00 2001 From: Charles Malouin <62019735+Vysp3r@users.noreply.github.com> Date: Sat, 24 Sep 2022 00:02:30 -0400 Subject: [PATCH 6/7] :memo: Update README.md Signed-off-by: Charles Malouin <62019735+Vysp3r@users.noreply.github.com> --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index b13657f..2850d1d 100644 --- a/README.md +++ b/README.md @@ -47,8 +47,7 @@ If you have any questions about ProtonPlus or want to share information with us, ## 💥 Known Issues -- Steam does not create the compatibilitytools.d by default, so ProtonPlus can't find it on a fresh Steam install -- Some items in the list of releases does not have any Label +- None - - - - From 138d8ab26af626c11a0234e851dc7509b43eb891 Mon Sep 17 00:00:00 2001 From: Charles Malouin <62019735+Vysp3r@users.noreply.github.com> Date: Sat, 24 Sep 2022 15:23:56 -0400 Subject: [PATCH 7/7] :bug: Fix Lutris DXVK not showing up --- src/models/compatibilitytool.vala | 14 ++++++++++---- src/models/location.vala | 28 +++++++++++++++------------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/src/models/compatibilitytool.vala b/src/models/compatibilitytool.vala index 26b36a4..0696fd4 100644 --- a/src/models/compatibilitytool.vala +++ b/src/models/compatibilitytool.vala @@ -116,14 +116,20 @@ namespace ProtonPlus.Models { } public static CompatibilityTool[] Lutris () { - CompatibilityTool[] tools = new CompatibilityTool[6]; + CompatibilityTool[] tools = new CompatibilityTool[3]; tools[0] = new CompatibilityTool ("Wine-GE", "Compatibility tool \"Wine\" to run Windows games on Linux. Based on Valve Proton Experimental's bleeding-edge Wine, built for Lutris.Use this when you don't know what to choose.", "https://api.github.com/repos/GloriousEggroll/wine-ge-custom/releases", 1); tools[1] = new CompatibilityTool ("Lutris-Wine", "Compatibility tool \"Wine\" to run Windows games on Linux. Improved by Lutris to offer better compatibility or performance in certain games.", "https://api.github.com/repos/lutris/wine/releases", 0); tools[2] = new CompatibilityTool ("Kron4ek Wine-Builds Vanilla", "Compatibility tool \"Wine\" to run Windows games on Linux. Official version from the WineHQ sources, compiled by Kron4ek.", "https://api.github.com/repos/Kron4ek/Wine-Builds/releases", 5); - tools[3] = new CompatibilityTool ("DXVK", "Vulkan based implementation of Direct3D 9, 10 and 11 for Linux/Wine.https://github.com/lutris/docs/blob/master/HowToDXVK.md", "https://api.github.com/repos/doitsujin/dxvk/releases", 0); - tools[4] = new CompatibilityTool ("DXVK Async (Sporif)", "Vulkan based implementation of Direct3D 9, 10 and 11 for Linux/Wine with async patch by Sporif.Warning: Use only with singleplayer games!", "https://api.github.com/repos/Sporif/dxvk-async/releases", 0); - tools[5] = new CompatibilityTool ("DXVK Async (gnusenpai)", "Vulkan based implementation of Direct3D 9, 10 and 11 for Linux/Wine with async patch and RTX fix for Star Citizen by gnusenpai.Warning: Use only with singleplayer games!", "https://api.github.com/repos/gnusenpai/dxvk/releases", 0); + return tools; + } + + public static CompatibilityTool[] LutrisDXVK () { + CompatibilityTool[] tools = new CompatibilityTool[3]; + + tools[0] = new CompatibilityTool ("DXVK", "Vulkan based implementation of Direct3D 9, 10 and 11 for Linux/Wine.https://github.com/lutris/docs/blob/master/HowToDXVK.md", "https://api.github.com/repos/doitsujin/dxvk/releases", 0); + tools[1] = new CompatibilityTool ("DXVK Async (Sporif)", "Vulkan based implementation of Direct3D 9, 10 and 11 for Linux/Wine with async patch by Sporif.Warning: Use only with singleplayer games!", "https://api.github.com/repos/Sporif/dxvk-async/releases", 0); + tools[2] = new CompatibilityTool ("DXVK Async (gnusenpai)", "Vulkan based implementation of Direct3D 9, 10 and 11 for Linux/Wine with async patch and RTX fix for Star Citizen by gnusenpai.Warning: Use only with singleplayer games!", "https://api.github.com/repos/gnusenpai/dxvk/releases", 0); return tools; } diff --git a/src/models/location.vala b/src/models/location.vala index ffaeb8e..d2f345e 100644 --- a/src/models/location.vala +++ b/src/models/location.vala @@ -28,8 +28,8 @@ namespace ProtonPlus.Models { return model; } - public static Location[] GetInstallLocations () { - Location[] locations = new Location[11]; + public static GLib.List GetInstallLocations () { + GLib.List locations = new GLib.List (); string home_dir = GLib.Environment.get_home_dir (); @@ -46,17 +46,19 @@ namespace ProtonPlus.Models { Posix.mkdir (steam_dir, 0777); } - locations[0] = new Location ("Steam", steam_dir, ProtonPlus.Models.CompatibilityTool.Steam (), new ProtonPlus.Models.Launcher ("Steam")); - locations[1] = new Location ("Steam (Flatpak)", home_dir + "/.var/app/com.valvesoftware.Steam/data/Steam/compatibilitytools.d", ProtonPlus.Models.CompatibilityTool.Steam (), new ProtonPlus.Models.Launcher ("Steam")); - locations[2] = new Location ("Steam (Snap)", home_dir + "/snap/steam/common/.steam/root/compatibilitytools.d", ProtonPlus.Models.CompatibilityTool.Steam (), new ProtonPlus.Models.Launcher ("Steam")); - locations[3] = new Location ("Lutris", home_dir + "/.local/share/lutris/runners/wine", ProtonPlus.Models.CompatibilityTool.Lutris (), new ProtonPlus.Models.Launcher ("Lutris")); - locations[4] = new Location ("Lutris (Flatpak)", home_dir + "/.var/app/net.lutris.Lutris/data/lutris/runners/wine", ProtonPlus.Models.CompatibilityTool.Lutris (), new ProtonPlus.Models.Launcher ("Lutris")); - locations[5] = new Location ("Heroic Wine", home_dir + "/.config/heroic/tools/wine", ProtonPlus.Models.CompatibilityTool.HeroicWine (), new ProtonPlus.Models.Launcher ("Heroic Wine")); - locations[6] = new Location ("Heroic Proton", home_dir + "/.config/heroic/tools/proton", ProtonPlus.Models.CompatibilityTool.HeroicProton (), new ProtonPlus.Models.Launcher ("Heroic Proton")); - locations[7] = new Location ("Heroic Wine (Flatpak)", home_dir + "/.var/app/com.heroicgameslauncher.hgl/config/heroic/tools/wine", ProtonPlus.Models.CompatibilityTool.HeroicWine (), new ProtonPlus.Models.Launcher ("Heroic Wine")); - locations[8] = new Location ("Heroic Proton (Flatpak)", home_dir + "/.var/app/com.heroicgameslauncher.hgl/config/heroic/tools/proton", ProtonPlus.Models.CompatibilityTool.HeroicProton (), new ProtonPlus.Models.Launcher ("Heroic Proton")); - locations[9] = new Location ("Bottles", home_dir + "/.local/share/bottles/runners", ProtonPlus.Models.CompatibilityTool.Bottles (), new ProtonPlus.Models.Launcher ("Bottles")); - locations[10] = new Location ("Bottles (Flatpak)", home_dir + "/.var/app/com.usebottles.bottles/data/bottles/runners", ProtonPlus.Models.CompatibilityTool.Bottles (), new ProtonPlus.Models.Launcher ("Bottles")); + locations.append (new Location ("Steam", steam_dir, ProtonPlus.Models.CompatibilityTool.Steam (), new ProtonPlus.Models.Launcher ("Steam"))); + locations.append (new Location ("Steam (Flatpak)", home_dir + "/.var/app/com.valvesoftware.Steam/data/Steam/compatibilitytools.d", ProtonPlus.Models.CompatibilityTool.Steam (), new ProtonPlus.Models.Launcher ("Steam"))); + locations.append (new Location ("Steam (Snap)", home_dir + "/snap/steam/common/.steam/root/compatibilitytools.d", ProtonPlus.Models.CompatibilityTool.Steam (), new ProtonPlus.Models.Launcher ("Steam"))); + locations.append (new Location ("Lutris", home_dir + "/.local/share/lutris/runners/wine", ProtonPlus.Models.CompatibilityTool.Lutris (), new ProtonPlus.Models.Launcher ("Lutris"))); + locations.append (new Location ("Lutris (Flatpak)", home_dir + "/.var/app/net.lutris.Lutris/data/lutris/runners/wine", ProtonPlus.Models.CompatibilityTool.Lutris (), new ProtonPlus.Models.Launcher ("Lutris"))); + locations.append (new Location ("Lutris DXVK", home_dir + "/.local/share/lutris/runtime/dxvk", ProtonPlus.Models.CompatibilityTool.LutrisDXVK (), new ProtonPlus.Models.Launcher ("Lutris"))); + locations.append (new Location ("Lutris DXVK (Flatpak)", home_dir + "/.var/app/net.lutris.Lutris/data/lutris/runtime/dxvk", ProtonPlus.Models.CompatibilityTool.LutrisDXVK (), new ProtonPlus.Models.Launcher ("Lutris"))); + locations.append (new Location ("Heroic Wine", home_dir + "/.config/heroic/tools/wine", ProtonPlus.Models.CompatibilityTool.HeroicWine (), new ProtonPlus.Models.Launcher ("Heroic Wine"))); + locations.append (new Location ("Heroic Proton", home_dir + "/.config/heroic/tools/proton", ProtonPlus.Models.CompatibilityTool.HeroicProton (), new ProtonPlus.Models.Launcher ("Heroic Proton"))); + locations.append (new Location ("Heroic Wine (Flatpak)", home_dir + "/.var/app/com.heroicgameslauncher.hgl/config/heroic/tools/wine", ProtonPlus.Models.CompatibilityTool.HeroicWine (), new ProtonPlus.Models.Launcher ("Heroic Wine"))); + locations.append (new Location ("Heroic Proton (Flatpak)", home_dir + "/.var/app/com.heroicgameslauncher.hgl/config/heroic/tools/proton", ProtonPlus.Models.CompatibilityTool.HeroicProton (), new ProtonPlus.Models.Launcher ("Heroic Proton"))); + locations.append (new Location ("Bottles", home_dir + "/.local/share/bottles/runners", ProtonPlus.Models.CompatibilityTool.Bottles (), new ProtonPlus.Models.Launcher ("Bottles"))); + locations.append (new Location ("Bottles (Flatpak)", home_dir + "/.var/app/com.usebottles.bottles/data/bottles/runners", ProtonPlus.Models.CompatibilityTool.Bottles (), new ProtonPlus.Models.Launcher ("Bottles"))); return locations; }