Skip to content

Commit

Permalink
CI: Prepare release 'v1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
BetterDiscord CI authored and BetterDiscord CI committed Mar 9, 2023
2 parents bd62ca5 + f5e6887 commit 3cd90da
Show file tree
Hide file tree
Showing 10 changed files with 1,986 additions and 2,484 deletions.
Binary file modified assets/images/canary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/ptb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/splash.bmp
Binary file not shown.
Binary file modified assets/images/stable.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 11 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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": {
Expand All @@ -52,7 +52,8 @@
},
"portable": {
"requestExecutionLevel": "user",
"useZip": true
"useZip": true,
"splashImage": "assets/images/splash.bmp"
},
"mac": {
"artifactName": "${productName}-Mac.${ext}",
Expand Down Expand Up @@ -80,6 +81,9 @@
"staticSourceDirectory": "assets",
"renderer": {
"webpackConfig": "webpack.renderer.js"
},
"main": {
"webpackConfig": "webpack.main.js"
}
}
}
49 changes: 30 additions & 19 deletions src/renderer/actions/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
10 changes: 10 additions & 0 deletions src/renderer/common/Titlebar.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script>
import {remote} from "electron";
import quit from "../actions/quit";
import {version} from "../../../package.json";
export let macButtons;
Expand All @@ -15,6 +16,7 @@
<path d="M1402.2,631.7c-9.7-353.4-286.2-496-642.6-496H68.4v714.1l442,398V490.7h257c274.5,0,274.5,344.9,0,344.9H597.6v329.5h169.8c274.5,0,274.5,344.8,0,344.8h-699v354.9h691.2c356.3,0,632.8-142.6,642.6-496c0-162.6-44.5-284.1-122.9-368.6C1357.7,915.8,1402.2,794.3,1402.2,631.7z"/>
<path d="M1262.5,135.2L1262.5,135.2l-76.8,0c26.6,13.3,51.7,28.1,75,44.3c70.7,49.1,126.1,111.5,164.6,185.3c39.9,76.6,61.5,165.6,64.3,264.6l0,1.2v1.2c0,141.1,0,596.1,0,737.1v1.2l0,1.2c-2.7,99-24.3,188-64.3,264.6c-38.5,73.8-93.8,136.2-164.6,185.3c-22.6,15.7-46.9,30.1-72.6,43.1h72.5c346.2,1.9,671-171.2,671-567.9V716.7C1933.5,312.2,1608.7,135.2,1262.5,135.2z"/>
</svg>
<span class="title">BetterDiscord Installer v{version}</span>
<div class="window-controls">
{#if macButtons === true}
<button tabindex="-1" on:click={quit} id="close">
Expand Down Expand Up @@ -61,6 +63,14 @@
opacity: .5;
}
.title {
position: absolute;
left: 50%;
transform: translate(-50%, 0);
color: var(--text-muted);
font-size: 14px;
}
.window-controls {
display: flex;
align-items: center;
Expand Down
5 changes: 5 additions & 0 deletions webpack.main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
output: {
hashFunction: "xxhash64"
}
};
3 changes: 3 additions & 0 deletions webpack.renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ module.exports = {
use: "svelte-loader"
}
]
},
output: {
hashFunction: "xxhash64"
}
};
Loading

0 comments on commit 3cd90da

Please sign in to comment.