Add bepInEx uninstallation

This commit is contained in:
2026-01-22 13:52:13 +01:00
parent da22a80c4a
commit 118a2fd84e
4 changed files with 45 additions and 4 deletions

View File

@@ -104,7 +104,7 @@
</div>
<br>
<h2>BepInEx</h2>
<p class="transparent-text">BepInEx V1.0.0 is installed</p>
<p class="transparent-text" id="bepinex-version-text"></p>
<div class="horizontal-div">
<button class="default-button" onclick="installBepinex()">Install</button>
<button class="important-button" onclick="uninstallBepinex()">Uninstall</button>

View File

@@ -8,6 +8,7 @@ const settingsTemplate = document.getElementById("settings-template");
const modTemplate = document.getElementById("mod-template");
const versionText = HomeTemplate.content.getElementById("version-text");
let bepinexVersion
navigate("home")
@@ -118,9 +119,21 @@ async function downloadMod() {
}
async function installBepinex() {
bepinex.install()
bepinexVersion = await bepinex.install()
setBepinexVersion()
}
async function uninstallBepinex() {
console.log("WIP")
bepinexVersion = await bepinex.uninstall()
setBepinexVersion()
}
async function setBepinexVersion() {
const bepinexVersionText = document.getElementById("bepinex-version-text")
if(await bepinexVersion == undefined) {
bepinexVersionText.innerText = "BepInEx is not installed"
}
else {
bepinexVersionText.innerText = `BepInEx ${bepinexVersion} is installed`
}
}