-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9148190
commit 8343f17
Showing
2 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
include(["engines", "wine", "engine", "object"]); | ||
include(["engines", "wine", "plugins", "override_dll"]); | ||
include(["utils", "functions", "net", "resource"]); | ||
include(["utils", "functions", "filesystem", "files"]); | ||
|
||
/** | ||
* Verb to install FAudio | ||
* see: https://github.com/Kron4ek/FAudio-Builds | ||
* @param {String} faudioVersion version of FAudio to downlaod | ||
* @returns {Wine} Wine object | ||
*/ | ||
Wine.prototype.faudio = function (faudioVersion) { | ||
if(typeof faudioVersion !== 'string') | ||
faudioVersion = "19.01"; | ||
|
||
var setupFile = new Resource() | ||
.wizard(this.wizard()) | ||
.url("https://github.com/Kron4ek/FAudio-Builds/releases/download/" + faudioVersion + "/faudio-" + faudioVersion + ".tar.xz") | ||
.name("faudio-" + faudioVersion + ".tar.xz") | ||
.get(); | ||
|
||
new Extractor() | ||
.wizard(this.wizard()) | ||
.archive(setupFile) | ||
.to(this.prefixDirectory() + "/FAudio/") | ||
.extract(); | ||
|
||
var forEach = Array.prototype.forEach; | ||
var sys32dir = this.system32directory(); | ||
var sys64dir = this.system64directory(); | ||
var faudioDir = this.prefixDirectory() + "/FAudio/faudio-" + faudioVersion; | ||
var self = this; | ||
|
||
forEach.call(ls(faudioDir + "/x32"), function (file) { | ||
if (file.endsWith(".dll")) { | ||
cp(faudioDir + "/x32/" + file, sys32dir); | ||
self.overrideDLL() | ||
.set("native", [file]) | ||
.do(); | ||
} | ||
}); | ||
|
||
if (this.architecture() == "amd64") | ||
{ | ||
forEach.call(ls(faudioDir + "/x64"), function (file) { | ||
if (file.endsWith(".dll")) { | ||
cp(faudioDir + "/x64/" + file, sys64dir); | ||
} | ||
}); | ||
} | ||
|
||
return this; | ||
} | ||
|
||
/** | ||
* Verb to install FAudio | ||
*/ | ||
var verbImplementation = { | ||
install: function (container) { | ||
var wine = new Wine(); | ||
wine.prefix(container); | ||
var wizard = SetupWizard(InstallationType.VERBS, "FAudio", java.util.Optional.empty()); | ||
wine.wizard(wizard); | ||
wine.faudio(); | ||
wizard.close(); | ||
} | ||
}; | ||
|
||
/* exported Verb */ | ||
var Verb = Java.extend(org.phoenicis.engines.Verb, verbImplementation); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"scriptName" : "faudio", | ||
"id" : "faudio", | ||
"compatibleOperatingSystems" : [ | ||
"LINUX" | ||
], | ||
"testingOperatingSystems" : [ | ||
"LINUX" | ||
], | ||
"free" : true, | ||
"requiresPatch" : false | ||
} |