forked from Nexus-Mods/vortex-games
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
62 lines (55 loc) · 1.5 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
const { log, util } = require('vortex-api');
const { remote } = require('electron');
const path = require('path');
const winapi = require('winapi-bindings');
function findGame() {
try {
let regKey = (process.arch === 'x32')
? 'Software\\Zenimax_Online\\Launcher'
: 'Software\\Wow6432Node\\Zenimax_Online\\Launcher';
const instPath = winapi.RegGetValue(
'HKEY_LOCAL_MACHINE',
regKey,
'InstallPath');
if (!instPath) {
throw new Error('empty registry key');
}
return Promise.resolve(path.join(instPath.value, 'Launcher'));
} catch (err) {
return util.steam.findByName('The Elder Scrolls Online')
.then(game => game.gamePath);
}
}
function modPath() {
return path.join(remote.app.getPath('documents'), 'Elder Scrolls Online', 'live', 'Addons');
}
function main(context) {
context.registerGame({
id: 'teso',
name: 'The Elder Scrolls Online',
mergeMods: true,
queryPath: findGame,
queryModPath: modPath,
logo: 'gameart.jpg',
executable: () => 'Bethesda.net_Launcher.exe',
requiredFiles: [
'Bethesda.net_Launcher.exe',
],
environment: {
SteamAPPId: '306130',
},
details: {
steamAppId: 306130,
nexusPageId: 'elderscrollsonline',
hashFiles: [
'../The Elder Scrolls Online/game/game_player.version',
'../The Elder Scrolls Online/depot/depot.version',
'Bethesda.net_Launcher.version',
],
},
});
return true;
}
module.exports = {
default: main,
};