How to Package a Custom Slicer Application for Distribution

I have built a custom Slicer application using the Kitware SlicerCustomAppTemplate. I have also integrated 5 custom scripted modules successfully.

Now, I would like to package the application so that it can be distributed and installed on other PCs.

What is the recommended way to package and distribute a custom Slicer application with all included modules? Are there specific steps or best practices for creating installers for Windows/Linux/Mac so others can run it without rebuilding?

Any guidance or references would be greatly appreciated. Thank you!

You simply need to build the Package project in the inner Slicer-build directory, just like when you want to package the vanilla Slicer. All the custom modules (and open-source extensions) you have included in the main CMake will be packaged as well, along with all the resources that are included in CMake as resources.

On Windows it is starting build for the PACKAGE project only in said solution. On Linux, it is running make package from said directory. On Mac I’m not sure exactly but you basically need to build that project.

The installer will be generated in the same Slicer-build directory.

Do we just need to open the Slicer-build solution (Slicer.sln) in Visual Studio and build the PACKAGE project directly, or is it necessary to make changes in the root CMake for packaging?

No need to change anything.

Do we just need to open the Slicer-build solution (Slicer.sln) in Visual Studio and build the PACKAGE project directly

Yes.

I followed the same steps you mentioned, but when I click on Build Only Packages, I get these two errors:
PACKAGE EXEC 1
PACKAGE Microsoft.CppCommon.targets 166

C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets

Well, the project in my screenshot does not seem to be the correct one (I never do this via VS, at least not in the past few years). But basically you need to build this one:

c:\d\S5R\Slicer-build\PACKAGE.vcxproj