1. Building & Development Environment
Ben Olden-Cooligan edited this page Apr 23, 2023
·
8 revisions
Clone this wiki locally
Getting Started
You can open the NAPS2 solution with:
Or, optionally, you can use a text editor with the dotnet CLI.
You will also need to install:
- (All platforms) The latest dotnet sdk. VS/Rider may install this for you.
- (All platforms) The macos workload:
dotnet workload install macos
- (Windows-only) The .NET Framework 4.6.2 developer pack.
With the above prerequisites, it should be possible to build and run NAPS2 with your IDE or the dotnet CLI.
You'll want to run the right project for your platform:
- (Windows) NAPS2.App.WinForms
- (Mac) NAPS2.App.Mac
- (Linux) NAPS2.App.Gtk
Note that it may not be possible to attach a debugger for the Linux/Mac apps.
Packages
To build NAPS2 installer packages, you will need:
Windows
- Inno Setup (for the .exe installer)
- WiX Toolset (for the .msi installer)
Mac
Linux
-
flatpak-builder and the Freedesktop SDK
sudo apt install flatpak flatpak-builder
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install flathub org.freedesktop.Platform/x86_64/22.08 org.freedesktop.Sdk/x86_64/22.08 org.freedesktop.Sdk.Extension.dotnet6/x86_64/22.08
- For building arm64 flatpaks on x64:
sudo apt install qemu-user-static
flatpak install flathub org.freedesktop.Platform/aarch64/22.08 org.freedesktop.Sdk/aarch64/22.08 org.freedesktop.Sdk.Extension.dotnet6/aarch64/22.08
- For building .rpm on .deb-based distros:
sudo apt install rpm
Once you have the necessary prerequisites, have a look at NAPS2.Tools, specifically the n2 pkg
command.
Build Configurations
The NAPS2 solution has the following build configurations. You may get build errors if you don't use the platform-specific builds, though you can ignore those errors.
- Debug - Debug with most localized resources disabled for faster compiling.
- DebugLang - Debug with full localization.
- Debug-Windows - Debug with only projects needed for Windows.
- Debug-Linux - Debug with only projects needed for Linux.
- Debug-Mac - Debug with only projects needed for Mac.
- Release - For the Windows .exe and Mac production builds.
- Release-Linux - For the Linux production build.
- Release-Msi - For the Windows .msi production build.
- Release-Zip - For the Windows .zip production build.