From a442c9c3e81315ad1ac8746e22760f9bbbb563d4 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Tue, 25 Jun 2019 12:43:03 +0200 Subject: [PATCH 01/37] Update script.js --- Engines/Wine/Verbs/DXVK/script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index c40c140fe7..643900ebc3 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -12,9 +12,9 @@ include("utils.functions.filesystem.files"); Wine.prototype.DXVK = function (dxvkVersion) { var operatingSystemFetcher = Bean("operatingSystemFetcher"); print("NOTE: wine version should be greater or equal to 3.10"); - if (operatingSystemFetcher.fetchCurrentOperationSystem() != "Linux") + if (operatingSystemFetcher.fetchCurrentOperationSystem().getFullName() !== "Linux") { - this.wizard().message(tr("DXVK might not work correctly on macOS. This is depending on Metal api support and MoltenVK compatibility layer advancement")); + throw "DXVK might not work correctly on macOS. This is depending on Metal api support and MoltenVK compatibility layer advancement."; } else { From 2b4f53f1d05b67b59004843bff60375b2d15dcc8 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Tue, 25 Jun 2019 13:34:00 +0200 Subject: [PATCH 02/37] Update script.js Trying to ask the user if they want to continue. --- Engines/Wine/Verbs/DXVK/script.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index 643900ebc3..92d98a069a 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -11,10 +11,14 @@ include("utils.functions.filesystem.files"); */ Wine.prototype.DXVK = function (dxvkVersion) { var operatingSystemFetcher = Bean("operatingSystemFetcher"); + var uiQuestionFactory = Bean("uiQuestionFactory"); print("NOTE: wine version should be greater or equal to 3.10"); if (operatingSystemFetcher.fetchCurrentOperationSystem().getFullName() !== "Linux") { - throw "DXVK might not work correctly on macOS. This is depending on Metal api support and MoltenVK compatibility layer advancement."; + uiQuestionFactory.create( + tr("DXVK is currently unsupported on non-Linux operating systems due to MoltenVK implementation being incomplete. Do you want to continue? Chosing no will delete the wineprefix.", winePrefix), + () => remove(this.winePrefixesDirectory + winePrefix) + ); } else { From f61b7cb50f07fb36ed286c6da10814b7d955c8cf Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Tue, 25 Jun 2019 13:39:58 +0200 Subject: [PATCH 03/37] Update script.js --- Engines/Wine/Verbs/DXVK/script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index 92d98a069a..d79311f5cf 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -16,8 +16,8 @@ Wine.prototype.DXVK = function (dxvkVersion) { if (operatingSystemFetcher.fetchCurrentOperationSystem().getFullName() !== "Linux") { uiQuestionFactory.create( - tr("DXVK is currently unsupported on non-Linux operating systems due to MoltenVK implementation being incomplete. Do you want to continue? Chosing no will delete the wineprefix.", winePrefix), - () => remove(this.winePrefixesDirectory + winePrefix) + tr("DXVK is currently unsupported on non-Linux operating systems due to MoltenVK implementation being incomplete. Do you want to continue? Chosing no will skip DXVK installation and continue with other verbs.", winePrefix), + () => ); } else From e683104f0725cfb749e61e841359f787ac0f52c2 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Tue, 25 Jun 2019 13:45:12 +0200 Subject: [PATCH 04/37] Update script.js I'm probably wrong but this is what @ImperatorS79 meant with the big if else instruction. --- Engines/Wine/Verbs/DXVK/script.js | 85 ++++++++++++++++--------------- 1 file changed, 43 insertions(+), 42 deletions(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index d79311f5cf..adcb48ae6f 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -23,59 +23,60 @@ Wine.prototype.DXVK = function (dxvkVersion) { else { this.wizard().message(tr("Please ensure you have the latest drivers (418.30 minimum for NVIDIA and mesa 19 for AMD) or else DXVK might not work correctly.")); - } + if (typeof dxvkVersion !== 'string') + { + var releaseFile = new Resource() + .wizard(this.wizard()) + .url("https://raw.githubusercontent.com/doitsujin/dxvk/master/RELEASE") + .name("RELEASE.txt") + .get(); + dxvkVersion = cat(releaseFile).replaceAll("\\n", ""); + } - if (typeof dxvkVersion !== 'string') - { - var releaseFile = new Resource() + var setupFile = new Resource() .wizard(this.wizard()) - .url("https://raw.githubusercontent.com/doitsujin/dxvk/master/RELEASE") - .name("RELEASE.txt") + .url("https://github.com/doitsujin/dxvk/releases/download/v" + dxvkVersion + "/dxvk-" + dxvkVersion + ".tar.gz") + .name("dxvk-" + dxvkVersion + ".tar.gz") .get(); - dxvkVersion = cat(releaseFile).replaceAll("\\n", ""); - } - - var setupFile = new Resource() - .wizard(this.wizard()) - .url("https://github.com/doitsujin/dxvk/releases/download/v" + dxvkVersion + "/dxvk-" + dxvkVersion + ".tar.gz") - .name("dxvk-" + dxvkVersion + ".tar.gz") - .get(); - - new Extractor() - .wizard(this.wizard()) - .archive(setupFile) - .to(this.prefixDirectory() + "/TMP/") - .extract(); - var forEach = Array.prototype.forEach; - var sys32dir = this.system32directory(); - var dxvkTmpDir = this.prefixDirectory() + "/TMP/dxvk-" + dxvkVersion; - var self = this; + new Extractor() + .wizard(this.wizard()) + .archive(setupFile) + .to(this.prefixDirectory() + "/TMP/") + .extract(); - //Copy 32 bits dll to system* and apply override - forEach.call(ls(dxvkTmpDir + "/x32"), function (file) { - if (file.endsWith(".dll")) { - cp(dxvkTmpDir + "/x32/" + file, sys32dir); - self.overrideDLL() - .set("native", [file]) - .do(); - } - }); + var forEach = Array.prototype.forEach; + var sys32dir = this.system32directory(); + var dxvkTmpDir = this.prefixDirectory() + "/TMP/dxvk-" + dxvkVersion; + var self = this; - if (this.architecture() == "amd64") - { - var sys64dir = this.system64directory(); - //Copy 64 bits dll to system* - forEach.call(ls(dxvkTmpDir + "/x64"), function (file) { + //Copy 32 bits dll to system* and apply override + forEach.call(ls(dxvkTmpDir + "/x32"), function (file) { if (file.endsWith(".dll")) { - cp(dxvkTmpDir + "/x64/" + file, sys64dir); + cp(dxvkTmpDir + "/x32/" + file, sys32dir); + self.overrideDLL() + .set("native", [file]) + .do(); } }); - } - remove(this.prefixDirectory() + "/TMP/"); + if (this.architecture() == "amd64") + { + var sys64dir = this.system64directory(); + //Copy 64 bits dll to system* + forEach.call(ls(dxvkTmpDir + "/x64"), function (file) { + if (file.endsWith(".dll")) { + cp(dxvkTmpDir + "/x64/" + file, sys64dir); + } + }); + } + + remove(this.prefixDirectory() + "/TMP/"); + + return this; + } - return this; + } /** From fcd87912439de74a5a612656238faed484241713 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Tue, 25 Jun 2019 13:50:14 +0200 Subject: [PATCH 05/37] Update script.js --- Engines/Wine/Verbs/DXVK/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index adcb48ae6f..ff820ef5f3 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -16,7 +16,7 @@ Wine.prototype.DXVK = function (dxvkVersion) { if (operatingSystemFetcher.fetchCurrentOperationSystem().getFullName() !== "Linux") { uiQuestionFactory.create( - tr("DXVK is currently unsupported on non-Linux operating systems due to MoltenVK implementation being incomplete. Do you want to continue? Chosing no will skip DXVK installation and continue with other verbs.", winePrefix), + tr("DXVK is currently unsupported on non-Linux operating systems due to MoltenVK implementation being incomplete. Do you want to continue? Chosing yes will skip DXVK installation and continue with other verbs.", winePrefix), () => ); } From bccd621eac8c6b84528147dda76e01ed5ad1d5b1 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Tue, 25 Jun 2019 13:57:32 +0200 Subject: [PATCH 06/37] Update script.js reverting e683104f0725cfb749e61e841359f787ac0f52c2 --- Engines/Wine/Verbs/DXVK/script.js | 92 +++++++++++++++---------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index ff820ef5f3..05fa57ec80 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -16,67 +16,67 @@ Wine.prototype.DXVK = function (dxvkVersion) { if (operatingSystemFetcher.fetchCurrentOperationSystem().getFullName() !== "Linux") { uiQuestionFactory.create( - tr("DXVK is currently unsupported on non-Linux operating systems due to MoltenVK implementation being incomplete. Do you want to continue? Chosing yes will skip DXVK installation and continue with other verbs.", winePrefix), - () => + tr("XVK is currently unsupported on non-Linux operating systems due to MoltenVK implementation being incomplete. Do you want to continue? Chosing yes will skip DXVK verb installation and continue with other verbs. Chosing no will quit script installation.", winePrefix), + () => continue; ); } - else + else (operatingSystemFetcher.fetchCurrentOperationSystem().getFullName() == "Linux") { this.wizard().message(tr("Please ensure you have the latest drivers (418.30 minimum for NVIDIA and mesa 19 for AMD) or else DXVK might not work correctly.")); - if (typeof dxvkVersion !== 'string') - { - var releaseFile = new Resource() - .wizard(this.wizard()) - .url("https://raw.githubusercontent.com/doitsujin/dxvk/master/RELEASE") - .name("RELEASE.txt") - .get(); - dxvkVersion = cat(releaseFile).replaceAll("\\n", ""); - } + continue = true; + } - var setupFile = new Resource() + if (typeof dxvkVersion !== 'string') + { + var releaseFile = new Resource() .wizard(this.wizard()) - .url("https://github.com/doitsujin/dxvk/releases/download/v" + dxvkVersion + "/dxvk-" + dxvkVersion + ".tar.gz") - .name("dxvk-" + dxvkVersion + ".tar.gz") + .url("https://raw.githubusercontent.com/doitsujin/dxvk/master/RELEASE") + .name("RELEASE.txt") .get(); + dxvkVersion = cat(releaseFile).replaceAll("\\n", ""); + } - new Extractor() - .wizard(this.wizard()) - .archive(setupFile) - .to(this.prefixDirectory() + "/TMP/") - .extract(); + var setupFile = new Resource() + .wizard(this.wizard()) + .url("https://github.com/doitsujin/dxvk/releases/download/v" + dxvkVersion + "/dxvk-" + dxvkVersion + ".tar.gz") + .name("dxvk-" + dxvkVersion + ".tar.gz") + .get(); - var forEach = Array.prototype.forEach; - var sys32dir = this.system32directory(); - var dxvkTmpDir = this.prefixDirectory() + "/TMP/dxvk-" + dxvkVersion; - var self = this; + new Extractor() + .wizard(this.wizard()) + .archive(setupFile) + .to(this.prefixDirectory() + "/TMP/") + .extract(); - //Copy 32 bits dll to system* and apply override - forEach.call(ls(dxvkTmpDir + "/x32"), function (file) { - if (file.endsWith(".dll")) { - cp(dxvkTmpDir + "/x32/" + file, sys32dir); - self.overrideDLL() - .set("native", [file]) - .do(); - } - }); + var forEach = Array.prototype.forEach; + var sys32dir = this.system32directory(); + var dxvkTmpDir = this.prefixDirectory() + "/TMP/dxvk-" + dxvkVersion; + var self = this; - if (this.architecture() == "amd64") - { - var sys64dir = this.system64directory(); - //Copy 64 bits dll to system* - forEach.call(ls(dxvkTmpDir + "/x64"), function (file) { - if (file.endsWith(".dll")) { - cp(dxvkTmpDir + "/x64/" + file, sys64dir); - } - }); + //Copy 32 bits dll to system* and apply override + forEach.call(ls(dxvkTmpDir + "/x32"), function (file) { + if (file.endsWith(".dll")) { + cp(dxvkTmpDir + "/x32/" + file, sys32dir); + self.overrideDLL() + .set("native", [file]) + .do(); } + }); - remove(this.prefixDirectory() + "/TMP/"); - - return this; + if (this.architecture() == "amd64") + { + var sys64dir = this.system64directory(); + //Copy 64 bits dll to system* + forEach.call(ls(dxvkTmpDir + "/x64"), function (file) { + if (file.endsWith(".dll")) { + cp(dxvkTmpDir + "/x64/" + file, sys64dir); + } + }); } - + remove(this.prefixDirectory() + "/TMP/"); + + return this; } /** From 94db17271e151f3a6fd48c6410a16219928d9aef Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Wed, 26 Jun 2019 08:50:07 +0200 Subject: [PATCH 07/37] Update script.js --- Engines/Wine/Verbs/DXVK/script.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index 05fa57ec80..b304951820 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -16,14 +16,13 @@ Wine.prototype.DXVK = function (dxvkVersion) { if (operatingSystemFetcher.fetchCurrentOperationSystem().getFullName() !== "Linux") { uiQuestionFactory.create( - tr("XVK is currently unsupported on non-Linux operating systems due to MoltenVK implementation being incomplete. Do you want to continue? Chosing yes will skip DXVK verb installation and continue with other verbs. Chosing no will quit script installation.", winePrefix), - () => continue; + tr("DXVK is currently unsupported on non-Linux operating systems due to MoltenVK implementation being incomplete. Do you want to continue? Chosing yes will skip DXVK verb installation and continue with other verbs. Chosing no will quit script installation.", winePrefix), + () => return this; ); } else (operatingSystemFetcher.fetchCurrentOperationSystem().getFullName() == "Linux") { this.wizard().message(tr("Please ensure you have the latest drivers (418.30 minimum for NVIDIA and mesa 19 for AMD) or else DXVK might not work correctly.")); - continue = true; } if (typeof dxvkVersion !== 'string') From 71834c22b2bceb097dcc1e28336bffac4c51e182 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Thu, 27 Jun 2019 19:27:28 +0200 Subject: [PATCH 08/37] Update script.js Removed a confusing part of the script, thanks for the heads up @plata --- Engines/Wine/Verbs/DXVK/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index b304951820..5a002e5052 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -20,7 +20,7 @@ Wine.prototype.DXVK = function (dxvkVersion) { () => return this; ); } - else (operatingSystemFetcher.fetchCurrentOperationSystem().getFullName() == "Linux") + else { this.wizard().message(tr("Please ensure you have the latest drivers (418.30 minimum for NVIDIA and mesa 19 for AMD) or else DXVK might not work correctly.")); } From afb866f89a6f51de35a38b3101a7d8e12ec7ed76 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Sat, 29 Jun 2019 11:55:39 +0200 Subject: [PATCH 09/37] Update script.js Using constants instead of variables in beans declaration. --- Engines/Wine/Verbs/DXVK/script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index 5a002e5052..fb377e318b 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -10,8 +10,8 @@ include("utils.functions.filesystem.files"); * @returns {Wine} Wine object */ Wine.prototype.DXVK = function (dxvkVersion) { - var operatingSystemFetcher = Bean("operatingSystemFetcher"); - var uiQuestionFactory = Bean("uiQuestionFactory"); + const operatingSystemFetcher = Bean("operatingSystemFetcher"); + const uiQuestionFactory = Bean("uiQuestionFactory"); print("NOTE: wine version should be greater or equal to 3.10"); if (operatingSystemFetcher.fetchCurrentOperationSystem().getFullName() !== "Linux") { From ad637d0b628c695a3fba576c04bae85574c6723a Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Sun, 28 Jul 2019 12:11:15 +0200 Subject: [PATCH 10/37] Update script.js Added new DXVK versions. --- Engines/Wine/Verbs/DXVK/script.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index 18ba27022c..21c9462721 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -100,7 +100,8 @@ class DXVKVerb { var latestVersion = cat(releaseFile).replaceAll("\\n", ""); // query desired version (default: latest release version) var versions = [ - "1.2.2", "1.2.1", "1.2", + "1.3", "1.3.1" + "1.2.3", "1.2.2", "1.2.1", "1.2", "1.1.1", "1.0.3", "1.0.2", "1.0.1", "1.0", "0.96", "0.95", "0.94", "0.93", "0.92", "0.91", "0.90", From ea5f89c7e08760bb80dc4df38cd1e80249442361 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Sat, 24 Aug 2019 14:09:27 +0200 Subject: [PATCH 11/37] Update script.js --- Engines/Wine/Verbs/DXVK/script.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index 21c9462721..b9a249238b 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -1,7 +1,9 @@ -include("engines.wine.engine.object"); +const Wine = include("engines.wine.engine.object"); +const Resource = include("utils.functions.net.resource"); +const {Extractor} = include("utils.functions.filesystem.extract"); +const {ls, cp, cat, remove} = include("utils.functions.filesystem.files"); + include("engines.wine.plugins.override_dll"); -include("utils.functions.net.resource"); -include("utils.functions.filesystem.files"); /** * Verb to install DXVK @@ -16,10 +18,13 @@ Wine.prototype.DXVK = function (dxvkVersion) { print("NOTE: wine version should be greater or equal to 3.10"); if (operatingSystemFetcher.fetchCurrentOperationSystem().getFullName() !== "Linux") { - uiQuestionFactory.create( - tr("DXVK is currently unsupported on non-Linux operating systems due to MoltenVK implementation being incomplete. Do you want to continue? Chosing yes will skip DXVK verb installation and continue with other verbs. Chosing no will quit script installation.", winePrefix), - () => return this; - ); + const answer = uiQuestionFactory.create( + tr("DXVK is currently unsupported on non-Linux operating systems due to MoltenVK implementation being incomplete. Do you want to continue? Choosing yes will skip DXVK verb installation and continue with other verbs. Choosing no will quit script installation.") + ); + // or: `if (answer == false)` + if (!answer) { + return this; + } } else { this.wizard().message(tr("Please ensure you have the latest drivers (418.30 minimum for NVIDIA and mesa 19 for AMD) or else DXVK might not work correctly.")); From 29e05a9ff3f1eb9b461173ba6c5d652f15b45ab9 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Wed, 30 Oct 2019 18:08:28 +0100 Subject: [PATCH 12/37] Update script.js Using a better way to handle the situation where user have a non-Linux system. --- Engines/Wine/Verbs/DXVK/script.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index 35b17bd055..a8d24c17ec 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -42,12 +42,15 @@ class DXVK { if (operatingSystemFetcher.fetchCurrentOperationSystem().getFullName() !== "Linux") { const answer = uiQuestionFactory.create( - tr("DXVK is currently unsupported on non-Linux operating systems due to MoltenVK implementation being incomplete. Do you want to continue? Choosing yes will skip DXVK verb installation and continue with other verbs. Choosing no will quit script installation.") + tr("D9VK is currently unsupported on non-Linux operating systems due to MoltenVK implementation being incomplete. Select how do you want to approach this situation."), + ["YES, continue with D9VK installation regardless", "NO, quit script alltogether", "Exit D9VK Installer, but continue with the script"] ); - // or: `if (answer == false)` - if (!answer) { + if (!answer || answer == "Exit D9VK Installer, but continue with the script") { return this; } + if (answer == "NO, quit script alltogether") { + throw "User aborted the script."; + } } else { this.wizard().message(tr("Please ensure you have the latest drivers (418.30 minimum for NVIDIA and mesa 19 for AMD) or else DXVK might not work correctly.")); From 09b7a6452ef14d4df3d0377eca91f19ab2d5a066 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Thu, 31 Oct 2019 11:27:43 +0100 Subject: [PATCH 13/37] Update script.js Replaced version list with getGithubReleases function. --- Engines/Wine/Verbs/DXVK/script.js | 82 +++---------------------------- 1 file changed, 6 insertions(+), 76 deletions(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index a8d24c17ec..aaa0358297 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -2,12 +2,10 @@ const Wine = include("engines.wine.engine.object"); const Resource = include("utils.functions.net.resource"); const { Extractor } = include("utils.functions.filesystem.extract"); const { ls, cp, cat, remove } = include("utils.functions.filesystem.files"); - const operatingSystemFetcher = Bean("operatingSystemFetcher"); - const Optional = Java.type("java.util.Optional"); - const OverrideDLL = include("engines.wine.plugins.override_dll"); +const { getGithubReleases } = include("utils.functions.net.githubreleases"); /** * Verb to install DXVK @@ -56,13 +54,8 @@ class DXVK { this.wizard().message(tr("Please ensure you have the latest drivers (418.30 minimum for NVIDIA and mesa 19 for AMD) or else DXVK might not work correctly.")); if (typeof this.dxvkVersion !== "string") { - const releaseFile = new Resource() - .wizard(wizard) - .url("https://raw.githubusercontent.com/doitsujin/dxvk/master/RELEASE") - .name("RELEASE.txt") - .get(); - - this.dxvkVersion = cat(releaseFile).replaceAll("\\n", ""); + const versions = getGithubReleases("doitsujin", "dxvk", wizard); + this.dxvkVersion = versions[0]; } const setupFile = new Resource() @@ -103,78 +96,15 @@ class DXVK { remove(`${prefixDirectory}/TMP/`); } - static install(container) { const wine = new Wine(); const wizard = SetupWizard(InstallationType.VERBS, "DXVK", Optional.empty()); - wine.prefix(container); + var wizard = SetupWizard(InstallationType.VERBS, "DXVK", java.util.Optional.empty()); + const versions = getGithubReleases("doitsujin", "dxvk", wizard); + var selectedVersion = wizard.menu(tr("Please select the version."), versions, versions[0]); wine.wizard(wizard); - // get latest release version - const releaseFile = new Resource() - .wizard(wizard) - .url("https://raw.githubusercontent.com/doitsujin/dxvk/master/RELEASE") - .name("RELEASE.txt") - .get(); - - const latestVersion = cat(releaseFile).replaceAll("\\n", ""); - - // query desired version (default: latest release version) -const versions = [ - "1.4.4", - "1.4.3", - "1.4.2", - "1.4.1", - "1.4", - "1.3.4", - "1.3.3", - "1.3.2", - "1.3.1", - "1.3", - "1.2.3", - "1.2.2", - "1.2.1", - "1.2", - "1.1.1", - "1.0.3", - "1.0.2", - "1.0.1", - "1.0", - "0.96", - "0.95", - "0.94", - "0.93", - "0.92", - "0.91", - "0.90", - "0.81", - "0.80", - "0.72", - "0.71", - "0.70", - "0.65", - "0.64", - "0.63", - "0.62", - "0.61", - "0.60", - "0.54", - "0.53", - "0.52", - "0.51", - "0.50", - "0.42", - "0.41", - "0.40", - "0.31", - "0.30", - "0.21", - "0.20" - ]; - - const selectedVersion = wizard.menu(tr("Please select the version."), versions, latestVersion); - // install selected version new DXVK(wine).withVersion(selectedVersion.text).go(); From af78edafb3e0ad33887625d4ead81f1622d4f18e Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Sat, 2 Nov 2019 09:24:12 +0100 Subject: [PATCH 14/37] Update script.js --- Engines/Wine/Verbs/DXVK/script.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index aaa0358297..d6088bac05 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -100,9 +100,8 @@ class DXVK { const wine = new Wine(); const wizard = SetupWizard(InstallationType.VERBS, "DXVK", Optional.empty()); - var wizard = SetupWizard(InstallationType.VERBS, "DXVK", java.util.Optional.empty()); const versions = getGithubReleases("doitsujin", "dxvk", wizard); - var selectedVersion = wizard.menu(tr("Please select the version."), versions, versions[0]); + const selectedVersion = wizard.menu(tr("Please select the version."), versions, versions[0]); wine.wizard(wizard); // install selected version From b3492bf26bba58474bc60f468c7ad41bce3f59c1 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Thu, 7 Nov 2019 22:52:36 +0100 Subject: [PATCH 15/37] Update script.js --- Engines/Wine/Verbs/DXVK/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index d6088bac05..d6373e4c26 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -47,7 +47,7 @@ class DXVK { return this; } if (answer == "NO, quit script alltogether") { - throw "User aborted the script."; + throw new Error("User aborted the script."); } } else { From 15df2d4dca05657c40d9df2ae35b4e28c4d63823 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Tue, 26 Nov 2019 10:18:04 +0100 Subject: [PATCH 16/37] Update script.js --- Engines/Wine/Verbs/DXVK/script.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index d6373e4c26..71f37f011b 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -39,16 +39,18 @@ class DXVK { if (operatingSystemFetcher.fetchCurrentOperationSystem().getFullName() !== "Linux") { - const answer = uiQuestionFactory.create( - tr("D9VK is currently unsupported on non-Linux operating systems due to MoltenVK implementation being incomplete. Select how do you want to approach this situation."), - ["YES, continue with D9VK installation regardless", "NO, quit script alltogether", "Exit D9VK Installer, but continue with the script"] - ); - if (!answer || answer == "Exit D9VK Installer, but continue with the script") { + const answer = wizard.menu( + tr("DXVK is currently unsupported on non-Linux operating systems due to MoltenVK implementation being incomplete. Select how do you want to approach this situation.", + ["YES, continue with DXVK installation regardless", "NO, quit script alltogether", "Exit DXVK Installer, but continue with the script"] + ); + + if (answer.text === "Exit DXVK Installer, but continue with the script") { return this; - } - if (answer == "NO, quit script alltogether") { + } + + if (answer.text === "NO, quit script alltogether" || !answer) { throw new Error("User aborted the script."); - } + } } else { this.wizard().message(tr("Please ensure you have the latest drivers (418.30 minimum for NVIDIA and mesa 19 for AMD) or else DXVK might not work correctly.")); From f7ee32c108db3bbd33b88223f14c6613a5b9ddac Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Tue, 26 Nov 2019 22:59:00 +0100 Subject: [PATCH 17/37] Update script.js --- Engines/Wine/Verbs/DXVK/script.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index 71f37f011b..30a06fb91c 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -54,7 +54,7 @@ class DXVK { } else { this.wizard().message(tr("Please ensure you have the latest drivers (418.30 minimum for NVIDIA and mesa 19 for AMD) or else DXVK might not work correctly.")); - + } if (typeof this.dxvkVersion !== "string") { const versions = getGithubReleases("doitsujin", "dxvk", wizard); this.dxvkVersion = versions[0]; @@ -101,7 +101,8 @@ class DXVK { static install(container) { const wine = new Wine(); const wizard = SetupWizard(InstallationType.VERBS, "DXVK", Optional.empty()); - + + wine.prefix(container); const versions = getGithubReleases("doitsujin", "dxvk", wizard); const selectedVersion = wizard.menu(tr("Please select the version."), versions, versions[0]); wine.wizard(wizard); From 63fb95e406e00f6e8078d1d707166b6373834830 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Wed, 27 Nov 2019 23:20:06 +0100 Subject: [PATCH 18/37] Update script.js --- Engines/Wine/Verbs/DXVK/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index 30a06fb91c..66f4b6fc80 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -53,7 +53,7 @@ class DXVK { } } else { - this.wizard().message(tr("Please ensure you have the latest drivers (418.30 minimum for NVIDIA and mesa 19 for AMD) or else DXVK might not work correctly.")); + wizard().message(tr("Please ensure you have the latest drivers (418.30 minimum for NVIDIA and mesa 19 for AMD) or else DXVK might not work correctly.")); } if (typeof this.dxvkVersion !== "string") { const versions = getGithubReleases("doitsujin", "dxvk", wizard); From 92303e11eaf4a903f2410c4e69e556bef182f74f Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Wed, 27 Nov 2019 23:23:32 +0100 Subject: [PATCH 19/37] Update script.js Code cleanup --- Engines/Wine/Verbs/DXVK/script.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index 66f4b6fc80..0cb6173791 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -102,10 +102,11 @@ class DXVK { const wine = new Wine(); const wizard = SetupWizard(InstallationType.VERBS, "DXVK", Optional.empty()); + wine.wizard(wizard); wine.prefix(container); + const versions = getGithubReleases("doitsujin", "dxvk", wizard); const selectedVersion = wizard.menu(tr("Please select the version."), versions, versions[0]); - wine.wizard(wizard); // install selected version new DXVK(wine).withVersion(selectedVersion.text).go(); From 14be53e6fcc439ebeb75c9c7dff594de496f7e47 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Thu, 28 Nov 2019 00:12:45 +0100 Subject: [PATCH 20/37] Update script.js eslint fix --- Engines/Wine/Verbs/DXVK/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index 0cb6173791..5a91c04ea0 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -42,7 +42,7 @@ class DXVK { const answer = wizard.menu( tr("DXVK is currently unsupported on non-Linux operating systems due to MoltenVK implementation being incomplete. Select how do you want to approach this situation.", ["YES, continue with DXVK installation regardless", "NO, quit script alltogether", "Exit DXVK Installer, but continue with the script"] - ); + ) if (answer.text === "Exit DXVK Installer, but continue with the script") { return this; From 215c22d1e510cb41ba657978ac1b6721f4c8ba14 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Thu, 28 Nov 2019 09:38:55 +0100 Subject: [PATCH 21/37] Update script.js eslint fix --- Engines/Wine/Verbs/DXVK/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index 5a91c04ea0..2a6bf5ec2b 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -42,7 +42,7 @@ class DXVK { const answer = wizard.menu( tr("DXVK is currently unsupported on non-Linux operating systems due to MoltenVK implementation being incomplete. Select how do you want to approach this situation.", ["YES, continue with DXVK installation regardless", "NO, quit script alltogether", "Exit DXVK Installer, but continue with the script"] - ) + )) if (answer.text === "Exit DXVK Installer, but continue with the script") { return this; From 1b1d27ccef48fb386bc3c1717e022fbc0142f6a5 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Thu, 28 Nov 2019 09:44:53 +0100 Subject: [PATCH 22/37] Update script.js Indentation fixes, trailing spaces removal --- Engines/Wine/Verbs/DXVK/script.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index 2a6bf5ec2b..1d7a0596ab 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -41,16 +41,16 @@ class DXVK { { const answer = wizard.menu( tr("DXVK is currently unsupported on non-Linux operating systems due to MoltenVK implementation being incomplete. Select how do you want to approach this situation.", - ["YES, continue with DXVK installation regardless", "NO, quit script alltogether", "Exit DXVK Installer, but continue with the script"] - )) + ["YES, continue with DXVK installation regardless", "NO, quit script alltogether", "Exit DXVK Installer, but continue with the script"] + )) - if (answer.text === "Exit DXVK Installer, but continue with the script") { + if (answer.text === "Exit DXVK Installer, but continue with the script") { return this; - } + } - if (answer.text === "NO, quit script alltogether" || !answer) { + if (answer.text === "NO, quit script alltogether" || !answer) { throw new Error("User aborted the script."); - } + } } else { wizard().message(tr("Please ensure you have the latest drivers (418.30 minimum for NVIDIA and mesa 19 for AMD) or else DXVK might not work correctly.")); @@ -104,7 +104,7 @@ class DXVK { wine.wizard(wizard); wine.prefix(container); - + const versions = getGithubReleases("doitsujin", "dxvk", wizard); const selectedVersion = wizard.menu(tr("Please select the version."), versions, versions[0]); From 484077c0aa0308e454d24d08b7fbbe8d2002fdac Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Thu, 28 Nov 2019 10:06:35 +0100 Subject: [PATCH 23/37] Update script.js --- Engines/Wine/Verbs/DXVK/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index 1d7a0596ab..e0f460529b 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -101,7 +101,7 @@ class DXVK { static install(container) { const wine = new Wine(); const wizard = SetupWizard(InstallationType.VERBS, "DXVK", Optional.empty()); - + wine.wizard(wizard); wine.prefix(container); From e6cf22064d7f6906413b89eb65e0977acac22a90 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Thu, 28 Nov 2019 10:10:54 +0100 Subject: [PATCH 24/37] Update script.js why can't codacy tell me of all trailing spaces at once?! --- Engines/Wine/Verbs/DXVK/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index e0f460529b..dc4fb66edf 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -47,7 +47,7 @@ class DXVK { if (answer.text === "Exit DXVK Installer, but continue with the script") { return this; } - + if (answer.text === "NO, quit script alltogether" || !answer) { throw new Error("User aborted the script."); } From 8813e14eb764abdcc5e8a93de0643e711c48a187 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Thu, 28 Nov 2019 14:24:09 +0100 Subject: [PATCH 25/37] Update script.js --- Engines/Wine/Verbs/DXVK/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index dc4fb66edf..62be31a56c 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -43,7 +43,7 @@ class DXVK { tr("DXVK is currently unsupported on non-Linux operating systems due to MoltenVK implementation being incomplete. Select how do you want to approach this situation.", ["YES, continue with DXVK installation regardless", "NO, quit script alltogether", "Exit DXVK Installer, but continue with the script"] )) - + if (answer.text === "Exit DXVK Installer, but continue with the script") { return this; } From 85008148d3c6411f2e7f74c261c7b34e2d2387a1 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Thu, 28 Nov 2019 16:33:39 +0100 Subject: [PATCH 26/37] Update script.js --- Engines/Wine/Verbs/DXVK/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index 62be31a56c..5e1badf1e0 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -36,7 +36,7 @@ class DXVK { const architecture = this.wine.architecture(); print("NOTE: wine version should be greater or equal to 3.10"); - + if (operatingSystemFetcher.fetchCurrentOperationSystem().getFullName() !== "Linux") { const answer = wizard.menu( From 3a2dc094d0db369f4b8d19cf4056d4d6099e2c11 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Thu, 28 Nov 2019 21:39:22 +0100 Subject: [PATCH 27/37] Update script.js --- Engines/Wine/Verbs/DXVK/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index 5e1badf1e0..deb444fe0f 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -28,7 +28,7 @@ class DXVK { return this; } - + go() { const wizard = this.wine.wizard(); const prefixDirectory = this.wine.prefixDirectory(); From 1cc51e5954ff64ce46c4f428a8808db2d8678c31 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Fri, 29 Nov 2019 10:34:44 +0100 Subject: [PATCH 28/37] Update script.js Now supports translation of the options --- Engines/Wine/Verbs/DXVK/script.js | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index deb444fe0f..222c758340 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -39,17 +39,24 @@ class DXVK { if (operatingSystemFetcher.fetchCurrentOperationSystem().getFullName() !== "Linux") { - const answer = wizard.menu( - tr("DXVK is currently unsupported on non-Linux operating systems due to MoltenVK implementation being incomplete. Select how do you want to approach this situation.", - ["YES, continue with DXVK installation regardless", "NO, quit script alltogether", "Exit DXVK Installer, but continue with the script"] - )) - - if (answer.text === "Exit DXVK Installer, but continue with the script") { - return this; - } - - if (answer.text === "NO, quit script alltogether" || !answer) { - throw new Error("User aborted the script."); + const question = tr("DXVK is currently unsupported on non-Linux operating systems due to MoltenVK implementation being incomplete. Select how do you want to approach this situation.") + const choices = [ + tr("YES, continue with DXVK installation regardless"), + tr("NO, quit script alltogether"), + tr("Exit DXVK Installer, but continue with the script") + ]; + + const answer = wizard.menu(question, choices); + + switch (answer.index) { + case 1: + // choice: "NO, quit script alltogether" + throw new Error("User aborted the script."); + case 2: + // choice: "Exit DXVK Installer, but continue with the script" + return this; + default: + // do nothing } } else { From ef500ccd0d0161958f791e4fdebb981ad895fac5 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Fri, 29 Nov 2019 19:01:53 +0100 Subject: [PATCH 29/37] Update script.js --- Engines/Wine/Verbs/DXVK/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index 222c758340..6406ba2a2a 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -60,7 +60,7 @@ class DXVK { } } else { - wizard().message(tr("Please ensure you have the latest drivers (418.30 minimum for NVIDIA and mesa 19 for AMD) or else DXVK might not work correctly.")); + wizard.message(tr("Please ensure you have the latest drivers (418.30 minimum for NVIDIA and mesa 19 for AMD) or else DXVK might not work correctly.")); } if (typeof this.dxvkVersion !== "string") { const versions = getGithubReleases("doitsujin", "dxvk", wizard); From 5d9a2b9aec9864185e7af11f1a81f34a35dda601 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Wed, 4 Dec 2019 11:23:36 +0100 Subject: [PATCH 30/37] Update script.js --- Engines/Wine/Verbs/DXVK/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index 6406ba2a2a..cbb9ed40ce 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -70,7 +70,7 @@ class DXVK { const setupFile = new Resource() .wizard(wizard) .url( - `https://github.com/doitsujin/dxvk/releases/download/v${this.dxvkVersion}/dxvk-${this.dxvkVersion}.tar.gz` + `https://github.com/doitsujin/dxvk/releases/download/${this.dxvkVersion}/dxvk-${this.dxvkVersion}.tar.gz` ) .name(`dxvk-${this.dxvkVersion}.tar.gz`) .get(); From 2d3e9dc110854b0026283f1323c3c92376d1c36b Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Sun, 29 Dec 2019 11:25:17 +0100 Subject: [PATCH 31/37] Update script.js Using an array --- Engines/Wine/Verbs/DXVK/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index cbb9ed40ce..054e35c4c6 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -67,7 +67,7 @@ class DXVK { this.dxvkVersion = versions[0]; } - const setupFile = new Resource() + const [setupFile] = new Resource() .wizard(wizard) .url( `https://github.com/doitsujin/dxvk/releases/download/${this.dxvkVersion}/dxvk-${this.dxvkVersion}.tar.gz` From b93aca94c45fd98fb19805cfe915be36c55cb064 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Sun, 29 Dec 2019 16:23:07 +0100 Subject: [PATCH 32/37] Update script.js Script update in accord to https://github.com/PhoenicisOrg/scripts/pull/1154 --- Engines/Wine/Verbs/DXVK/script.js | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index 054e35c4c6..2ab61020a2 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -1,11 +1,10 @@ const Wine = include("engines.wine.engine.object"); -const Resource = include("utils.functions.net.resource"); const { Extractor } = include("utils.functions.filesystem.extract"); const { ls, cp, cat, remove } = include("utils.functions.filesystem.files"); const operatingSystemFetcher = Bean("operatingSystemFetcher"); const Optional = Java.type("java.util.Optional"); const OverrideDLL = include("engines.wine.plugins.override_dll"); -const { getGithubReleases } = include("utils.functions.net.githubreleases"); +const { GitHubReleaseDownloader } = include("utils.functions.net.githubreleases"); /** * Verb to install DXVK @@ -62,18 +61,16 @@ class DXVK { else { wizard.message(tr("Please ensure you have the latest drivers (418.30 minimum for NVIDIA and mesa 19 for AMD) or else DXVK might not work correctly.")); } + const githubDownloader = new GitHubReleaseDownloader("doitsujin", "dxvk") + .withWizard(wizard); + + githubDownloader.fetchReleases(); + if (typeof this.dxvkVersion !== "string") { - const versions = getGithubReleases("doitsujin", "dxvk", wizard); - this.dxvkVersion = versions[0]; + this.dxvkVersion = githubDownloader.getLatestRelease(); } - const [setupFile] = new Resource() - .wizard(wizard) - .url( - `https://github.com/doitsujin/dxvk/releases/download/${this.dxvkVersion}/dxvk-${this.dxvkVersion}.tar.gz` - ) - .name(`dxvk-${this.dxvkVersion}.tar.gz`) - .get(); + const [setupFile] = githubDownloader.download(this.dxvkVersion); new Extractor() .wizard(wizard) @@ -112,8 +109,15 @@ class DXVK { wine.wizard(wizard); wine.prefix(container); - const versions = getGithubReleases("doitsujin", "dxvk", wizard); - const selectedVersion = wizard.menu(tr("Please select the version."), versions, versions[0]); + const githubDownloader = new GitHubReleaseDownloader("doitsujin", "dxvk") + .withWizard(wizard); + + githubDownloader.fetchReleases(); + + const versions = githubDownloader.getReleases(); + const latestVersion = githubDownloader.getLatestRelease(); + + const selectedVersion = wizard.menu(tr("Please select the version."), versions, latestVersion); // install selected version new DXVK(wine).withVersion(selectedVersion.text).go(); From e80cc997c006bab0dea47b5f16e8b52afc7c8214 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Sun, 29 Dec 2019 16:26:58 +0100 Subject: [PATCH 33/37] Update script.js --- Engines/Wine/Verbs/DXVK/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index 2ab61020a2..41db00a767 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -63,7 +63,7 @@ class DXVK { } const githubDownloader = new GitHubReleaseDownloader("doitsujin", "dxvk") .withWizard(wizard); - + githubDownloader.fetchReleases(); if (typeof this.dxvkVersion !== "string") { From 330fb7db92c2273c3f4453559f01d3f6b07099b2 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Wed, 1 Jan 2020 17:43:35 +0100 Subject: [PATCH 34/37] Update script.js Fix for the issue mentioned in my last comment. --- Engines/Wine/Verbs/DXVK/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index 41db00a767..85778c1061 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -78,7 +78,7 @@ class DXVK { .to(`${prefixDirectory}/TMP/`) .extract(); - const dxvkTmpDir = `${prefixDirectory}/TMP/dxvk-${this.dxvkVersion}`; + const dxvkTmpDir = `${prefixDirectory}/TMP/dxvk-${this.dxvkVersion.substring(1)}`; //Copy 32 bits dll to system* and apply override ls(`${dxvkTmpDir}/x32`).forEach(file => { From 62b7adf7bf46461ae1586449f5c1eacd770b0ecd Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Thu, 2 Jan 2020 16:18:05 +0100 Subject: [PATCH 35/37] Update script.js --- Engines/Wine/Verbs/DXVK/script.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index 85778c1061..8c50f332ab 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -61,8 +61,7 @@ class DXVK { else { wizard.message(tr("Please ensure you have the latest drivers (418.30 minimum for NVIDIA and mesa 19 for AMD) or else DXVK might not work correctly.")); } - const githubDownloader = new GitHubReleaseDownloader("doitsujin", "dxvk") - .withWizard(wizard); + const githubDownloader = new GitHubReleaseDownloader("doitsujin", "dxvk", wizard); githubDownloader.fetchReleases(); From 099d53865cea31352a8eedcf257c3e50271a638c Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Fri, 3 Jan 2020 12:03:02 +0100 Subject: [PATCH 36/37] Update script.js --- Engines/Wine/Verbs/DXVK/script.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index 8c50f332ab..89dfd77527 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -108,8 +108,7 @@ class DXVK { wine.wizard(wizard); wine.prefix(container); - const githubDownloader = new GitHubReleaseDownloader("doitsujin", "dxvk") - .withWizard(wizard); + const githubDownloader = new GitHubReleaseDownloader("doitsujin", "dxvk", wizard); githubDownloader.fetchReleases(); From a0255289712c8105c4afe47a0a5243e1ac29a824 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Fri, 3 Jan 2020 12:08:16 +0100 Subject: [PATCH 37/37] Update script.js --- Engines/Wine/Verbs/DXVK/script.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Engines/Wine/Verbs/DXVK/script.js b/Engines/Wine/Verbs/DXVK/script.js index 89dfd77527..9a586fdd12 100644 --- a/Engines/Wine/Verbs/DXVK/script.js +++ b/Engines/Wine/Verbs/DXVK/script.js @@ -63,8 +63,6 @@ class DXVK { } const githubDownloader = new GitHubReleaseDownloader("doitsujin", "dxvk", wizard); - githubDownloader.fetchReleases(); - if (typeof this.dxvkVersion !== "string") { this.dxvkVersion = githubDownloader.getLatestRelease(); } @@ -110,8 +108,6 @@ class DXVK { const githubDownloader = new GitHubReleaseDownloader("doitsujin", "dxvk", wizard); - githubDownloader.fetchReleases(); - const versions = githubDownloader.getReleases(); const latestVersion = githubDownloader.getLatestRelease();