Skip to content

1. Building & Development Environment

Ben Olden-Cooligan edited this page Mar 15, 2024 · 14 revisions

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.
  • (Linux-only) Packages fonts-liberation2, fonts-noto-core, fonts-noto-cjk (may be pre-installed depending on distro)

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

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/23.08 org.freedesktop.Sdk/x86_64/23.08 org.freedesktop.Sdk.Extension.dotnet8/x86_64/23.08
  • For building arm64 flatpaks on x64:
    • sudo apt install qemu-user-static
    • flatpak install flathub org.freedesktop.Platform/aarch64/23.08 org.freedesktop.Sdk/aarch64/23.08 org.freedesktop.Sdk.Extension.dotnet8/aarch64/23.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-Windows - For the Windows .exe production build.
  • Release-Mac - For the Mac production build.
  • Release-Linux - For the Linux production build.
  • Release-Msi - For the Windows .msi production build.
  • Release-Zip - For the Windows .zip production build.
  • Sdk - For the SDK release build.
  • Tools - Only the NAPS2.Tools project.