1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.execWine = execWine;
|
7 | exports.prepareWindowsExecutableArgs = prepareWindowsExecutableArgs;
|
8 |
|
9 | function _builderUtil() {
|
10 | const data = require("builder-util");
|
11 |
|
12 | _builderUtil = function () {
|
13 | return data;
|
14 | };
|
15 |
|
16 | return data;
|
17 | }
|
18 |
|
19 |
|
20 | function execWine(file, file64 = null, appArgs = [], options = {}) {
|
21 | if (process.platform === "win32") {
|
22 | if (options.timeout == null) {
|
23 |
|
24 | options.timeout = 120 * 1000;
|
25 | }
|
26 |
|
27 | return (0, _builderUtil().exec)(file, appArgs, options);
|
28 | }
|
29 |
|
30 | const commandArgs = ["wine", "--ia32", file];
|
31 |
|
32 | if (file64 != null) {
|
33 | commandArgs.push("--x64", file64);
|
34 | }
|
35 |
|
36 | if (appArgs.length > 0) {
|
37 | commandArgs.push("--args", JSON.stringify(appArgs));
|
38 | }
|
39 |
|
40 | return (0, _builderUtil().executeAppBuilder)(commandArgs, undefined, options);
|
41 | }
|
42 |
|
43 |
|
44 |
|
45 | function prepareWindowsExecutableArgs(args, exePath) {
|
46 | if (process.platform !== "win32") {
|
47 | args.unshift(exePath);
|
48 | }
|
49 |
|
50 | return args;
|
51 | }
|
52 |
|
53 |
|
\ | No newline at end of file |