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

Add Windows installer (fixes #2081) #4418

Closed
wants to merge 13 commits into from
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release

on:
push:

jobs:
build-windows-installer:
name: Build Windows Installer
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: npm install

- name: Run installer build
run: npm run make

- name: Publish installer artifact
uses: actions/upload-artifact@v3
with:
name: Trilium Notes for Windows (.exe)
path: out/make/squirrel.windows/x64/*.exe
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ data/
data-test/
tmp/
.eslintcache

out/
4 changes: 4 additions & 0 deletions electron.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
'use strict';

const {app, globalShortcut, BrowserWindow} = require('electron');

// Prevent Trilium starting twice on first install and on uninstall for the Windows installer.
if (require('electron-squirrel-startup')) return;

const sqlInit = require('./src/services/sql_init');
const appIconService = require('./src/services/app_icon');
const windowService = require('./src/services/window');
Expand Down
23 changes: 23 additions & 0 deletions forge.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
packagerConfig: {
asar: true,
// icon will break once we add .dmg support, since the .ico & .icns have to be in same dir (see https://www.electronforge.io/guides/create-and-add-icons#windows-and-macos)
icon: "./images/app-icons/win/icon"
},
rebuildConfig: {},
makers: [
{
name: '@electron-forge/maker-squirrel',
config: {
setupIcon: "./images/app-icons/win/icon.ico",
loadingGif: "./images/app-icons/win/setup-banner.gif"
}
}
],
plugins: [
{
name: '@electron-forge/plugin-auto-unpack-natives',
config: {},
},
],
};
Binary file added images/app-icons/win/setup-banner.gif
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 images/app-icons/win/setup-banner.xcf
Binary file not shown.
Loading