Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add Squirrel.Windows #841

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ SPDX-FileCopyrightText = "2017 Feandesign https://soundcloud.com/feandesign"
SPDX-License-Identifier = "CC0-1.0"

[[annotations]]
path = ["img/talk-icon-**.svg", "img/icons/**"]
path = ["img/talk-icon-**.svg", "img/icons/**", "img/squirrel-install-loading.gif"]
precedence = "aggregate"
SPDX-FileCopyrightText = "Nextcloud GmbH <https://nextcloud.com/trademarks/>"
SPDX-License-Identifier = "LicenseRef-NextcloudTrademarks"
84 changes: 67 additions & 17 deletions forge.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,30 @@
const path = require('node:path')
const fs = require('node:fs')
const semver = require('semver')
const packageJSON = require('./package.json')
const { MIN_REQUIRED_BUILT_IN_TALK_VERSION } = require('./src/constants.js')

require('dotenv').config()

const CONFIG = {
// General
applicationName: packageJSON.productName,
applicationNameSanitized: packageJSON.productName.replaceAll(' ', '-'),
companyName: 'Nextcloud GmbH',
description: packageJSON.description,

// macOS
macAppId: 'com.nextcloud.NextcloudTalk',
// Windows
winAppId: 'NextcloudTalk',
}

const YEAR = new Date().getFullYear()

const TALK_PATH = path.resolve(__dirname, process.env.TALK_PATH ?? 'spreed')
let talkPackageJson

module.exports = {
packagerConfig: {
icon: './img/icons/icon',
},

hooks: {
generateAssets() {
if (!fs.existsSync(process.env.TALK_PATH)) {
Expand Down Expand Up @@ -50,23 +62,61 @@ module.exports = {

rebuildConfig: {},

packagerConfig: {
// Common
name: CONFIG.applicationName,
icon: path.join(__dirname, './img/icons/icon'),
appCopyright: `Copyright © ${YEAR} ${CONFIG.companyName}`,
asar: true,

// Windows
win32metadata: {
CompanyName: CONFIG.companyName,
},

// macOS
appBundleId: CONFIG.macAppId,
darwinDarkModeSupport: true,
appCategoryType: 'public.app-category.social-networking', // LSApplicationCategoryType | https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html
},

makers: [
// {
// name: '@electron-forge/maker-squirrel',
// config: {},
// },
{
name: '@electron-forge/maker-squirrel',
platforms: ['win32'],
config: {
// App/Filenames
name: CONFIG.winAppId,
setupExe: `${CONFIG.applicationNameSanitized}-v${packageJSON.version}-win-x64.exe`,
exe: `${CONFIG.applicationName}.exe`,

// Meta
title: CONFIG.applicationName,
authors: CONFIG.companyName,
owners: CONFIG.companyName,
description: CONFIG.description,

// Icons
setupIcon: path.join(__dirname, './img/icons/icon.ico'),
iconUrl: 'https://raw.githubusercontent.com/nextcloud/talk-desktop/refs/heads/main/img/icons/icon.ico',

// Install/Update Loading
loadingGif: path.join(__dirname, './img/squirrel-install-loading.gif'),

// TODO: Check if this is as useful as WIX
// noMsi: false,
// setupMsi: `${CONFIG.applicationNameSanitized}-v${packageJSON.version}-win-x64.msi`,

// TODO: Sign
// certificateFile:
// certificatePassword:
},
},

// Portable, all platforms
{
name: '@electron-forge/maker-zip',
// platforms: ['darwin'],
},
// {
// name: '@electron-forge/maker-deb',
// config: {},
// },
// {
// name: '@electron-forge/maker-rpm',
// config: {},
// },
],

plugins: [
Expand Down
Binary file added img/squirrel-install-loading.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading