add importing from prefix

This commit is contained in:
olcxja 2026-09-30 15:13:21 +02:00
commit b83e530392
11 changed files with 287 additions and 22 deletions

View file

@ -1,7 +1,7 @@
'use strict'
const { runGame, runTool } = require('../runner')
const { importGame } = require('../importer')
const { importGame, importGameFromPrefix } = require('../importer')
const library = require('../library')
function killProcessGroup(pid) {
@ -114,7 +114,13 @@ function createGamesService({ getWindow, onGamesChanged }) {
return importGame(srcDir, mode, data => sendToWindow(win, 'import:progress', data))
}
return { isRunning, listRunning, start, kill, runToolFor, import: importTo, setOnGameExit }
// prefix import: nothing is copied, the game just gets registered with
// paths relative to the prefix (wine sees it as a normal C:\ install)
async function importFromPrefix(win, prefix, srcDir) {
return importGameFromPrefix(prefix, srcDir)
}
return { isRunning, listRunning, start, kill, runToolFor, import: importTo, importFromPrefix, setOnGameExit }
}
module.exports = { createGamesService, killProcessGroup, sendToWindow }