Skip to content
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a442c9c
Update script.js
Zemogiter Jun 25, 2019
2b4f53f
Update script.js
Zemogiter Jun 25, 2019
f61b7cb
Update script.js
Zemogiter Jun 25, 2019
e683104
Update script.js
Zemogiter Jun 25, 2019
fcd8791
Update script.js
Zemogiter Jun 25, 2019
bccd621
Update script.js
Zemogiter Jun 25, 2019
94db172
Update script.js
Zemogiter Jun 26, 2019
71834c2
Update script.js
Zemogiter Jun 27, 2019
afb866f
Update script.js
Zemogiter Jun 29, 2019
f47a4b6
Merge branch 'master' into patch-1
Zemogiter Jul 3, 2019
ad637d0
Update script.js
Zemogiter Jul 28, 2019
ea5f89c
Update script.js
Zemogiter Aug 24, 2019
7045857
Merge branch 'master' into patch-1
Zemogiter Oct 30, 2019
29e05a9
Update script.js
Zemogiter Oct 30, 2019
09b7a64
Update script.js
Zemogiter Oct 31, 2019
af78eda
Update script.js
Zemogiter Nov 2, 2019
b3492bf
Update script.js
Zemogiter Nov 7, 2019
15df2d4
Update script.js
Zemogiter Nov 26, 2019
f7ee32c
Update script.js
Zemogiter Nov 26, 2019
63fb95e
Update script.js
Zemogiter Nov 27, 2019
92303e1
Update script.js
Zemogiter Nov 27, 2019
14be53e
Update script.js
Zemogiter Nov 27, 2019
215c22d
Update script.js
Zemogiter Nov 28, 2019
1b1d27c
Update script.js
Zemogiter Nov 28, 2019
484077c
Update script.js
Zemogiter Nov 28, 2019
e6cf220
Update script.js
Zemogiter Nov 28, 2019
8813e14
Update script.js
Zemogiter Nov 28, 2019
8500814
Update script.js
Zemogiter Nov 28, 2019
3a2dc09
Update script.js
Zemogiter Nov 28, 2019
1cc51e5
Update script.js
Zemogiter Nov 29, 2019
ef500cc
Update script.js
Zemogiter Nov 29, 2019
5d9a2b9
Update script.js
Zemogiter Dec 4, 2019
2d3e9dc
Update script.js
Zemogiter Dec 29, 2019
b93aca9
Update script.js
Zemogiter Dec 29, 2019
e80cc99
Update script.js
Zemogiter Dec 29, 2019
330fb7d
Update script.js
Zemogiter Jan 1, 2020
62b7adf
Update script.js
Zemogiter Jan 2, 2020
099d538
Update script.js
Zemogiter Jan 3, 2020
a025528
Update script.js
Zemogiter Jan 3, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 34 additions & 83 deletions Engines/Wine/Verbs/DXVK/script.js
Original file line number Diff line number Diff line change
@@ -1,13 +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 { GitHubReleaseDownloader } = include("utils.functions.net.githubreleases");

/**
* Verb to install DXVK
Expand Down Expand Up @@ -39,45 +36,46 @@ class DXVK {

print("NOTE: wine version should be greater or equal to 3.10");

if (operatingSystemFetcher.fetchCurrentOperationSystem() != "Linux") {
wizard.message(
tr(
"DXVK might not work correctly on macOS. This is depending on Metal api support and MoltenVK compatibility layer advancement"
)
);
} 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."
)
);
if (operatingSystemFetcher.fetchCurrentOperationSystem().getFullName() !== "Linux")
{
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.")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still believe that this decision is too complicated for many users.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I still thing otherwise.

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 {
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", wizard);

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", "");
this.dxvkVersion = githubDownloader.getLatestRelease();
}

const setupFile = new Resource()
.wizard(wizard)
.url(
`https://github.com/doitsujin/dxvk/releases/download/v${this.dxvkVersion}/dxvk-${this.dxvkVersion}.tar.gz`
)
.name(`dxvk-${this.dxvkVersion}.tar.gz`)
.get();
const [setupFile] = githubDownloader.download(this.dxvkVersion);

new Extractor()
.wizard(wizard)
.archive(setupFile)
.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 => {
Expand All @@ -101,64 +99,17 @@ class DXVK {

remove(`${prefixDirectory}/TMP/`);
}

static install(container) {
const wine = new Wine();
const wizard = SetupWizard(InstallationType.VERBS, "DXVK", Optional.empty());

wine.prefix(container);
Comment thread
Zemogiter marked this conversation as resolved.
wine.wizard(wizard);
wine.prefix(container);

// 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.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 githubDownloader = new GitHubReleaseDownloader("doitsujin", "dxvk", wizard);

const versions = githubDownloader.getReleases();
const latestVersion = githubDownloader.getLatestRelease();

const selectedVersion = wizard.menu(tr("Please select the version."), versions, latestVersion);

Expand Down