Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 850309d

Browse files
committed
patch filter regedit, fix patch create: wait all subprocess
1 parent 19d8c87 commit 850309d

4 files changed

Lines changed: 70 additions & 69 deletions

File tree

src/src/modules/command.js

Lines changed: 63 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,10 @@ export default class Command {
8383
* @param {Function} callable
8484
* @param {Function} spawnObject
8585
* @param {boolean} useExports
86+
* @param {boolean} watchProcess
8687
* @returns {Promise}
8788
*/
88-
watch(cmd, callable = () => {}, spawnObject = () => {}, useExports = false) {
89+
watch(cmd, callable = () => {}, spawnObject = () => {}, useExports = false, watchProcess = false) {
8990
return new Promise((resolve) => {
9091
let runCmd = this.cast(cmd, useExports);
9192
callable(`[Wine Launcher] Run command:\n${runCmd}\n\n`, 'stdout');
@@ -105,7 +106,7 @@ export default class Command {
105106
const customResolve = () => {
106107
Command.watches = Command.watches.filter(pid => pid !== watch.pid);
107108

108-
if (useExports) {
109+
if (useExports || watchProcess) {
109110
try {
110111
let processList = wine.processList();
111112
let pids = _.difference(Object.keys(processList).map(s => Number(s)), Command.watches);
@@ -232,7 +233,18 @@ export default class Command {
232233
exported.LC_ALL = locale;
233234
}
234235

236+
if (this.prefix.isDxvk()) {
237+
exported.DXVK_CONFIG_FILE = this.prefix.getWinePrefixDxvkConfFile();
238+
exported.DXVK_STATE_CACHE_PATH = this.prefix.getWinePrefixCacheDir();
239+
exported.DXVK_LOG_PATH = this.prefix.getWinePrefixLogsDir();
240+
}
241+
235242
if (useExports) {
243+
let disabled = [];
244+
let builtin = [];
245+
let preloaded = [];
246+
let vkLayers = [];
247+
236248
if (this.config) {
237249
prefixCmd = this.config.getPrefixCmd();
238250

@@ -270,39 +282,66 @@ export default class Command {
270282
if (null === exportLargeAddressAware && largeAddressAware) {
271283
exported.WINE_LARGE_ADDRESS_AWARE = 1;
272284
}
273-
}
274285

275-
if (this.prefix.isDxvk()) {
276-
exported.DXVK_CONFIG_FILE = this.prefix.getWinePrefixDxvkConfFile();
277-
exported.DXVK_STATE_CACHE_PATH = this.prefix.getWinePrefixCacheDir();
278-
exported.DXVK_LOG_PATH = this.prefix.getWinePrefixLogsDir();
279-
}
286+
if (this.config.isDisableNvapi()) {
287+
disabled = disabled.concat(['nvapi', 'nvapi64', 'nvcuda', 'nvcuda64']);
288+
}
280289

281-
let disabled = [];
282-
let builtin = [];
290+
if (this.config.isNoD3D9()) {
291+
builtin.push('d3d9');
292+
}
283293

284-
if (this.config.isDisableNvapi()) {
285-
disabled = disabled.concat(['nvapi', 'nvapi64', 'nvcuda', 'nvcuda64']);
286-
}
294+
if (this.config.isNoD3D10()) {
295+
if (this.config.isNoD3D11()) {
296+
builtin.push('dxgi');
297+
}
287298

288-
if (this.config.isNoD3D9()) {
289-
builtin.push('d3d9');
290-
}
299+
builtin = builtin.concat(['d3d10', 'd3d10_1', 'd3d10core']);
300+
}
291301

292-
if (this.config.isNoD3D10()) {
293302
if (this.config.isNoD3D11()) {
294-
builtin.push('dxgi');
303+
if (this.config.isNoD3D10()) {
304+
builtin.push('dxgi');
305+
}
306+
307+
builtin.push('d3d11');
295308
}
296309

297-
builtin = builtin.concat(['d3d10', 'd3d10_1', 'd3d10core']);
298-
}
310+
if (this.prefix.isVkBasalt() && this.prefix.isVkBasaltLib() && this.config.isVkBasalt()) {
311+
exported.ENABLE_VKBASALT = 1;
312+
exported.VKBASALT_CONFIG_FILE = this.prefix.getVkBasaltConfFile();
313+
exported.VKBASALT_SHADER_PATH = this.prefix.getShareDir() + '/vkBasalt/shader';
314+
exported.VKBASALT_LOG_FILE = this.prefix.getLogFileVkBasalt();
299315

300-
if (this.config.isNoD3D11()) {
301-
if (this.config.isNoD3D10()) {
302-
builtin.push('dxgi');
316+
let vkBasalt = window.app.getVkBasalt();
317+
318+
vkLayers.push(vkBasalt.getLayer32().layer.name);
319+
vkLayers.push(vkBasalt.getLayer64().layer.name);
303320
}
304321

305-
builtin.push('d3d11');
322+
if (this.prefix.isMangoHud() && this.prefix.isMangoHudLib() && this.config.isMangoHud()) {
323+
let mangoHud = window.app.getMangoHud();
324+
325+
vkLayers.push(mangoHud.getLayer32().layer.name);
326+
vkLayers.push(mangoHud.getLayer64().layer.name);
327+
328+
if ('opengl' === this.config.getRenderAPI()) {
329+
if ('win32' === this.prefix.getWineArch()) {
330+
preloaded.push(this.prefix.getMangoHudLibDlsumPath('win32'));
331+
preloaded.push(this.prefix.getMangoHudLibPath('win32'));
332+
}
333+
if ('win64' === this.prefix.getWineArch()) {
334+
preloaded.push(this.prefix.getMangoHudLibDlsumPath('win64'));
335+
preloaded.push(this.prefix.getMangoHudLibPath('win64'));
336+
}
337+
}
338+
}
339+
340+
let configExports = this.config.getConfigExports();
341+
342+
Object.keys(configExports).forEach((field) => {
343+
exported[field] = configExports[field];
344+
});
306345
}
307346

308347
if (disabled.length > 0 || builtin.length > 0) {
@@ -319,47 +358,6 @@ export default class Command {
319358
exported.WINEDLLOVERRIDES = overrides.join(';');
320359
}
321360

322-
let preloaded = [];
323-
let vkLayers = [];
324-
325-
if (this.prefix.isVkBasalt() && this.prefix.isVkBasaltLib() && this.config.isVkBasalt()) {
326-
exported.ENABLE_VKBASALT = 1;
327-
exported.VKBASALT_CONFIG_FILE = this.prefix.getVkBasaltConfFile();
328-
exported.VKBASALT_SHADER_PATH = this.prefix.getShareDir() + '/vkBasalt/shader';
329-
exported.VKBASALT_LOG_FILE = this.prefix.getLogFileVkBasalt();
330-
331-
let vkBasalt = window.app.getVkBasalt();
332-
333-
vkLayers.push(vkBasalt.getLayer32().layer.name);
334-
vkLayers.push(vkBasalt.getLayer64().layer.name);
335-
}
336-
337-
if (this.prefix.isMangoHud() && this.prefix.isMangoHudLib() && this.config.isMangoHud()) {
338-
let mangoHud = window.app.getMangoHud();
339-
340-
vkLayers.push(mangoHud.getLayer32().layer.name);
341-
vkLayers.push(mangoHud.getLayer64().layer.name);
342-
343-
if ('opengl' === this.config.getRenderAPI()) {
344-
if ('win32' === this.prefix.getWineArch()) {
345-
preloaded.push(this.prefix.getMangoHudLibDlsumPath('win32'));
346-
preloaded.push(this.prefix.getMangoHudLibPath('win32'));
347-
}
348-
if ('win64' === this.prefix.getWineArch()) {
349-
preloaded.push(this.prefix.getMangoHudLibDlsumPath('win64'));
350-
preloaded.push(this.prefix.getMangoHudLibPath('win64'));
351-
}
352-
}
353-
}
354-
355-
if (this.config) {
356-
let configExports = this.config.getConfigExports();
357-
358-
Object.keys(configExports).forEach((field) => {
359-
exported[field] = configExports[field];
360-
});
361-
}
362-
363361
if (preloaded.length > 0) {
364362
exported.LD_PRELOAD = '$LD_PRELOAD:' + preloaded.join(':');
365363
}

src/src/modules/snapshot.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,9 @@ export default class Snapshot {
260260
'[HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Class',
261261
'[HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\DeviceClasses',
262262
'[HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Video',
263+
'[HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Hardware Profiles\\Current\\System\\CurrentControlSet\\Control\\Class',
264+
'[HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Hardware Profiles\\Current\\System\\CurrentControlSet\\Control\\DeviceClasses',
265+
'[HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Hardware Profiles\\Current\\System\\CurrentControlSet\\Control\\Video',
263266
];
264267

265268
const isSkip = (section) => {

src/src/modules/update.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Network from "./network";
55

66
export default class Update {
77

8-
version = '1.4.4';
8+
version = '1.4.5';
99

1010
/**
1111
* @type {string}

src/src/modules/wine.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export default class Wine {
141141
return (new Command(prefix)).watch(`${winePath} ${postfix}${cmd}`, (output) => {
142142
api.commit(action.get('logs').APPEND, output);
143143
this.fs.filePutContents(logFile, output, this.fs.FILE_APPEND);
144-
});
144+
}, () => {}, false, true);
145145
}
146146

147147
fm() {
@@ -159,7 +159,7 @@ export default class Wine {
159159
return (new Command(prefix)).watch(wineFileManagerPath, (output) => {
160160
api.commit(action.get('logs').APPEND, output);
161161
this.fs.filePutContents(logFile, output, this.fs.FILE_APPEND);
162-
});
162+
}, () => {}, false, true);
163163
}
164164

165165
cfg() {
@@ -336,7 +336,7 @@ export default class Wine {
336336
return command.watch(`"${path}" ${cmd}`, (output) => {
337337
api.commit(action.get('logs').APPEND, output);
338338
this.fs.filePutContents(logFile, output, this.fs.FILE_APPEND);
339-
});
339+
}, () => {}, false, true);
340340
});
341341
}
342342

0 commit comments

Comments
 (0)