# How to package slicer to a zip for publication

**URL:** <https://discourse.slicer.org/t/how-to-package-slicer-to-a-zip-for-publication/43185>\
**Category:** Development\
**Tags:** package\
**Created:** [June 2, 2025, 3:01am UTC](https://discourse.slicer.org/t/how-to-package-slicer-to-a-zip-for-publication/43185 "2025-06-02T03:01:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhaokaien](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/zhaokaien/32/80265_2.png) [@zhaokaien](https://discourse.slicer.org/u/zhaokaien)\
**Post date:** [June 2, 2025, 3:01am UTC](https://discourse.slicer.org/t/how-to-package-slicer-to-a-zip-for-publication/43185/1 "2025-06-02T03:01:05Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [June 3, 2025, 3:47pm UTC](https://discourse.slicer.org/t/how-to-package-slicer-to-a-zip-for-publication/43185/2 "2025-06-03T15:47:57Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![zhaokaien](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/zhaokaien/32/80265_2.png) [@zhaokaien](https://discourse.slicer.org/u/zhaokaien)\
**Post date:** [June 4, 2025, 10:13am UTC](https://discourse.slicer.org/t/how-to-package-slicer-to-a-zip-for-publication/43185/3 "2025-06-04T10:13:01Z")

</div>

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!
