Compare commits

..

6 Commits

Author SHA1 Message Date
MathieuG-P d61f59c714 bumb to 1.3.1 2023-10-02 13:36:22 +02:00
MathieuG-P 64e3652b60 Merge pull request #330 from Zagrios/bugfix/steam-vr-restored-before-beatsaber-was-launched
[bugfix] increase timout for restoring SteamVR after launching Beat Saber
2023-10-02 13:35:46 +02:00
MathieuG-P 6f018e6a32 [bugfix] increase timout for restoring SteamVR after launching Beat Saber 2023-10-02 13:30:23 +02:00
MathieuG-P da3b2b13a8 Merge pull request #328 from Zagrios/bugfix/replace-resvg-that-need-dll-by-sharp
[bugfix] Remove resvg lib that need DLL by Sharp that doesnt
2023-09-25 12:52:40 +02:00
MathieuG-P 381daa80a4 [bufix] install node-abi 2023-09-25 12:34:05 +02:00
MathieuG-P bdfe8ce535 [bugfix] Remove resvg lib that need DLL by Sharp that doesnt 2023-09-25 11:55:34 +02:00
5 changed files with 873 additions and 267 deletions
+7 -8
View File
@@ -24,6 +24,7 @@
"history": "^5.3.0",
"jszip": "^3.10.1",
"md5-file": "^5.0.0",
"node-abi": "^3.47.0",
"node-fetch": "^2.6.7",
"node-stream-zip": "^1.15.0",
"ps-list": "^7.2.0",
@@ -13509,10 +13510,9 @@
}
},
"node_modules/node-abi": {
"version": "3.28.0",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.28.0.tgz",
"integrity": "sha512-fRlDb4I0eLcQeUvGq7IY3xHrSb0c9ummdvDSYWfT9+LKP+3jCKw/tKoqaM7r1BAoiAC6GtwyjaGnOz6B3OtF+A==",
"dev": true,
"version": "3.47.0",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.47.0.tgz",
"integrity": "sha512-2s6B2CWZM//kPgwnuI0KrYwNjfdByE25zvAaEpq9IH4zcNsarH8Ihu/UuX6XMPEogDAxkuUFeZn60pXNHAqn3A==",
"dependencies": {
"semver": "^7.3.5"
},
@@ -29518,10 +29518,9 @@
}
},
"node-abi": {
"version": "3.28.0",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.28.0.tgz",
"integrity": "sha512-fRlDb4I0eLcQeUvGq7IY3xHrSb0c9ummdvDSYWfT9+LKP+3jCKw/tKoqaM7r1BAoiAC6GtwyjaGnOz6B3OtF+A==",
"dev": true,
"version": "3.47.0",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.47.0.tgz",
"integrity": "sha512-2s6B2CWZM//kPgwnuI0KrYwNjfdByE25zvAaEpq9IH4zcNsarH8Ihu/UuX6XMPEogDAxkuUFeZn60pXNHAqn3A==",
"requires": {
"semver": "^7.3.5"
}
+1
View File
@@ -244,6 +244,7 @@
"history": "^5.3.0",
"jszip": "^3.10.1",
"md5-file": "^5.0.0",
"node-abi": "^3.47.0",
"node-fetch": "^2.6.7",
"node-stream-zip": "^1.15.0",
"ps-list": "^7.2.0",
+855 -246
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "bs-manager",
"version": "1.3.1-alpha.2",
"version": "1.3.1",
"description": "BSManager",
"main": "./dist/main/main.js",
"author": {
@@ -14,8 +14,8 @@
"postinstall": "npm run electron-rebuild && npm run link-modules"
},
"dependencies": {
"@resvg/resvg-js": "^2.4.1",
"ps-list": "^7.2.0"
"ps-list": "^7.2.0",
"sharp": "^0.32.6"
},
"license": "MIT"
}
+7 -10
View File
@@ -11,7 +11,6 @@ import log from "electron-log";
import { Observable, of } from "rxjs";
import { BsmProtocolService } from "./bsm-protocol.service";
import { app, shell} from "electron";
import { Resvg } from "@resvg/resvg-js";
import Color from "color";
import { ensureDir, writeFile } from "fs-extra";
import toIco from "to-ico";
@@ -20,6 +19,7 @@ import { WindowManagerService } from "./window-manager.service";
import { IpcService } from "./ipc.service";
import { BSVersionLibService } from "./bs-version-lib.service";
import { execOnOs } from "../helpers/env.helpers";
import sharp from "sharp";
export class BSLauncherService {
private static instance: BSLauncherService;
@@ -161,7 +161,7 @@ export class BSLauncherService {
bsProcess.removeAllListeners("error");
bsProcess.removeAllListeners("exit");
resolve(-1);
}, 15_000);
}, 30_000);
}).then(exitCode => {
log.info("BS process exit code", exitCode);
@@ -224,19 +224,16 @@ export class BSLauncherService {
return res;
}
private createShortcutPngBuffer(color: Color): Buffer{
private createShortcutPngBuffer(color: Color): Promise<Buffer>{
const svgIcon = `
const svgBuffer = Buffer.from(`
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 406.4 406.4" height="406.4" width="406.4">
<rect rx="69.453" height="406.4" width="406.4" fill="${color.hex()}"/>
<path d="M65.467 60.6H336.4v33.867L200.933 162.2 65.467 94.467z" fill="#fff"/>
</svg>
`;
return new Resvg(svgIcon, {
fitTo: { mode: "width", value: 256 }
}).render().asPng();
`);
return sharp(svgBuffer).resize(256).png().toBuffer();
}
/**
@@ -262,7 +259,7 @@ export class BSLauncherService {
* @returns {Promise<string>} Path of the icon
*/
private async createShortcutIco(color: Color): Promise<string>{
const pngBuffer = this.createShortcutPngBuffer(color);
const pngBuffer = await this.createShortcutPngBuffer(color);
const icoBuffer = await toIco([pngBuffer]);
await ensureDir(IMAGE_CACHE_PATH);