Skip to content

Commit

Permalink
Fix Wine plugin "Override DLL" (PhoenicisOrg#1152)
Browse files Browse the repository at this point in the history
  • Loading branch information
plata authored and petermetz committed Jun 7, 2020
1 parent 185cc05 commit 507d1e7
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions Engines/Wine/Plugins/override DLL/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,21 @@ const Regedit = include("engines.wine.plugins.regedit");
module.default = class OverrideDLL {
constructor(wine) {
this.wine = wine;
this.modes = {};
this.modes = new Map();
}

withMode(mode, libraries) {
this.modes[mode] = libraries;
this.modes.set(mode, libraries);

return this;
}

go() {
let regeditFileContent = `REGEDIT4\n\n[HKEY_CURRENT_USER\\Software\\Wine\\DllOverrides]\n`;

Object.entries(this.modes)
.map(([mode, libraries]) => libraries.map(library => [library, mode]))
.forEach(([library, mode]) => {
regeditFileContent += `"*${library}"="${mode}"\n`;
});
this.modes.forEach((libraries, mode) =>
libraries.forEach(library => regeditFileContent += `"*${library}"="${mode}"\n`)
);

new Regedit(this.wine).patch(regeditFileContent);
}
Expand Down

0 comments on commit 507d1e7

Please sign in to comment.