Skip to content

Commit

Permalink
Merge pull request #841 from nextcloud/build/windows-squirrel
Browse files Browse the repository at this point in the history
build: add Squirrel.Windows
  • Loading branch information
ShGKme authored Oct 31, 2024
2 parents 8e722fb + 1089308 commit 57c7fcd
Show file tree
Hide file tree
Showing 6 changed files with 33,166 additions and 34,132 deletions.
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"
81 changes: 60 additions & 21 deletions forge.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,32 @@
const path = require('node:path')
const fs = require('node:fs')
const semver = require('semver')
const { MakerSquirrel } = require('@electron-forge/maker-squirrel')
const { MakerZIP } = require('@electron-forge/maker-zip')
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 @@ -52,25 +66,50 @@ module.exports = {
},
},

rebuildConfig: {},
// https://electron.github.io/packager/main/interfaces/Options.html
packagerConfig: {
// Common
name: CONFIG.applicationName,
icon: path.join(__dirname, './img/icons/icon'),
appCopyright: `Copyright © ${YEAR} ${CONFIG.companyName}`,
asar: true,

makers: [
// {
// name: '@electron-forge/maker-squirrel',
// config: {},
// },
{
name: '@electron-forge/maker-zip',
// platforms: ['darwin'],
// Windows
win32metadata: {
CompanyName: CONFIG.companyName,
},
// {
// name: '@electron-forge/maker-deb',
// config: {},
// },
// {
// name: '@electron-forge/maker-rpm',
// config: {},
// },

// 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: [
// https://github.com/squirrel/squirrel.windows
// https://js.electronforge.io/interfaces/_electron_forge_maker_squirrel.InternalOptions.SquirrelWindowsOptions.html#setupExe
new MakerSquirrel({
// 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'),
}),

// Portable, all platforms
new MakerZIP(),
],

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

0 comments on commit 57c7fcd

Please sign in to comment.