Skip to content
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

Add Mf workaround #1149

Draft
wants to merge 35 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
254649c
Merge pull request #1 from PhoenicisOrg/master
Zemogiter Mar 27, 2018
63f898c
Merge pull request #3 from PhoenicisOrg/master
Zemogiter Mar 29, 2018
71cd3d8
Merge pull request #4 from PhoenicisOrg/master
Zemogiter Apr 1, 2018
60c3cb5
Merge pull request #5 from PhoenicisOrg/master
Zemogiter Apr 10, 2018
69e7bf2
Merge pull request #6 from PhoenicisOrg/master
Zemogiter Apr 23, 2018
5bf56fe
Merge pull request #7 from PhoenicisOrg/master
Zemogiter May 16, 2018
1c4fe31
Merge pull request #8 from PhoenicisOrg/master
Zemogiter Jun 1, 2018
66bd276
Merge pull request #9 from PhoenicisOrg/master
Zemogiter Jul 11, 2018
1791c28
Add files via upload
Zemogiter May 1, 2019
9d473d3
Merge pull request #22 from PhoenicisOrg/master
Zemogiter Jun 11, 2019
afeb994
Merge pull request #23 from PhoenicisOrg/master
Zemogiter Aug 18, 2019
25b45d5
Update script.js
Zemogiter Aug 18, 2019
43932a3
Update script.js
Zemogiter Aug 18, 2019
8db0264
Update script.js
Zemogiter Aug 18, 2019
2cfd676
Update script.js
Zemogiter Aug 18, 2019
8b7a82a
Update script.js
Zemogiter Aug 18, 2019
b1b30ac
Update script.js
Zemogiter Aug 18, 2019
c21fb41
Update script.js
Zemogiter Aug 18, 2019
923f809
Merge pull request #24 from PhoenicisOrg/master
Zemogiter Aug 24, 2019
d3b3b61
Merge pull request #30 from PhoenicisOrg/master
Zemogiter Dec 1, 2019
dc204af
Add files via upload
Zemogiter Dec 1, 2019
5bc1ecc
Update script.js
Zemogiter Dec 1, 2019
a14bba6
Add files via upload
Zemogiter Dec 6, 2019
184a82f
Delete script.js
Zemogiter Dec 6, 2019
efa743f
Delete script.json
Zemogiter Dec 6, 2019
a0a1cd0
Delete application.json
Zemogiter Dec 6, 2019
db1fc7b
Update script.js
Zemogiter Dec 6, 2019
d877dde
Update script.json
Zemogiter Dec 6, 2019
f1bb146
Update script.js
Zemogiter Dec 6, 2019
c055748
Delete main.png
Zemogiter Dec 17, 2019
bdc3a58
Update script.js
Zemogiter Dec 29, 2019
71b7440
Update script.js
Zemogiter Jan 2, 2020
1e022ba
Update script.js
Zemogiter Jan 2, 2020
a9e3e1e
Update script.js
Zemogiter Jan 3, 2020
2bb2a27
Update script.js
Zemogiter Jan 5, 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
108 changes: 108 additions & 0 deletions Engines/Wine/Verbs/mfWorkaround/script.js
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
*/
Zemogiter marked this conversation as resolved.
Show resolved Hide resolved

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);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Try new Regedit(this.wine).open(regeditFile);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tried that. It did not fix the issue.

Copy link
Collaborator

Choose a reason for hiding this comment

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

patch is definitely wrong. See my argument above.

What "error" do you get when you use open?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thats the thing. No error in terminal window in either patch or open.

Copy link
Collaborator

Choose a reason for hiding this comment

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

One parameter should work (the type can be undefined). I think it should be

new Regedit(this.wine).patch(cat(regeditFile));

Regedit#patch writes the patchContent to a file. So in your case, it tries to patch the registry with the string "${prefixDirectory}/mfWorkaround/mf-install-master/mf.reg" instead of the content of that file.

Copy link
Collaborator

Choose a reason for hiding this comment

The 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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Have you tried other scripts that make use of Regedit? Do they work for you?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@madoar yes they do

Copy link
Collaborator

@plata plata Dec 30, 2019

Choose a reason for hiding this comment

The 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;
12 changes: 12 additions & 0 deletions Engines/Wine/Verbs/mfWorkaround/script.json
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
}