Skip to content

Commit 3830e1e

Browse files
committed
1.4.0 release
1 parent c6f641e commit 3830e1e

File tree

5 files changed

+199
-180
lines changed

5 files changed

+199
-180
lines changed

main.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(async () => {
22
const steamcmd = require('./util/steamcmd')
3-
const regedit = require('regedit').promisified
3+
const reg = require('native-reg')
44
const progress = require('./util/progress')
55
const fs = require('fs-extra')
66
const enquirer = require('enquirer')
@@ -15,23 +15,22 @@
1515
font: 'Slant2',
1616
horizontalLayout: 'fitted',
1717
verticalLayout: 'fitted'
18-
}) + chalk.blueBright('v1.3.0 stable')))
18+
}) + chalk.blueBright('v1.4.0 stable')))
1919
console.log(chalk.magenta(`A utility designed to make installing CSSource textures into Garry's Mod ${chalk.blue('easy, safe, and legal')}, by scripting SteamCMD.`))
2020
console.log(chalk.hex('#7289DA')(`If you have any issues, be sure to file on GitHub: https://github.com/zulc22/CSS-Texture-Installer-Plus/issues`))
2121
progress.start('Verifying steam directory...')
2222

2323
let steamIPath = await (async () => {
2424
steam_search_locations = [
25-
"HKCU\\SOFTWARE\\Valve\\Steam",
26-
"HKCU\\SOFTWARE\\WOW6432Node\\Valve\\Steam",
27-
"HKLM\\SOFTWARE\\Valve\\Steam",
28-
"HKLM\\SOFTWARE\\WOW6432Node\\Valve\\Steam"
25+
"SOFTWARE\\Valve\\Steam",
26+
"SOFTWARE\\WOW6432Node\\Valve\\Steam"
2927
];
3028
for (const loc of steam_search_locations) {
3129
try {
32-
reg = await regedit.list(loc);
33-
return reg[loc].values['SteamPath'].value;
34-
break;
30+
steamkey = reg.openKey(reg.HKCU, loc, reg.Access.READ);
31+
if (!steamkey) steamkey = reg.openKey(reg.HKLM, loc, reg.Access.READ);
32+
if (!steamkey) continue;
33+
return reg.getValue(steamkey, null, 'SteamPath');
3534
} catch {
3635
continue;
3736
}
@@ -123,7 +122,7 @@
123122
if (dat.code === '0x101') {
124123
return progress.update(`Commiting Counter-Strike Source dedicated server files: ${Math.ceil(dat.progress)}%`)
125124
}
126-
return progress.update('Error: unexpected code. Perhaps try rerunning the program.\nAutomatically closing window in 10 seconds.', 10000)
125+
// return progress.update('Error: unexpected code. Perhaps try rerunning the program.\nAutomatically closing window in 10 seconds.', 10000)
127126
}).then(() => {
128127
progress.succeed('Downloaded Counter-Strike Source dedicated server files.')
129128
resolve(true)

0 commit comments

Comments
 (0)