diff --git a/.github/workflows/winget-submission.yml b/.github/workflows/winget-submission.yml index 160635f..211a91f 100644 --- a/.github/workflows/winget-submission.yml +++ b/.github/workflows/winget-submission.yml @@ -1,33 +1,17 @@ -# Based on Microsoft/DevHome Winget CI, modified for use in Vencord/Vesktop. -# -# Copyright (c) Microsoft Corporation and Contributors -# Licensed under the MIT license. - name: Submit to Winget Community Repo on: - workflow_dispatch: release: types: [published] jobs: winget: name: Publish winget package - runs-on: windows-latest - env: - WINGET_PAT: ${{ secrets.WINGET_PAT }} + runs-on: ubuntu-latest steps: - name: Submit package to Winget Community Repo - run: | - - $packageId = "Vencord.Vesktop" - - # Fetching latest release from GitHub - $github = Invoke-RestMethod -uri "https://api.github.com/repos/vencord/vesktop/releases" - $targetRelease = $github | Select-Object -First 1 - $installerUrl = $targetRelease | Select-Object -ExpandProperty assets -First 1 | Where-Object -Property name -match 'Vesktop-Setup.*?exe' | Select-Object -ExpandProperty browser_download_url - $packageVersion = $targetRelease.tag_name.Trim("v") - - # Update package using wingetcreate - Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe - .\wingetcreate.exe update $packageId --version $packageVersion --urls "$installerUrl" --submit --token $env:WINGET_PAT + uses: vedantmgoyal2009/winget-releaser@52ef3f3028ed79a9606d7678d0a88d295bc0c690 # v2 + with: + identifier: Vencord.Vesktop + token: ${{ secrets.WINGET_PAT }} + installers-regex: '\.exe$' diff --git a/package.json b/package.json index fcca866..5b18b4e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "VencordDesktop", - "version": "0.3.0", + "version": "0.3.3", "private": true, "description": "", "keywords": [], @@ -23,7 +23,7 @@ "watch": "pnpm build --watch" }, "dependencies": { - "arrpc": "github:OpenAsar/arrpc#b47fd7d498e248955c843a7857dd26478b82190a" + "arrpc": "github:OpenAsar/arrpc#89f4da610ccfac93f461826a446a17cd3b23953d" }, "devDependencies": { "@fal-works/esbuild-plugin-global-externals": "^2.1.2", @@ -33,7 +33,7 @@ "@typescript-eslint/parser": "^6.2.1", "@vencord/types": "^0.1.2", "dotenv": "^16.3.1", - "electron": "^25.4.0", + "electron": "^25.8.4", "electron-builder": "^24.6.3", "esbuild": "^0.18.17", "eslint": "^8.46.0", @@ -66,6 +66,7 @@ "LICENSE" ], "linux": { + "icon": "build/icon.icns", "category": "Network", "maintainer": "vendicated+vesktop@riseup.net", "target": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8123ea5..37b92d7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,8 +6,8 @@ settings: dependencies: arrpc: - specifier: github:OpenAsar/arrpc#b47fd7d498e248955c843a7857dd26478b82190a - version: github.com/OpenAsar/arrpc/b47fd7d498e248955c843a7857dd26478b82190a + specifier: github:OpenAsar/arrpc#89f4da610ccfac93f461826a446a17cd3b23953d + version: github.com/OpenAsar/arrpc/89f4da610ccfac93f461826a446a17cd3b23953d devDependencies: '@fal-works/esbuild-plugin-global-externals': @@ -32,8 +32,8 @@ devDependencies: specifier: ^16.3.1 version: 16.3.1 electron: - specifier: ^25.4.0 - version: 25.4.0 + specifier: ^25.8.4 + version: 25.8.4 electron-builder: specifier: ^24.6.3 version: 24.6.3 @@ -1245,6 +1245,7 @@ packages: /boolean@3.2.0: resolution: {integrity: sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==} + requiresBuild: true dev: true optional: true @@ -1637,6 +1638,7 @@ packages: /detect-node@2.1.0: resolution: {integrity: sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==} + requiresBuild: true dev: true optional: true @@ -1764,8 +1766,8 @@ packages: - supports-color dev: true - /electron@25.4.0: - resolution: {integrity: sha512-VLTRxDhL4UvQbqM7pTNENnJo62cdAPZT92N+B7BZQ5Xfok1wuVPEewIjBot4K7U3EpLUuHn1veeLzho3ihiP+Q==} + /electron@25.8.4: + resolution: {integrity: sha512-hUYS3RGdaa6E1UWnzeGnsdsBYOggwMMg4WGxNGvAoWtmRrr6J1BsjFW/yRq4WsJHJce2HdzQXtz4OGXV6yUCLg==} engines: {node: '>= 12.20.55'} hasBin: true requiresBuild: true @@ -1863,6 +1865,7 @@ packages: /es6-error@4.1.1: resolution: {integrity: sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==} + requiresBuild: true dev: true optional: true @@ -3058,6 +3061,7 @@ packages: /json-stringify-safe@5.0.1: resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==} + requiresBuild: true dev: true optional: true @@ -3172,6 +3176,7 @@ packages: /matcher@3.0.0: resolution: {integrity: sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==} engines: {node: '>=10'} + requiresBuild: true dependencies: escape-string-regexp: 4.0.0 dev: true @@ -3680,6 +3685,7 @@ packages: /roarr@2.15.4: resolution: {integrity: sha512-CHhPh+UNHD2GTXNYhPWLnU8ONHdI+5DI+4EYIAOaiD63rHeYlZvyh8P+in5999TTSFgUYuKUAjzRI4mdh/p+2A==} engines: {node: '>=8.0'} + requiresBuild: true dependencies: boolean: 3.2.0 detect-node: 2.1.0 @@ -3743,6 +3749,7 @@ packages: /semver-compare@1.0.0: resolution: {integrity: sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==} + requiresBuild: true dev: true optional: true @@ -3762,6 +3769,7 @@ packages: /serialize-error@7.0.1: resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} engines: {node: '>=10'} + requiresBuild: true dependencies: type-fest: 0.13.1 dev: true @@ -3889,6 +3897,7 @@ packages: /sprintf-js@1.1.2: resolution: {integrity: sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==} + requiresBuild: true dev: true optional: true @@ -4115,6 +4124,7 @@ packages: /type-fest@0.13.1: resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} engines: {node: '>=10'} + requiresBuild: true dev: true optional: true @@ -4356,10 +4366,11 @@ packages: engines: {node: '>=10'} dev: true - github.com/OpenAsar/arrpc/b47fd7d498e248955c843a7857dd26478b82190a: - resolution: {tarball: https://codeload.github.com/OpenAsar/arrpc/tar.gz/b47fd7d498e248955c843a7857dd26478b82190a} + github.com/OpenAsar/arrpc/89f4da610ccfac93f461826a446a17cd3b23953d: + resolution: {tarball: https://codeload.github.com/OpenAsar/arrpc/tar.gz/89f4da610ccfac93f461826a446a17cd3b23953d} name: arrpc - version: 3.1.0 + version: 3.2.0 + hasBin: true dependencies: ws: 8.13.0 transitivePeerDependencies: diff --git a/src/main/firstLaunch.ts b/src/main/firstLaunch.ts index b65b930..0ce585d 100644 --- a/src/main/firstLaunch.ts +++ b/src/main/firstLaunch.ts @@ -9,7 +9,7 @@ import { BrowserWindow } from "electron/main"; import { copyFileSync, mkdirSync, readdirSync } from "fs"; import { join } from "path"; import { SplashProps } from "shared/browserWinProperties"; -import { VIEW_DIR } from "shared/paths"; +import { ICON_PATH, VIEW_DIR } from "shared/paths"; import { autoStart } from "./autoStart"; import { DATA_DIR } from "./constants"; @@ -31,7 +31,8 @@ export function createFirstLaunchTour() { frame: true, autoHideMenuBar: true, height: 470, - width: 550 + width: 550, + icon: ICON_PATH }); makeLinksOpenExternally(win); diff --git a/src/main/ipc.ts b/src/main/ipc.ts index d1ab771..6a489fc 100644 --- a/src/main/ipc.ts +++ b/src/main/ipc.ts @@ -4,7 +4,8 @@ * Copyright (c) 2023 Vendicated and Vencord contributors */ -import { app, dialog, session, shell } from "electron"; +import { execFile } from "child_process"; +import { app, dialog, RelaunchOptions, session, shell } from "electron"; import { mkdirSync, readFileSync, watch } from "fs"; import { open, readFile } from "fs/promises"; import { release } from "os"; @@ -45,7 +46,14 @@ handle(IpcEvents.SET_SETTINGS, (_, settings: typeof Settings.store, path?: strin }); handle(IpcEvents.RELAUNCH, () => { - app.relaunch(); + const options: RelaunchOptions = { + args: process.argv.slice(1).concat(["--relaunch"]) + }; + if (app.isPackaged && process.env.APPIMAGE) { + execFile(process.env.APPIMAGE, options.args); + } else { + app.relaunch(options); + } app.exit(); }); diff --git a/src/main/mainWindow.ts b/src/main/mainWindow.ts index aab75de..57e53e8 100644 --- a/src/main/mainWindow.ts +++ b/src/main/mainWindow.ts @@ -147,6 +147,8 @@ async function clearData(win: BrowserWindow) { app.quit(); } +type MenuItemList = Array; + function initMenuBar(win: BrowserWindow) { const isWindows = process.platform === "win32"; const isDarwin = process.platform === "darwin"; @@ -181,14 +183,38 @@ function initMenuBar(win: BrowserWindow) { app.quit(); } }, - isDarwin && { - label: "Hide", - role: "hide" - }, - isDarwin && { - label: "Hide others", - role: "hideOthers" - }, + ...(!isDarwin + ? [] + : ([ + { + type: "separator" + }, + { + label: "Settings", + accelerator: "CmdOrCtrl+,", + async click() { + mainWin.webContents.executeJavaScript( + "Vencord.Webpack.Common.SettingsRouter.open('My Account')" + ); + } + }, + { + type: "separator" + }, + { + label: "Hide Vesktop", // Should probably remove the label, but it says "Hide VencordDesktop" instead of "Hide Vesktop" + role: "hide" + }, + { + role: "hideOthers" + }, + { + role: "unhide" + }, + { + type: "separator" + } + ] satisfies MenuItemList)), { label: "Quit", accelerator: wantCtrlQ ? "CmdOrCtrl+Q" : void 0, @@ -213,7 +239,7 @@ function initMenuBar(win: BrowserWindow) { role: "zoomIn", visible: false } - ] satisfies Array; + ] satisfies MenuItemList; const menu = Menu.buildFromTemplate([ { diff --git a/src/main/splash.ts b/src/main/splash.ts index bf910fb..042ecc0 100644 --- a/src/main/splash.ts +++ b/src/main/splash.ts @@ -7,10 +7,13 @@ import { BrowserWindow } from "electron"; import { join } from "path"; import { SplashProps } from "shared/browserWinProperties"; -import { VIEW_DIR } from "shared/paths"; +import { ICON_PATH, VIEW_DIR } from "shared/paths"; export function createSplashWindow() { - const splash = new BrowserWindow(SplashProps); + const splash = new BrowserWindow({ + ...SplashProps, + icon: ICON_PATH + }); splash.loadFile(join(VIEW_DIR, "splash.html")); diff --git a/src/updater/main.ts b/src/updater/main.ts index 9ed64e0..ec42217 100644 --- a/src/updater/main.ts +++ b/src/updater/main.ts @@ -11,7 +11,7 @@ import { makeLinksOpenExternally } from "main/utils/makeLinksOpenExternally"; import { githubGet, ReleaseData } from "main/utils/vencordLoader"; import { join } from "path"; import { IpcEvents } from "shared/IpcEvents"; -import { VIEW_DIR } from "shared/paths"; +import { ICON_PATH, VIEW_DIR } from "shared/paths"; export interface UpdateData { currentVersion: string; @@ -108,7 +108,8 @@ function openNewUpdateWindow() { nodeIntegration: false, contextIsolation: true, sandbox: true - } + }, + icon: ICON_PATH }); makeLinksOpenExternally(win);