Fix bug in WebPlayer installation logic

Also run prettier
This commit is contained in:
CakeLancelot 2023-02-09 12:52:57 -06:00
parent d554b6b968
commit 2bf916ea58
4 changed files with 20 additions and 17 deletions

View File

@ -26,20 +26,20 @@ function disableServerListButtons() {
} }
function getAppVersion() { function getAppVersion() {
appversion = remote.require("app").getVersion(); appversion = remote.require("app").getVersion();
// simplify version, ex. 1.4.0 -> 1.4, // simplify version, ex. 1.4.0 -> 1.4,
// but only if a revision number isn't present // but only if a revision number isn't present
if(appversion.endsWith(".0")){ if (appversion.endsWith(".0")) {
return appversion.substr(0, appversion.length - 2) return appversion.substr(0, appversion.length - 2);
} else { } else {
return appversion return appversion;
} }
} }
function setAppVersionText() { function setAppVersionText() {
$("#of-aboutversionnumber").text("Version " + getAppVersion()); $("#of-aboutversionnumber").text("Version " + getAppVersion());
$("#of-versionnumber").text("v" + getAppVersion()); $("#of-versionnumber").text("v" + getAppVersion());
} }
function addServer() { function addServer() {

View File

@ -4,7 +4,7 @@ const exefile = './dist/win-ia32-unpacked/OpenFusionClient.exe'
exports.default = function() { exports.default = function() {
// remove leftover files from default electron app // remove leftover files from default electron app
fs.rm(dir, { recursive: true }, (err) => { fs.rm(defaultdir, { recursive: true }, (err) => {
if (err) { if (err) {
throw err; throw err;
} }

View File

@ -151,7 +151,12 @@
</button> </button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<p id="of-aboutversionnumber" class="text-monospace">APP_VERSION_NUMBER</p> <p
id="of-aboutversionnumber"
class="text-monospace"
>
APP_VERSION_NUMBER
</p>
<p> <p>
©2020-2023 OpenFusion Contributors<br />OpenFusion ©2020-2023 OpenFusion Contributors<br />OpenFusion
is licensed under MIT.<br /> is licensed under MIT.<br />

View File

@ -43,10 +43,8 @@ function installUnity(callback) {
child.on("exit", function () { child.on("exit", function () {
// overwrite 3.5.2 loader/player with FF's custom version // overwrite 3.5.2 loader/player with FF's custom version
var dstfolder = var dstfolder =
app.getPath("appData") + "..\\LocalLow\\Unity\\WebPlayer"; app.getPath("appData") + "\\..\\LocalLow\\Unity\\WebPlayer";
fs.copySync(utilsdir + "\\WebPlayer", dstfolder, { fs.copySync(utilsdir + "\\WebPlayer", dstfolder, { clobber: true });
clobber: true,
});
// avoids error reporter popping up when closing Electron // avoids error reporter popping up when closing Electron
fs.removeSync(dstfolder + "\\UnityBugReporter.exe"); fs.removeSync(dstfolder + "\\UnityBugReporter.exe");
console.log("Unity Web Player installed successfully."); console.log("Unity Web Player installed successfully.");