Skip to content
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
06ad52f
Merge pull request #1 from PhoenicisOrg/master
ImperatorS79 Aug 28, 2017
86fd07c
Update script.js
ImperatorS79 Aug 28, 2017
a6f232b
Merge pull request #2 from PhoenicisOrg/master
ImperatorS79 Aug 28, 2017
a80aa84
Merge pull request #3 from PhoenicisOrg/master
ImperatorS79 Sep 26, 2017
6da4a59
Merge pull request #4 from PhoenicisOrg/master
ImperatorS79 Mar 19, 2018
4a11f65
Merge pull request #8 from PhoenicisOrg/master
ImperatorS79 Apr 9, 2018
b2d5724
Merge pull request #9 from PhoenicisOrg/master
ImperatorS79 May 7, 2018
b7d1f0f
Merge pull request #10 from PhoenicisOrg/master
ImperatorS79 May 13, 2018
533df6e
Merge pull request #11 from PhoenicisOrg/master
ImperatorS79 May 22, 2018
186e4ed
Merge pull request #12 from PhoenicisOrg/master
ImperatorS79 May 29, 2018
99cf1db
Merge pull request #13 from PhoenicisOrg/master
ImperatorS79 Jun 13, 2018
87999b4
Merge pull request #15 from PhoenicisOrg/master
ImperatorS79 Oct 10, 2018
610b258
Merge pull request #16 from PhoenicisOrg/master
ImperatorS79 Oct 12, 2018
ad2ea01
Merge pull request #17 from PhoenicisOrg/master
ImperatorS79 Jan 12, 2019
2e53a22
Merge pull request #18 from PhoenicisOrg/master
ImperatorS79 Jan 18, 2019
10f93ca
Merge pull request #20 from PhoenicisOrg/master
ImperatorS79 Feb 2, 2019
ade899d
Merge pull request #21 from PhoenicisOrg/master
ImperatorS79 Feb 27, 2019
db6e1b9
Merge pull request #23 from PhoenicisOrg/master
ImperatorS79 May 9, 2019
e64374c
Runtime
ImperatorS79 May 19, 2019
62bed27
Fix codacy (1st try)
ImperatorS79 May 19, 2019
62b960a
Fix codacy (2nd time)
ImperatorS79 May 19, 2019
ba50f0d
Fix codacy (3rd time)
ImperatorS79 May 19, 2019
d3d6c35
Update script.js
ImperatorS79 May 19, 2019
569f7e8
Update script.js
ImperatorS79 May 19, 2019
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
111 changes: 109 additions & 2 deletions Engines/Wine/Engine/Implementation/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ var engineImplementation = {
return fileExists(this.getLocalDirectory(subCategory, version));
},
install: function (subCategory, version) {
this._installRuntime(this.getWizard());
var parts = subCategory.split("-");
var distribution = parts[0];
var architecture = parts[2];
Expand Down Expand Up @@ -98,6 +99,110 @@ var engineImplementation = {
);
}
},
_installRuntime: function (setupWizard) {
var runtimeJsonPath = this._wineEnginesDirectory + "/runtime.json";
var runtimeJson;
var runtimeJsonFile;
var downloadamd64 = false;
var downloadx86 = false;
if (!fileExists(runtimeJsonPath)) {
mkdir(this._wineEnginesDirectory + "/runtime");
runtimeJsonFile = new Downloader()
.wizard(this._wizard)
.message(tr("Downloading runtime json"))
.url("https://phoenicis.playonlinux.com/index.php/runtime?os=linux")
.to(runtimeJsonPath)
.get();

runtimeJson = JSON.parse(cat(runtimeJsonFile));
downloadamd64 = true;
downloadx86 = true;
}
else {
var oldRuntimeJsonFile = cat(this._wineEnginesDirectory + "/runtime.json");
var oldRuntimeJson = JSON.parse(oldRuntimeJsonFile);

runtimeJsonFile = new Downloader()
.wizard(this._wizard)
.message(tr("Downloading runtime json"))
.url("https://phoenicis.playonlinux.com/index.php/runtime?os=linux")
.to(runtimeJsonPath)
.get();

runtimeJson = JSON.parse(cat(runtimeJsonFile));
var oldCheckSumamd64;
var oldCheckSumx86;
oldRuntimeJson.forEach(function (arch){
if (arch.arch == "amd64") {
oldCheckSumamd64 = arch.sha1sum;
}
else {
oldCheckSumx86 = arch.sha1sum;
}
});
runtimeJson.forEach(function (arch){
if (arch.arch == "amd64" && arch.sha1sum != oldCheckSumamd64){
downloadamd64 = true;
}
else if (arch.arch == "x86" && arch.sha1sum != oldCheckSumx86){
downloadx86 = true;
}
});
}

if (downloadx86 == true) {
remove(this._wineEnginesDirectory + "/runtime/lib");
mkdir(this._wineEnginesDirectory + "/TMP");
that = this;
runtimeJson.forEach(function (arch){
var runtime;

if (arch.arch == "x86") {
runtime = new Downloader()
.wizard(setupWizard)
.url(arch.url)
.message(tr("Downloading x86 runtime"))
.checksum(arch.sha1sum)
.to(that._wineEnginesDirectory + "/TMP/" + arch.url.substring(arch.url.lastIndexOf('/')+1))
.get();

new Extractor()
.wizard(setupWizard)
.archive(runtime)
.to(that._wineEnginesDirectory + "/runtime")
.extract();

}
});
remove(this._wineEnginesDirectory + "/TMP");
}
if (downloadamd64 == true) {
remove(this._wineEnginesDirectory + "/runtime/lib64");
mkdir(this._wineEnginesDirectory + "/TMP");
var that = this;
runtimeJson.forEach(function (arch){
var runtime;

if (arch.arch == "amd64") {
runtime = new Downloader()
.wizard(setupWizard)
.url(arch.url)
.message(tr("Downloading amd64 runtime"))
.checksum(arch.sha1sum)
.to(that._wineEnginesDirectory + "/TMP/" + arch.url.substring(arch.url.lastIndexOf('/')+1))
.get();

new Extractor()
.wizard(setupWizard)
.archive(runtime)
.to(that._wineEnginesDirectory + "/runtime")
.extract();

}
});
remove(this._wineEnginesDirectory + "/TMP");
}
},
_installGecko: function (setupWizard, winePackage, localDirectory) {
if (winePackage.geckoUrl) {
var gecko = new Resource()
Expand Down Expand Up @@ -253,9 +358,11 @@ var engineImplementation = {
ldPath = userData.ldPath + ldPath;
}
if (architecture == "amd64") {
ldPath = this.getLocalDirectory(subCategory, version) + "/lib64/:" + ldPath
ldPath = this._wineEnginesDirectory + "runtime/lib64/:" + this._wineEnginesDirectory + "runtime/lib/:"
+ this.getLocalDirectory(subCategory, version) + "/lib64/:"
+ this.getLocalDirectory(subCategory, version) + "/lib/:"+ ldPath;
} else {
ldPath = this.getLocalDirectory(subCategory, version) + "/lib/:" + ldPath
ldPath = this._wineEnginesDirectory + "runtime/lib/:" + this.getLocalDirectory(subCategory, version) + "/lib/:" + ldPath;
}
environment.put("LD_LIBRARY_PATH", ldPath);

Expand Down