diff --git a/assets/images/canary.png b/assets/images/canary.png index e4f93e6c..1d1b6e1e 100644 Binary files a/assets/images/canary.png and b/assets/images/canary.png differ diff --git a/assets/images/ptb.png b/assets/images/ptb.png index 8db11605..ea1b505a 100644 Binary files a/assets/images/ptb.png and b/assets/images/ptb.png differ diff --git a/assets/images/splash.bmp b/assets/images/splash.bmp new file mode 100644 index 00000000..ddef694e Binary files /dev/null and b/assets/images/splash.bmp differ diff --git a/assets/images/stable.png b/assets/images/stable.png index 4a9049c2..ea1b505a 100644 Binary files a/assets/images/stable.png and b/assets/images/stable.png differ diff --git a/package.json b/package.json index ee574415..0c6f313b 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "productName": "BetterDiscord Installer", "description": "A simple standalone program which automates the installation, removal and maintenance of BetterDiscord.", "author": "BetterDiscord", - "version": "1.2.0", + "version": "1.2.1", "license": "MIT", "scripts": { "dev": "electron-webpack dev", @@ -23,16 +23,16 @@ "electron-webpack": "^2.8.2", "eslint": "^7.21.0", "eslint-plugin-svelte3": "^3.1.2", - "find-process": "^1.4.7", + "find-process": "https://github.com/BetterDiscord/find-process", "focus-visible": "^5.2.0", - "phin": "^3.6.0", + "phin": "^3.7.0", "rimraf": "^3.0.2", - "semver": "^7.3.5", + "semver": "^7.3.8", "svelte": "^3.38.2", - "svelte-loader": "^3.0.0", + "svelte-loader": "^3.1.7", "svelte-spa-router": "^3.1.0", "tree-kill": "^1.2.2", - "webpack": "~4.42.1", + "webpack": "~5.76.0", "webpack-bundle-analyzer": "^4.4.0" }, "build": { @@ -52,7 +52,8 @@ }, "portable": { "requestExecutionLevel": "user", - "useZip": true + "useZip": true, + "splashImage": "assets/images/splash.bmp" }, "mac": { "artifactName": "${productName}-Mac.${ext}", @@ -80,6 +81,9 @@ "staticSourceDirectory": "assets", "renderer": { "webpackConfig": "webpack.renderer.js" + }, + "main": { + "webpackConfig": "webpack.main.js" } } } diff --git a/src/renderer/actions/paths.js b/src/renderer/actions/paths.js index b434fd7d..2772a1ca 100644 --- a/src/renderer/actions/paths.js +++ b/src/renderer/actions/paths.js @@ -15,27 +15,38 @@ const safeIsDir = (fullpath) => { }; const getDiscordPath = function(releaseChannel) { - let desktopCorePath = ""; - if (process.platform === "win32") { - let basedir = path.join(process.env.LOCALAPPDATA, releaseChannel.replace(/ /g, "")); // Normal install path in AppData\Local - if (!fs.existsSync(basedir)) basedir = path.join(process.env.PROGRAMDATA, process.env.USERNAME, releaseChannel.replace(/ /g, "")); // Atypical location in ProgramData\%username% - if (!fs.existsSync(basedir)) return ""; - const version = fs.readdirSync(basedir).filter(f => safeIsDir(path.join(basedir, f)) && f.split(".").length > 1).sort().reverse()[0]; - if (!version) return ""; - // To account for discord_desktop_core-1 or discord_dekstop_core-2 - const coreWrap = fs.readdirSync(path.join(basedir, version, "modules")).filter(e => e.indexOf("discord_desktop_core") === 0).sort().reverse()[0]; - desktopCorePath = path.join(basedir, version, "modules", coreWrap, "discord_desktop_core"); + try { + let desktopCorePath = ""; + if (process.platform === "win32") { + let basedir = path.join(process.env.LOCALAPPDATA, releaseChannel.replace(/ /g, "")); // Normal install path in AppData\Local + if (!fs.existsSync(basedir)) basedir = path.join(process.env.PROGRAMDATA, process.env.USERNAME, releaseChannel.replace(/ /g, "")); // Atypical location in ProgramData\%username% + if (!fs.existsSync(basedir)) return ""; + const version = fs.readdirSync(basedir).filter(f => safeIsDir(path.join(basedir, f)) && f.split(".").length > 1).sort().reverse()[0]; + if (!version) return ""; + + // To account for discord_desktop_core-1 or discord_dekstop_core-2 + const modulePath = path.join(basedir, version, "modules"); + if (!fs.existsSync(modulePath)) return ""; + const coreWrap = fs.readdirSync(modulePath).filter(e => e.indexOf("discord_desktop_core") === 0).sort().reverse()[0]; + if (!coreWrap) return ""; + desktopCorePath = path.join(modulePath, coreWrap, "discord_desktop_core"); + } + else { + const basedir = path.join(remote.app.getPath("userData"), "..", releaseChannel.toLowerCase().replace(" ", "")); + if (!fs.existsSync(basedir)) return ""; + const version = fs.readdirSync(basedir).filter(f => safeIsDir(path.join(basedir, f)) && f.split(".").length > 1).sort().reverse()[0]; + if (!version) return ""; + desktopCorePath = path.join(basedir, version, "modules", "discord_desktop_core"); + } + + if (fs.existsSync(desktopCorePath)) return desktopCorePath; + return ""; } - else { - const basedir = path.join(remote.app.getPath("userData"), "..", releaseChannel.toLowerCase().replace(" ", "")); - if (!fs.existsSync(basedir)) return ""; - const version = fs.readdirSync(basedir).filter(f => safeIsDir(path.join(basedir, f)) && f.split(".").length > 1).sort().reverse()[0]; - if (!version) return ""; - desktopCorePath = path.join(basedir, version, "modules", "discord_desktop_core"); + catch (err) { + // eslint-disable-next-line no-console + console.error(err); + return ""; } - - if (fs.existsSync(desktopCorePath)) return desktopCorePath; - return ""; }; for (const channel in platforms) { diff --git a/src/renderer/common/Titlebar.svelte b/src/renderer/common/Titlebar.svelte index 3ee61023..e5d1ceec 100644 --- a/src/renderer/common/Titlebar.svelte +++ b/src/renderer/common/Titlebar.svelte @@ -1,6 +1,7 @@