Skip to content
This repository was archived by the owner on Apr 3, 2025. It is now read-only.

Commit 61b79d8

Browse files
committed
2.2.35
1 parent a250046 commit 61b79d8

File tree

3 files changed

+43
-6
lines changed

3 files changed

+43
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "mtgaprotracker",
33
"productName": "mtgaprotracker",
4-
"version": "2.2.34",
4+
"version": "2.2.35",
55
"description": "MTG Arena Tracker",
66
"main": "./.webpack/main",
77
"scripts": {

src/app/do-path-ops.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,35 @@
1+
import {app} from 'electron';
2+
import {join} from 'path';
3+
import fs from 'fs';
14
import {uploadCardData} from 'root/app/cards_uploader';
25
import {withHomeWindow} from 'root/app/main_window';
36
import {sendMessageToHomeWindow} from 'root/app/messages';
47
import {locateMtgaDir} from 'root/app/mtga_dir_ops';
58
import {showNotification} from 'root/app/notification';
69
import {settingsStore} from 'root/app/settings-store/settings_store';
10+
import {gameState} from 'root/app/game_state';
711

812
export function doMtgaPathOps(): void {
9-
//console.log('doMtgaPathOps');
13+
const home = app.getAppPath();
14+
const checker = join(home, '.webpack', 'main', 'native_modules', 'SharpMonoInjector.dll');
15+
let sharpInPlace = false;
16+
try {
17+
const checkSharpMonoInjector = fs.statSync(checker);
18+
if (checkSharpMonoInjector.size && checkSharpMonoInjector.size > 24000) {
19+
sharpInPlace = true;
20+
}
21+
} catch (err) {}
22+
23+
if (!sharpInPlace) {
24+
gameState.setAVBlocked();
25+
withHomeWindow((w) => {
26+
showNotification(
27+
'Please Restore SharpMonoInjector.dll!',
28+
'Your AV most likely removed SharpMonoInjector.dll, please add an exception for this file and re-install the tracker!'
29+
);
30+
});
31+
}
32+
1033
let mtgaPath = settingsStore.get().mtgaPath;
1134
//console.log('mtgaPath1', mtgaPath);
1235
if (mtgaPath === undefined && locateMtgaDir(mtgaPath)) {

src/app/mtga_dir_ops.ts

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,28 @@ export function locateMtgaDir(checkPath: string | undefined): boolean {
1919
} else {
2020
const progFiles = process.env['ProgramFiles'];
2121
const progFilesX86 = process.env['ProgramFiles(x86)'];
22-
const disk = process.env['SystemDrive'];
22+
23+
const getAllDisks = (): string[] => {
24+
const disks: string[] = [];
25+
const drives = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
26+
drives.forEach((drive) => {
27+
const drivePath = `${drive}:\\`;
28+
if (fs.existsSync(drivePath) && fs.statSync(drivePath).isDirectory()) {
29+
disks.push(drivePath);
30+
}
31+
});
32+
return disks;
33+
};
34+
35+
const allDisks = getAllDisks();
36+
allDisks.forEach((disk) => {
37+
MtgaPathLocator.push([disk, 'SteamLibrary', 'steamapps', 'common', 'MTGA', 'MTGA_Data']);
38+
});
2339

2440
if (progFiles === undefined) {
2541
return false;
2642
}
27-
if (disk !== undefined) {
28-
MtgaPathLocator.push([disk, 'SteamLibrary', 'steamapps', 'common', 'MTGA', 'MTGA_Data']);
29-
}
43+
3044
MtgaPathLocator.push([progFiles, 'Wizards of the Coast', 'MTGA', 'MTGA_Data']);
3145
MtgaPathLocator.push([progFiles, 'Epic Games', 'MagicTheGathering', 'MTGA_Data']);
3246
MtgaPathLocator.push([progFiles, 'Steam', 'steamapps', 'common', 'MTGA', 'MTGA_Data']);

0 commit comments

Comments
 (0)