-
Notifications
You must be signed in to change notification settings - Fork 47
Add Mf workaround #1149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add Mf workaround #1149
Changes from 33 commits
254649c
63f898c
71cd3d8
60c3cb5
69e7bf2
5bf56fe
1c4fe31
66bd276
1791c28
9d473d3
afeb994
25b45d5
43932a3
8db0264
2cfd676
8b7a82a
b1b30ac
c21fb41
923f809
d3b3b61
dc204af
5bc1ecc
a14bba6
184a82f
efa743f
a0a1cd0
db1fc7b
d877dde
f1bb146
c055748
bdc3a58
71b7440
1e022ba
a9e3e1e
2bb2a27
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
const Wine = include("engines.wine.engine.object"); | ||
const Resource = include("utils.functions.net.resource"); | ||
const { Extractor } = include("utils.functions.filesystem.extract"); | ||
const { ls, cp } = include("utils.functions.filesystem.files"); | ||
//const { getGithubReleases } = include("utils.functions.net.githubreleases"); commented out because it's useless until z0z0z will use releases | ||
|
||
const Optional = Java.type("java.util.Optional"); | ||
const Regedit = include("engines.wine.plugins.regedit"); | ||
const Regsvr32 = include("engines.wine.plugins.regsvr32"); | ||
const OverrideDLL = include("engines.wine.plugins.override_dll"); | ||
|
||
/** | ||
* Verb to install Media Foundation workaround | ||
* see: https://github.com/z0z0z/mf-install | ||
*/ | ||
class MFWorkaround { | ||
constructor(wine) { | ||
this.wine = wine; | ||
} | ||
|
||
/** | ||
* Sets the used mfWorkaround version | ||
* | ||
* @param {string} mfWorkaroundVersion The version of mfWorkaround to downlaod | ||
* @returns {mfWorkaround} The mfWorkaround object | ||
*/ | ||
|
||
go() { | ||
const wizard = this.wine.wizard(); | ||
const prefixDirectory = this.wine.prefixDirectory(); | ||
const system32directory = this.wine.system32directory(); | ||
const system64directory = this.wine.system64directory(); | ||
|
||
//commented out because it's useless until z0z0z will use releases | ||
/*if (typeof this.mfWorkaroundVersion !== "string") { | ||
const versions = getGithubReleases("Kron4ek", "FAudio-Builds", wizard); | ||
this.mfWorkaroundVersion = versions[0]; | ||
}*/ | ||
Zemogiter marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
const setupFile = new Resource() | ||
.wizard(wizard) | ||
.url( | ||
`https://codeload.github.com/z0z0z/mf-install/zip/master` | ||
) | ||
.name(`mf-install-master.zip`) | ||
.get(); | ||
|
||
new Extractor() | ||
.wizard(wizard) | ||
.archive(setupFile) | ||
.to(`${prefixDirectory}/mfWorkaround/`) | ||
.extract(); | ||
|
||
const mfWorkaroundDir = `${prefixDirectory}/mfWorkaround/mf-install-master`; | ||
|
||
ls(`${mfWorkaroundDir}/syswow64`).forEach(file => { | ||
if (file.endsWith(".dll")) { | ||
cp(`${mfWorkaroundDir}/syswow64/${file}`, system32directory); | ||
|
||
new OverrideDLL(this.wine).withMode("native", [file]).go(); | ||
} | ||
}); | ||
madoar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
if (this.wine.architecture() == "amd64") { | ||
ls(`${mfWorkaroundDir}/system32`).forEach(file => { | ||
if (file.endsWith(".dll")) { | ||
cp(`${mfWorkaroundDir}/system32/${file}`, system64directory); | ||
|
||
new OverrideDLL(this.wine).withMode("native", [file]).go(); | ||
} | ||
}); | ||
} | ||
|
||
const regeditFile = `${prefixDirectory}/mfWorkaround/mf-install-master/mf.reg`; | ||
new Regedit(this.wine).patch(regeditFile); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Try There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tried that. It did not fix the issue. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
What "error" do you get when you use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thats the thing. No error in terminal window in either There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One parameter should work (the type can be new Regedit(this.wine).patch(cat(regeditFile));
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this case it cannot be a Phoenicis issue. Maybe something is wrong in the file? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @plata just tried it on plain Wine and the whole .reg file is in the registry editor. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have you tried other scripts that make use of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @madoar yes they do There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Strange. If Phoenicis uses the same command line as plain Wine, how can it be different... |
||
//command for regedit64 will go here once implemented | ||
|
||
new Regsvr32(this.wine).withDll("colorcnv.dll").go(); | ||
new Regsvr32(this.wine).withDll("msmpeg2adec.dll").go(); | ||
new Regsvr32(this.wine).withDll("msmpeg2vdec.dll").go(); | ||
|
||
/** | ||
* commented out because we dont have regsvr64 yet | ||
* new Regsvr64(this.wine).withDll("colorcnv.dll").go(); | ||
* new Regsvr64(this.wine).withDll("msmpeg2adec.dll").go(); | ||
* new Regsvr64(this.wine).withDll("msmpeg2vdec.dll").go(); | ||
*/ | ||
} | ||
|
||
static install(container) { | ||
const wine = new Wine(); | ||
const wizard = SetupWizard(InstallationType.VERBS, "mfWorkaround", Optional.empty()); | ||
|
||
wine.prefix(container); | ||
wine.wizard(wizard); | ||
|
||
//const versions = getGithubReleases("z0z0z", "mf-install", wizard); commented out because it's useless until z0z0z will use releases | ||
|
||
//const selectedVersion = wizard.menu(tr("Please select the version."), versions, versions[0]); same as above | ||
|
||
// install | ||
new MFWorkaround(wine).go(); | ||
|
||
wizard.close(); | ||
} | ||
} | ||
|
||
module.default = MFWorkaround; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"scriptName" : "mfWorkaround", | ||
"id" : "engines.wine.verbs.mfworkaround", | ||
"compatibleOperatingSystems" : [ | ||
"LINUX" | ||
], | ||
"testingOperatingSystems" : [ | ||
"LINUX" | ||
], | ||
"free" : true, | ||
"requiresPatch" : false | ||
} |
Uh oh!
There was an error while loading. Please reload this page.