fixed library discovery

This commit is contained in:
happy44300
2019-04-06 11:12:47 +02:00
parent 41811409f8
commit a8fcfad7e0
4 changed files with 2475 additions and 2451 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
const { app, BrowserWindow } = require('electron')
// const LocalGameDiscovery = require("./src/js/LocalGameSearch");
const LocalGameDiscovery = require("./src/js/LocalGameSearch");
const Store = require("./src/js/store");
const log = require("electron-log");
@@ -42,8 +42,8 @@ else
createWindow();
});
// console.log(typeof LocalGameDiscovery.init);
// LocalGameDiscovery.init();
LocalGameDiscovery.init();
}
function createWindow()
+2451 -2441
View File
File diff suppressed because it is too large Load Diff
+3 -1
View File
@@ -6,10 +6,12 @@
"dependencies": {
"@types/jquery": "^3.3.29",
"bootstrap": "^4.3.1",
"electron-log": "^3.0.4",
"fs": "0.0.1-security",
"jquery": "^3.3.1",
"popper.js": "^1.14.7",
"electron-log": "^3.0.4"
"simple-vdf": "^1.1.1",
"winreg": "^1.2.4"
},
"devDependencies": {
"electron": "^4.1.1",
+18 -6
View File
@@ -11,6 +11,7 @@ module.exports = {
function GetGameLocation()
{
//64bit regObj path
RegSteamPath = new Registery({
hive: Registery.HKLM,
@@ -43,7 +44,6 @@ function GetLibrary(err, data)
let NormalisedSteamPath = path.normalize(data.value + "/steamapps/libraryfolders.vdf");
console.log("normalised path: " + NormalisedSteamPath);
//read game library location
@@ -56,15 +56,27 @@ function GetLibrary(err, data)
let str = data.toString();
let raw = vdf.parse(str);
let SteamJSONobj = JSON.parse( JSON.stringify(raw) );
console.log(SteamJSONobj.LibraryFolders["1"]);
if (SteamJSONobj === null){console.warn("can't read json")}
for (let i = 0; i > 10; i++ )
var libraries = [];
//get object lenght, +1 because i start at 1
let totalKey = Object.keys(SteamJSONobj.LibraryFolders).length + 1;
for (let i = 1; i < totalKey; i++ )
{
console.log(SteamJSONobj.LibraryFolders);
if(SteamJSONobj.LibraryFolders[i] != null)
{
//WARNING i is initiliated at 1
libraries[i-1] = SteamJSONobj.LibraryFolders[i];
console.log(libraries[i-1]);
}
}
//console.log(SteamJSONobj.LibraryFolders.1);
});
function AnalyseLibrary(err, data)
{
}
}