Skip to content

Commit

Permalink
Update tahoma and mfc42 verb: use fileExists (PhoenicisOrg#1116)
Browse files Browse the repository at this point in the history
* Update script.js
  • Loading branch information
ImperatorS79 authored and petermetz committed Jun 7, 2020
1 parent 1ea8a01 commit 334b5f9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 5 additions & 1 deletion Engines/Wine/Verbs/Tahoma/script.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const Wine = include("engines.wine.engine.object");
const Resource = include("utils.functions.net.resource");
const { cp } = include("utils.functions.filesystem.files");
const { cp, fileExists, mkdir } = include("utils.functions.filesystem.files");
const { CabExtract } = include("utils.functions.filesystem.extract");

const Optional = Java.type("java.util.Optional");
Expand All @@ -20,6 +20,10 @@ class Tahoma {
const prefixDirectory = this.wine.prefixDirectory();
const fontDirectory = this.wine.fontDirectory();

if (!fileExists(fontDirectory)) {
mkdir(fontDirectory);
}

const tahoma = new Resource()
.wizard(wizard)
.url("https://master.dl.sourceforge.net/project/corefonts/OldFiles/IELPKTH.CAB")
Expand Down
10 changes: 7 additions & 3 deletions Engines/Wine/Verbs/mfc42/script.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const Wine = include("engines.wine.engine.object");
const Resource = include("utils.functions.net.resource");
const { CabExtract } = include("utils.functions.filesystem.extract");
const { remove } = include("utils.functions.filesystem.files");
const { fileExists, remove } = include("utils.functions.filesystem.files");

const Optional = Java.type("java.util.Optional");

Expand All @@ -26,8 +26,12 @@ class Mfc42 {
.name("VC6RedistSetup_deu.exe")
.get();

remove(`${system32directory}/mfc42.dll`);
remove(`${system32directory}/mfc42u.dll`);
if (fileExists(`${system32directory}/mfc42.dll`)) {
remove(`${system32directory}/mfc42.dll`);
}
if (fileExists(`${system32directory}/mfc42u.dll`)) {
remove(`${system32directory}/mfc42u.dll`);
}

new CabExtract()
.wizard(wizard)
Expand Down

0 comments on commit 334b5f9

Please sign in to comment.