From 60481eca76b2b825d03fcc4e30557f6c6849a200 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Wed, 19 Dec 2018 01:18:59 +0100 Subject: [PATCH 1/4] Update script.js Rewrote the script to download the latest version of vulkan SDK and reworked how the json file is handled. --- Engines/Wine/Verbs/vulkanSDK/script.js | 38 ++++++-------------------- 1 file changed, 8 insertions(+), 30 deletions(-) diff --git a/Engines/Wine/Verbs/vulkanSDK/script.js b/Engines/Wine/Verbs/vulkanSDK/script.js index b937660b0f..d2a1f17094 100644 --- a/Engines/Wine/Verbs/vulkanSDK/script.js +++ b/Engines/Wine/Verbs/vulkanSDK/script.js @@ -12,44 +12,22 @@ Wine.prototype.vulkanSDK = function () { print("NOTE: you need a graphic driver that supports Vulkan to run winevulkan"); print("NOTE: Vulkan works in wine from version 3.3 (if compiled with vulkan support)"); - var sdkVersion = "1.1.73.0"; - var setupFile = new Resource() .wizard(this.wizard()) - .url("https://sdk.lunarg.com/sdk/download/" + sdkVersion +"/windows/VulkanSDK-" + sdkVersion + "-Installer.exe") - .checksum("ac34f732818c409bcb283b5c6100b373ab6a2404") - .name("VulkanSDK-" + sdkVersion + "-Installer.exe") + .url("https://sdk.lunarg.com/sdk/download/latest/windows/vulkan-sdk.exe?u=") + //checksum changes everytime a new version is released + .name("vulkan-sdk.exe") .get(); this.run(setupFile, "/S"); - var pathVulkanJSON = this.prefixDirectory() + "drive_c/windows/winevulkan.json" - var contentVulkanJSON = '{\n' + - ' "file_format_version": "1.0.0",\n' + - ' "ICD": {\n' + - ' "library_path": "c:\\windows\\system32\\winevulkan.dll",\n' + - ' "api_version": "' + sdkVersion +'"\n' + - ' }\n' + - '}' - - writeToFile(pathVulkanJSON, contentVulkanJSON); - - var regeditFileContent32 = - "REGEDIT4\n" + - "\n" + - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Khronos\\Vulkan\\Drivers\\]\n" + - "\"C:\\\\Windows\\\\winevulkan.json\"=dword:00000000" ; - - this.regedit().patch(regeditFileContent32); + var contentVulkanJSON = this.prefixDirectory() + "drive_c/windows/winevulkan.json"; + touch(contentVulkanJSON); + writeToFile(contentVulkanJSON, "{\n ""file_format_version"": "1.0.0",\n ""ICD"": {\n ""library_path"": ""c:\windows\system32\winevulkan.dll"",\n ""api_version"": ""1.1.92.1""\n }\n}"); + this.run("reg", ["add", "HKLM\Software\Khronos\Vulkan\Drivers", "/v", "C:\Windows\winevulkan.json", "/t", "REG_DWORD", "/d", "00000000", "/f"], null, false, true); if (this.architecture() == "amd64") { - var regeditFileContent64 = - "REGEDIT4\n" + - "\n" + - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Khronos\\Vulkan\\Drivers\\]n" + - "\"C:\\\\Windows\\\\winevulkan.json\"=dword:00000000" ; - - this.regedit().patch(regeditFileContent64); + this.run("reg", ["add", "HKLM\Software\Wow6432Node\Khronos\Vulkan\Drivers", "/v", "C:\Windows\winevulkan.json", "/t", "REG_DWORD", "/d", "00000000", "/f"], null, false, true); } return this; From cf7e69522630019eb90ca99d2ca6b15a159ef933 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Wed, 19 Dec 2018 18:15:30 +0100 Subject: [PATCH 2/4] Update script.js Restored verb implementation. --- Engines/Wine/Verbs/vulkanSDK/script.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Engines/Wine/Verbs/vulkanSDK/script.js b/Engines/Wine/Verbs/vulkanSDK/script.js index 894d9e3ba9..eb2868535b 100644 --- a/Engines/Wine/Verbs/vulkanSDK/script.js +++ b/Engines/Wine/Verbs/vulkanSDK/script.js @@ -32,4 +32,21 @@ Wine.prototype.vulkanSDK = function () { return this; -} \ No newline at end of file +} + +/** + * Verb to install all the necessary things to run winevulkan (even inside wine mainline or newest wine-staging) +*/ +var verbImplementation = { + install: function (container) { + var wine = new Wine(); + wine.prefix(container); + var wizard = SetupWizard(InstallationType.VERBS, "vulkanSDK", java.util.Optional.empty()); + wine.wizard(wizard); + wine.vulkanSDK(); + wizard.close(); + } +}; + +/* exported Verb */ +var Verb = Java.extend(org.phoenicis.engines.Verb, verbImplementation); From f84054300e765f509f4447e64e064cc611e33186 Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Wed, 19 Dec 2018 18:52:25 +0100 Subject: [PATCH 3/4] Update script.js Changed variable name. --- Engines/Wine/Verbs/vulkanSDK/script.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Engines/Wine/Verbs/vulkanSDK/script.js b/Engines/Wine/Verbs/vulkanSDK/script.js index eb2868535b..66db29fddb 100644 --- a/Engines/Wine/Verbs/vulkanSDK/script.js +++ b/Engines/Wine/Verbs/vulkanSDK/script.js @@ -21,9 +21,9 @@ Wine.prototype.vulkanSDK = function () { this.run(setupFile, "/S"); - var contentVulkanJSON = this.prefixDirectory() + "drive_c/windows/winevulkan.json"; - touch(contentVulkanJSON); - writeToFile(contentVulkanJSON, "{\n ""file_format_version"": "1.0.0",\n ""ICD"": {\n ""library_path"": ""c:\windows\system32\winevulkan.dll"",\n ""api_version"": ""1.1.92.1""\n }\n}"); + var patchVulkanJSON = this.prefixDirectory() + "drive_c/windows/winevulkan.json"; + touch(patchVulkanJSON); + writeToFile(patchVulkanJSON, "{\n ""file_format_version"": "1.0.0",\n ""ICD"": {\n ""library_path"": ""c:\windows\system32\winevulkan.dll"",\n ""api_version"": ""1.1.92.1""\n }\n}"); this.run("reg", ["add", "HKLM\Software\Khronos\Vulkan\Drivers", "/v", "C:\Windows\winevulkan.json", "/t", "REG_DWORD", "/d", "00000000", "/f"], null, false, true); if (this.architecture() == "amd64") { From fb6f4e7e8baa7e6148d0655d69d7b09e137a585f Mon Sep 17 00:00:00 2001 From: Zemogiter Date: Thu, 10 Jan 2019 19:57:14 +0100 Subject: [PATCH 4/4] Update script.js Fixed the extra `"` inside the 2nd parm of `writeToFile` crashing the installer. --- Engines/Wine/Verbs/vulkanSDK/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engines/Wine/Verbs/vulkanSDK/script.js b/Engines/Wine/Verbs/vulkanSDK/script.js index 66db29fddb..126442d5a3 100644 --- a/Engines/Wine/Verbs/vulkanSDK/script.js +++ b/Engines/Wine/Verbs/vulkanSDK/script.js @@ -23,7 +23,7 @@ Wine.prototype.vulkanSDK = function () { var patchVulkanJSON = this.prefixDirectory() + "drive_c/windows/winevulkan.json"; touch(patchVulkanJSON); - writeToFile(patchVulkanJSON, "{\n ""file_format_version"": "1.0.0",\n ""ICD"": {\n ""library_path"": ""c:\windows\system32\winevulkan.dll"",\n ""api_version"": ""1.1.92.1""\n }\n}"); + writeToFile(patchVulkanJSON, "{\n \"file_format_version\": \"1.0.0\",\n \"ICD\": {\n \"library_path\": \"c:\windows\system32\winevulkan.dll\",\n \"api_version\": \"1.1.92.1\"\n }\n}"); this.run("reg", ["add", "HKLM\Software\Khronos\Vulkan\Drivers", "/v", "C:\Windows\winevulkan.json", "/t", "REG_DWORD", "/d", "00000000", "/f"], null, false, true); if (this.architecture() == "amd64") {