Skip to content

Commit

Permalink
Fix launcher not working after a Uplay game has been deleted/removed
Browse files Browse the repository at this point in the history
  • Loading branch information
LegItMate committed Sep 23, 2022
1 parent 0cacc67 commit 5b3e98c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/launchers/RockstarGames.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async function getInstalledGames() {
if(allGames === "") return [];
allGames = allGames.split(window.__TAURI__.os.EOL.repeat(2)).map(x => {
let res = x.split(window.__TAURI__.os.EOL).filter(x => x.length > 1);
const name = res[0].split('HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Rockstar Games\\')[1];
const name = res[0]?.split('HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Rockstar Games\\')[1];
const paths = res.filter(x => x.trim().startsWith('Install')).filter(async x => await fs.readDir(x.split('REG_SZ')[1].trim()).catch(() => null));
if (!paths[0]) return;
const Install = paths[0].split('REG_SZ')[1].trim();
Expand Down
2 changes: 1 addition & 1 deletion src/components/launchers/Steam.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ async function parseGameObject(acf_object = {}) {
};
}

async function acf_to_json(acf_content = '') {
function acf_to_json(acf_content = '') {
if (acf_content.length === 0) return;
return JSON.parse(acf_content.split('\n').slice(1).map((x, i, arr) => {
if (x.length === 0) return;
Expand Down
4 changes: 2 additions & 2 deletions src/components/launchers/Uplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ async function getInstalledGames() {

async function parseGameObject(GameID, registry_res) {
registry_res = registry_res.split(window.__TAURI__.os.EOL.repeat(2)).find(x => x.split(window.__TAURI__.os.EOL)[0].endsWith(GameID));
const Location = registry_res.split('\r\n').map(x => x.trim()).filter(x => x.startsWith('InstallDir'))[0]?.split('REG_SZ')[1].trim();
if (!(await fs.readDir(Location).catch(() => null))) return;
const Location = registry_res?.split('\r\n').map(x => x.trim()).filter(x => x.startsWith('InstallDir'))[0]?.split('REG_SZ')[1].trim();
if (!Location || !(await fs.readDir(Location).catch(() => null))) return;
const Executable = null;
let title = Location.split('/').slice(-2)[0].replaceAll('_', ' ');
if (title.match(/\d$/ig) && !title.replaceAll('\\d', '').endsWith(' ')) {
Expand Down

0 comments on commit 5b3e98c

Please sign in to comment.