How to package slicer to a zip for publication

Hello, I have successfully built Slicer v5.9 from source code, and Slicer runs normally. I’ve also performed custom development on Slicer, and everything works as expected. Now, I need to INSTALL and PACKAGE Slicer so we can properly distribute it to users for testing. However, when I try to INSTALL, I get an error in Visual Studio. When I try to PACKAGE, there’s no error, and an .exe file is generated normally. When I double-click this .exe file, it prompts me to install it. I’ve found Slicer’s official documentation on this part to be very brief, only providing a single command for how to execute PACKAGE. I’d like to ask, is it normal for INSTALL to fail but PACKAGE to succeed? How can I package Slicer into a ZIP file? Thanks to all the experts in the forum for your guidance! Thank you!

I don’t know about packaging in Visual Studio, but if you successfully build your Slicer and everything is working fine, you can simply zip that folder and give it to your users. Slicer is portable. I don’t think you need to build an installer…

Thank you for your replying, I set variables like CMAKE_INSTALL_PREFIX and CPACK_GENERATOR in the CMake GUI, but after generation, these variables don’t seem to have any effect. Ultimately, an executable file named Slicer-5.9.0-2025-05-28-win-amd64.exe and a folder named Slicer-5.9.0-2025-05-28-win-amd64 are still generated in this directory on my computer: E:\D\SR\Slicer-build\_CPack_Packages\win-amd64\NSIS. The .exe file is an installer, and all the files in the folder are what this installer compresses.

I’m currently trying to zip this folder and distribute it to users. The program runs, but there’s an issue: this zipped folder seems to depend on my python-install directory from when I built Slicer. I originally thought the packaged files would include Slicer’s own Python environment, but that’s not the case, which is causing me a lot of trouble. Did I not set things up correctly during the build process, leading to the packaging process not including the necessary files from the python-install folder?I don’t know how to package the “python-install” dir into the zip, Could you please guide me again? Thanks!