Building From Source
lightGallery Desktop uses a Gulp-based build system to package the application for Windows, macOS, and Linux. This guide provides an overview of how to create distributable installers.
Release Command
To create a release package for your current operating system, run the following command from the project root:
npm run release
This script will first run the production build (gulp build --env=production
) and then execute the appropriate packaging script from the tasks/
directory. The final installer or package will be placed in the releases/
directory.
Note: You can only build the installer for the operating system you are currently running. To generate installers for all three platforms, you need to run the command on each respective OS.
Platform-Specific Details
Windows
The Windows release process creates an .exe
installer using NSIS (Nullsoft Scriptable Install System).
- Script:
tasks/release_windows.js
- Template:
resources/windows/installer.nsi
- Dependencies:
- You must have NSIS installed and its
makensis
command available in your system's PATH. - The
rcedit
npm package is used to modify the Electron executable's icon and metadata.
- You must have NSIS installed and its
macOS
The macOS release process creates a .dmg
disk image.
- Script:
tasks/release_osx.js
- Template:
resources/osx/appdmg.json
- Dependencies:
- The
appdmg
npm package is used to create the.dmg
file. - Code Signing (Optional): The script will attempt to sign the application if a developer identity is provided via the
--sign
flag. You can get a signing identity by enrolling in the Apple Developer Program.
- The
Linux
The Linux release process creates a Debian package (.deb
).
- Script:
tasks/release_linux.js
- Templates:
resources/linux/app.desktop
(for the application shortcut)resources/linux/DEBIAN/control
(for package metadata)
- Dependencies:
- fakeroot: Used to build the package without requiring root privileges.
- dpkg-deb: The core Debian packaging tool.
To install these on a Debian-based system like Ubuntu, you can run:
sudo apt-get update
sudo apt-get install fakeroot dpkg