mirror of
https://github.com/Gabi-Zar/Silk-Fly-Launcher.git
synced 2026-04-17 05:26:04 +02:00
Move BepInEx version to its own config to prevent version loss
This commit is contained in:
17
main.js
17
main.js
@@ -11,9 +11,9 @@ const store = new Store();
|
|||||||
const userSavePath = app.getPath('userData')
|
const userSavePath = app.getPath('userData')
|
||||||
const dataPath = `${userSavePath}\\config.json`
|
const dataPath = `${userSavePath}\\config.json`
|
||||||
let silksongPath = store.get('silksong-path')
|
let silksongPath = store.get('silksong-path')
|
||||||
|
|
||||||
let nexusAPI = store.get('nexus-api')
|
let nexusAPI = store.get('nexus-api')
|
||||||
let nexus = undefined
|
let nexus = undefined
|
||||||
|
|
||||||
createNexus()
|
createNexus()
|
||||||
|
|
||||||
let bepinexFolderPath = `${silksongPath}/BepInEx`
|
let bepinexFolderPath = `${silksongPath}/BepInEx`
|
||||||
@@ -27,6 +27,7 @@ const bepinexFiles = [
|
|||||||
|
|
||||||
let bepinexVersion
|
let bepinexVersion
|
||||||
let bepinexBackupVersion
|
let bepinexBackupVersion
|
||||||
|
const bepinexStore = new Store({cwd: 'bepinex-version'});
|
||||||
|
|
||||||
let mainWindow
|
let mainWindow
|
||||||
let htmlFile
|
let htmlFile
|
||||||
@@ -89,14 +90,14 @@ ipcMain.handle('load-path', () => {
|
|||||||
function saveBepinexVersion(version) {
|
function saveBepinexVersion(version) {
|
||||||
bepinexVersion = version;
|
bepinexVersion = version;
|
||||||
if (bepinexVersion == undefined) {
|
if (bepinexVersion == undefined) {
|
||||||
store.delete('bepinex-version');
|
bepinexStore.delete('bepinex-version');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
store.set('bepinex-version', version);
|
bepinexStore.set('bepinex-version', version);
|
||||||
};
|
};
|
||||||
|
|
||||||
ipcMain.handle('load-bepinex-version', () => {
|
ipcMain.handle('load-bepinex-version', () => {
|
||||||
bepinexVersion = store.get('bepinex-version');
|
bepinexVersion = bepinexStore.get('bepinex-version');
|
||||||
return bepinexVersion;
|
return bepinexVersion;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -104,14 +105,14 @@ ipcMain.handle('load-bepinex-version', () => {
|
|||||||
function saveBepinexBackupVersion(version) {
|
function saveBepinexBackupVersion(version) {
|
||||||
bepinexBackupVersion = version;
|
bepinexBackupVersion = version;
|
||||||
if (bepinexBackupVersion == undefined) {
|
if (bepinexBackupVersion == undefined) {
|
||||||
store.delete('bepinex-backup-version');
|
bepinexStore.delete('bepinex-backup-version');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
store.set('bepinex-backup-version', version);
|
bepinexStore.set('bepinex-backup-version', version);
|
||||||
};
|
};
|
||||||
|
|
||||||
ipcMain.handle('load-bepinex-backup-version', () => {
|
ipcMain.handle('load-bepinex-backup-version', () => {
|
||||||
bepinexBackupVersion = store.get('bepinex-backup-version');
|
bepinexBackupVersion = bepinexStore.get('bepinex-backup-version');
|
||||||
return bepinexBackupVersion;
|
return bepinexBackupVersion;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -212,7 +213,7 @@ async function installBepinex() {
|
|||||||
}
|
}
|
||||||
await fs.rm(bepinexBackupPath, { recursive: true })
|
await fs.rm(bepinexBackupPath, { recursive: true })
|
||||||
|
|
||||||
bepinexBackupVersion = store.get('bepinex-backup-version')
|
bepinexBackupVersion = bepinexStore.get('bepinex-backup-version')
|
||||||
saveBepinexVersion(bepinexBackupVersion)
|
saveBepinexVersion(bepinexBackupVersion)
|
||||||
saveBepinexBackupVersion(undefined)
|
saveBepinexBackupVersion(undefined)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,7 +145,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<label class="lace-pin-checkbox-container">
|
<label class="lace-pin-checkbox-container">
|
||||||
<input type="checkbox" name="lace-pin" id="lace-pin" value="lace-pin-activate">
|
<input type="checkbox" name="lace-pin" id="lace-pin">
|
||||||
<span class="checkmark"></span>
|
<span class="checkmark"></span>
|
||||||
Lace Pin
|
Lace Pin
|
||||||
</label>
|
</label>
|
||||||
|
|||||||
@@ -281,7 +281,6 @@ async function importData() {
|
|||||||
await files.import()
|
await files.import()
|
||||||
document.getElementById("silksong-path-input").value = await files.loadSilksongPath()
|
document.getElementById("silksong-path-input").value = await files.loadSilksongPath()
|
||||||
document.getElementById("nexus-api-input").value = await files.loadNexusAPI()
|
document.getElementById("nexus-api-input").value = await files.loadNexusAPI()
|
||||||
setBepinexVersion()
|
|
||||||
const lacePinCheckbox = document.getElementById('lace-pin')
|
const lacePinCheckbox = document.getElementById('lace-pin')
|
||||||
const theme = await files.loadTheme()
|
const theme = await files.loadTheme()
|
||||||
lacePinCheckbox.checked = theme[1]
|
lacePinCheckbox.checked = theme[1]
|
||||||
@@ -301,7 +300,6 @@ async function deleteData() {
|
|||||||
await files.delete()
|
await files.delete()
|
||||||
document.getElementById("silksong-path-input").value = await files.loadSilksongPath()
|
document.getElementById("silksong-path-input").value = await files.loadSilksongPath()
|
||||||
document.getElementById("nexus-api-input").value = await files.loadNexusAPI()
|
document.getElementById("nexus-api-input").value = await files.loadNexusAPI()
|
||||||
setBepinexVersion()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////
|
||||||
|
|||||||
Reference in New Issue
Block a user