mirror of
https://github.com/Gabi-Zar/Silk-Fly-Launcher.git
synced 2026-06-15 03:47:11 +02:00
Compare commits
4 Commits
378108bd34
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 0d7cbaf4fd | |||
| 71e6649e67 | |||
| dbad325ca9 | |||
| 7fe89ff2ab |
@@ -6,6 +6,7 @@ import stylistic from "@stylistic/eslint-plugin";
|
|||||||
export default defineConfig([
|
export default defineConfig([
|
||||||
{
|
{
|
||||||
files: ["**/*.{js,mjs,cjs}"],
|
files: ["**/*.{js,mjs,cjs}"],
|
||||||
|
ignores: ["node_modules/**", "out/**"],
|
||||||
plugins: { js, "@stylistic": stylistic },
|
plugins: { js, "@stylistic": stylistic },
|
||||||
extends: ["js/recommended"],
|
extends: ["js/recommended"],
|
||||||
languageOptions: { globals: { ...globals.browser, ...globals.node } },
|
languageOptions: { globals: { ...globals.browser, ...globals.node } },
|
||||||
|
|||||||
24
main.js
24
main.js
@@ -208,9 +208,13 @@ function saveBepinexVersion(version) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ipcMain.handle("load-bepinex-version", () => {
|
ipcMain.handle("load-bepinex-version", () => {
|
||||||
|
return loadBepinexVersion();
|
||||||
|
});
|
||||||
|
|
||||||
|
function loadBepinexVersion() {
|
||||||
bepinexVersion = bepinexStore.get("bepinex-version");
|
bepinexVersion = bepinexStore.get("bepinex-version");
|
||||||
return bepinexVersion;
|
return bepinexVersion;
|
||||||
});
|
}
|
||||||
|
|
||||||
function saveBepinexBackupVersion(version) {
|
function saveBepinexBackupVersion(version) {
|
||||||
bepinexBackupVersion = version;
|
bepinexBackupVersion = version;
|
||||||
@@ -377,8 +381,6 @@ async function installBepinex() {
|
|||||||
saveBepinexVersion(bepinexBackupVersion);
|
saveBepinexVersion(bepinexBackupVersion);
|
||||||
saveBepinexBackupVersion(undefined);
|
saveBepinexBackupVersion(undefined);
|
||||||
} else {
|
} else {
|
||||||
mainWindow.webContents.send("showToast", "Installing Bepinex from Github");
|
|
||||||
|
|
||||||
const GITHUB_URL = "https://api.github.com/repos/bepinex/bepinex/releases/latest";
|
const GITHUB_URL = "https://api.github.com/repos/bepinex/bepinex/releases/latest";
|
||||||
|
|
||||||
const res = await fetch(GITHUB_URL, {
|
const res = await fetch(GITHUB_URL, {
|
||||||
@@ -397,6 +399,14 @@ async function installBepinex() {
|
|||||||
|
|
||||||
const release = await res.json();
|
const release = await res.json();
|
||||||
|
|
||||||
|
if (loadBepinexVersion() == release.tag_name) {
|
||||||
|
mainWindow.webContents.send("showToast", "No new BepInEx update.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mainWindow.webContents.send("showToast", "Installing Bepinex from Github");
|
||||||
|
|
||||||
|
await uninstallBepinex();
|
||||||
|
|
||||||
let asset;
|
let asset;
|
||||||
if (process.platform === "win32") {
|
if (process.platform === "win32") {
|
||||||
asset = release.assets.find((a) => a.name.endsWith(".zip") && a.name.toLowerCase().includes("win_x64"));
|
asset = release.assets.find((a) => a.name.endsWith(".zip") && a.name.toLowerCase().includes("win_x64"));
|
||||||
@@ -700,6 +710,12 @@ async function searchThunderstoreMods(keywords, offset = 0, count = 10, sortFilt
|
|||||||
"User-Agent": userAgent,
|
"User-Agent": userAgent,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
if (!res.ok) {
|
||||||
|
if (res.status == 403) {
|
||||||
|
mainWindow.webContents.send("showToast", "Thunderstore has blocked the application. Please try again later.", "error");
|
||||||
|
}
|
||||||
|
throw new Error(`Thunderstore API error: ${res.status}`);
|
||||||
|
}
|
||||||
const modsInfo = await res.json();
|
const modsInfo = await res.json();
|
||||||
|
|
||||||
const modsToRemove = ["f21c391c-0bc5-431d-a233-95323b95e01b", "42f76853-d2a4-4520-949b-13a02fdbbbcb", "34eac80c-5497-470e-b98c-f53421b828c0"];
|
const modsToRemove = ["f21c391c-0bc5-431d-a233-95323b95e01b", "42f76853-d2a4-4520-949b-13a02fdbbbcb", "34eac80c-5497-470e-b98c-f53421b828c0"];
|
||||||
@@ -964,7 +980,7 @@ ipcMain.handle("add-offline-mod", async () => {
|
|||||||
|
|
||||||
async function checkForCoreAndPatcherMods() {
|
async function checkForCoreAndPatcherMods() {
|
||||||
const bepinexFolderPath = path.join(loadSilksongPath(), "BepInEx");
|
const bepinexFolderPath = path.join(loadSilksongPath(), "BepInEx");
|
||||||
const bepinexPluginsPath = path.join(bepinexFolderPath, "Plugins");
|
const bepinexPluginsPath = path.join(bepinexFolderPath, "plugins");
|
||||||
const bepinexCorePath = path.join(bepinexFolderPath, "core", "custom");
|
const bepinexCorePath = path.join(bepinexFolderPath, "core", "custom");
|
||||||
const bepinexPatcherPath = path.join(bepinexFolderPath, "patchers", "custom");
|
const bepinexPatcherPath = path.join(bepinexFolderPath, "patchers", "custom");
|
||||||
|
|
||||||
|
|||||||
32
package-lock.json
generated
32
package-lock.json
generated
@@ -12,7 +12,7 @@
|
|||||||
"@nexusmods/nexus-api": "^1.1.5",
|
"@nexusmods/nexus-api": "^1.1.5",
|
||||||
"7zip-bin": "^5.2.0",
|
"7zip-bin": "^5.2.0",
|
||||||
"electron-store": "^11.0.2",
|
"electron-store": "^11.0.2",
|
||||||
"graphql": "^16.12.0",
|
"graphql": "^16.13.2",
|
||||||
"graphql-request": "^7.4.0",
|
"graphql-request": "^7.4.0",
|
||||||
"node-7z": "^3.0.0",
|
"node-7z": "^3.0.0",
|
||||||
"semver": "^7.7.4",
|
"semver": "^7.7.4",
|
||||||
@@ -30,8 +30,8 @@
|
|||||||
"@reforged/maker-appimage": "^5.2.0",
|
"@reforged/maker-appimage": "^5.2.0",
|
||||||
"@stylistic/eslint-plugin": "^5.10.0",
|
"@stylistic/eslint-plugin": "^5.10.0",
|
||||||
"cross-env": "^10.1.0",
|
"cross-env": "^10.1.0",
|
||||||
"electron": "^40.6.0",
|
"electron": "^41.2.1",
|
||||||
"eslint": "^10.2.0",
|
"eslint": "^10.2.1",
|
||||||
"globals": "^17.5.0"
|
"globals": "^17.5.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -3182,9 +3182,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/electron": {
|
"node_modules/electron": {
|
||||||
"version": "40.6.0",
|
"version": "41.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/electron/-/electron-40.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/electron/-/electron-41.2.1.tgz",
|
||||||
"integrity": "sha512-ett8W+yOFGDuM0vhJMamYSkrbV3LoaffzJd9GfjI96zRAxyrNqUSKqBpf/WGbQCweDxX2pkUCUfrv4wwKpsFZA==",
|
"integrity": "sha512-teeRThiYGTPKf/2yOW7zZA1bhb91KEQ4yLBPOg7GxpmnkLFLugKgQaAKOrCgdzwsXh/5mFIfmkm+4+wACJKwaA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -3725,18 +3725,18 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint": {
|
"node_modules/eslint": {
|
||||||
"version": "10.2.0",
|
"version": "10.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-10.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint/-/eslint-10.2.1.tgz",
|
||||||
"integrity": "sha512-+L0vBFYGIpSNIt/KWTpFonPrqYvgKw1eUI5Vn7mEogrQcWtWYtNQ7dNqC+px/J0idT3BAkiWrhfS7k+Tum8TUA==",
|
"integrity": "sha512-wiyGaKsDgqXvF40P8mDwiUp/KQjE1FdrIEJsM8PZ3XCiniTMXS3OHWWUe5FI5agoCnr8x4xPrTDZuxsBlNHl+Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/eslint-utils": "^4.8.0",
|
"@eslint-community/eslint-utils": "^4.8.0",
|
||||||
"@eslint-community/regexpp": "^4.12.2",
|
"@eslint-community/regexpp": "^4.12.2",
|
||||||
"@eslint/config-array": "^0.23.4",
|
"@eslint/config-array": "^0.23.5",
|
||||||
"@eslint/config-helpers": "^0.5.4",
|
"@eslint/config-helpers": "^0.5.5",
|
||||||
"@eslint/core": "^1.2.0",
|
"@eslint/core": "^1.2.1",
|
||||||
"@eslint/plugin-kit": "^0.7.0",
|
"@eslint/plugin-kit": "^0.7.1",
|
||||||
"@humanfs/node": "^0.16.6",
|
"@humanfs/node": "^0.16.6",
|
||||||
"@humanwhocodes/module-importer": "^1.0.1",
|
"@humanwhocodes/module-importer": "^1.0.1",
|
||||||
"@humanwhocodes/retry": "^0.4.2",
|
"@humanwhocodes/retry": "^0.4.2",
|
||||||
@@ -4692,9 +4692,9 @@
|
|||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
"node_modules/graphql": {
|
"node_modules/graphql": {
|
||||||
"version": "16.12.0",
|
"version": "16.13.2",
|
||||||
"resolved": "https://registry.npmjs.org/graphql/-/graphql-16.12.0.tgz",
|
"resolved": "https://registry.npmjs.org/graphql/-/graphql-16.13.2.tgz",
|
||||||
"integrity": "sha512-DKKrynuQRne0PNpEbzuEdHlYOMksHSUI8Zc9Unei5gTsMNA2/vMpoMz/yKba50pejK56qj98qM0SjYxAKi13gQ==",
|
"integrity": "sha512-5bJ+nf/UCpAjHM8i06fl7eLyVC9iuNAjm9qzkiu2ZGhM0VscSvS6WDPfAwkdkBuoXGM9FJSbKl6wylMwP9Ktig==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0"
|
"node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0"
|
||||||
|
|||||||
11
package.json
11
package.json
@@ -2,7 +2,7 @@
|
|||||||
"name": "silkflylauncher",
|
"name": "silkflylauncher",
|
||||||
"productName": "Silk Fly Launcher",
|
"productName": "Silk Fly Launcher",
|
||||||
"version": "1.0.0-dev",
|
"version": "1.0.0-dev",
|
||||||
"description": "Silk Fly Launcher is a launcher and mod manager for Silksong mods from Nexus, built with Electron.",
|
"description": "Silk Fly Launcher is a launcher and mod manager for Silksong mods from Thunderstore and Nexus, built with Electron.",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -12,7 +12,8 @@
|
|||||||
"make:msi": "cross-env BUILD_TARGET=msi electron-forge make",
|
"make:msi": "cross-env BUILD_TARGET=msi electron-forge make",
|
||||||
"make:zip": "cross-env BUILD_TARGET=zip electron-forge make",
|
"make:zip": "cross-env BUILD_TARGET=zip electron-forge make",
|
||||||
"make:deb": "cross-env BUILD_TARGET=deb electron-forge make",
|
"make:deb": "cross-env BUILD_TARGET=deb electron-forge make",
|
||||||
"make:appimage": "cross-env BUILD_TARGET=appimage electron-forge make"
|
"make:appimage": "cross-env BUILD_TARGET=appimage electron-forge make",
|
||||||
|
"lint": "npx eslint"
|
||||||
},
|
},
|
||||||
"author": "GabiZar",
|
"author": "GabiZar",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
@@ -28,15 +29,15 @@
|
|||||||
"@reforged/maker-appimage": "^5.2.0",
|
"@reforged/maker-appimage": "^5.2.0",
|
||||||
"@stylistic/eslint-plugin": "^5.10.0",
|
"@stylistic/eslint-plugin": "^5.10.0",
|
||||||
"cross-env": "^10.1.0",
|
"cross-env": "^10.1.0",
|
||||||
"electron": "^40.6.0",
|
"electron": "^41.2.1",
|
||||||
"eslint": "^10.2.0",
|
"eslint": "^10.2.1",
|
||||||
"globals": "^17.5.0"
|
"globals": "^17.5.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nexusmods/nexus-api": "^1.1.5",
|
"@nexusmods/nexus-api": "^1.1.5",
|
||||||
"7zip-bin": "^5.2.0",
|
"7zip-bin": "^5.2.0",
|
||||||
"electron-store": "^11.0.2",
|
"electron-store": "^11.0.2",
|
||||||
"graphql": "^16.12.0",
|
"graphql": "^16.13.2",
|
||||||
"graphql-request": "^7.4.0",
|
"graphql-request": "^7.4.0",
|
||||||
"node-7z": "^3.0.0",
|
"node-7z": "^3.0.0",
|
||||||
"semver": "^7.7.4",
|
"semver": "^7.7.4",
|
||||||
|
|||||||
@@ -281,7 +281,7 @@
|
|||||||
<p class="transparent-text" id="bepinex-version-text"></p>
|
<p class="transparent-text" id="bepinex-version-text"></p>
|
||||||
<br />
|
<br />
|
||||||
<div class="horizontal-div">
|
<div class="horizontal-div">
|
||||||
<button class="default-button" onclick="installBepinex()">Install</button>
|
<button id="install-bepinex-button" class="default-button" onclick="installBepinex()">Install</button>
|
||||||
<button class="important-button" onclick="uninstallBepinex()">Uninstall</button>
|
<button class="important-button" onclick="uninstallBepinex()">Uninstall</button>
|
||||||
<button class="default-button" onclick="backupBepinex()">Backup</button>
|
<button class="default-button" onclick="backupBepinex()">Backup</button>
|
||||||
<button class="important-button" onclick="deleteBepinexBackup()">Delete Backup</button>
|
<button class="important-button" onclick="deleteBepinexBackup()">Delete Backup</button>
|
||||||
|
|||||||
@@ -589,6 +589,7 @@ async function deleteBepinexBackup() {
|
|||||||
|
|
||||||
async function setBepinexVersion() {
|
async function setBepinexVersion() {
|
||||||
const bepinexVersionText = document.getElementById("bepinex-version-text");
|
const bepinexVersionText = document.getElementById("bepinex-version-text");
|
||||||
|
const bepinexInstallButton = document.getElementById("install-bepinex-button");
|
||||||
if (bepinexVersionText == undefined) {
|
if (bepinexVersionText == undefined) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -601,8 +602,10 @@ async function setBepinexVersion() {
|
|||||||
} else {
|
} else {
|
||||||
bepinexVersionText.innerText = `BepInEx ${bepinexBackupVersion} is backed up`;
|
bepinexVersionText.innerText = `BepInEx ${bepinexBackupVersion} is backed up`;
|
||||||
}
|
}
|
||||||
|
bepinexInstallButton.innerText = "Install";
|
||||||
} else {
|
} else {
|
||||||
bepinexVersionText.innerText = `BepInEx ${bepinexVersion} is installed`;
|
bepinexVersionText.innerText = `BepInEx ${bepinexVersion} is installed`;
|
||||||
|
bepinexInstallButton.innerText = "Update";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user