diff --git a/.github/workflows/build_prusa.yml b/.github/workflows/build_prusa.yml index 9f6d10b5503..f7fd7a9b0af 100644 --- a/.github/workflows/build_prusa.yml +++ b/.github/workflows/build_prusa.yml @@ -132,11 +132,23 @@ jobs: if: inputs.os == 'windows-latest' uses: microsoft/setup-msbuild@v2 + - name: Install nsis + if: inputs.os == 'windows-latest' + run: | + dir "C:/Program Files (x86)/Windows Kits/10/Include" + choco install nsis + - name: Build slicer Win if: inputs.os == 'windows-latest' working-directory: ${{ github.workspace }} run: .\build_win.bat -d=.\deps\build\PrusaSlicer_dep -c=Release -s=app -r=none + - name: Create installer Win + if: inputs.os == 'windows-latest' + working-directory: ${{ github.workspace }}/build + run: | + cpack -G NSIS + - name: Pack app if: inputs.os == 'windows-latest' working-directory: ${{ github.workspace }}/build/src/Release @@ -150,6 +162,13 @@ jobs: name: PrusaSlicer-${{ env.ver }}+win64-${{ env.date }} path: ${{ github.workspace }}\build\PrusaSlicer-${{ env.ver }}+win64-${{ env.date }}.zip + - name: Upload artifacts Win installer + if: inputs.os == 'windows-latest' + uses: actions/upload-artifact@v4 + with: + name: PrusaSlicer-Installer-${{ env.ver }}+win64-${{ env.date }} + path: ${{ github.workspace }}\build\PrusaSlicer-Installer*.exe + # Ubuntu - name: Install dependencies if: inputs.os == 'ubuntu-22.04' diff --git a/CMakeLists.txt b/CMakeLists.txt index 36e48a691af..1a9792b3eae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -591,11 +591,11 @@ function(prusaslicer_copy_dlls target) get_target_property(_alt_out_dir ${target} RUNTIME_OUTPUT_DIRECTORY) if (_alt_out_dir) - set (_out_dir "${_alt_out_dir}") + set(_out_dir "${_alt_out_dir}") elseif (_is_multi) - set (_out_dir "$/$") + set(_out_dir "$/$") else () - set (_out_dir "$") + set(_out_dir "$") endif () # This has to be a separate target due to the windows command line lenght limits @@ -658,4 +658,33 @@ else () install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "${CMAKE_INSTALL_PREFIX}/resources") endif () +install(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION ".") configure_file(src/platform/unix/fhs.hpp.in ${LIBDIR_BIN}/platform/unix/fhs.hpp) + +set(CPACK_PACKAGE_NAME "PrusaSlicer+BOSS") +set(CPACK_PACKAGE_VENDOR "mjonuschat") +set(CPACK_PACKAGE_VERSION_MAJOR "${SLIC3R_VERSION_MAJOR}") +set(CPACK_PACKAGE_VERSION_MINOR "${SLIC3R_VERSION_MINOR}") +set(CPACK_PACKAGE_VERSION_PATCH "${SLIC3R_VERSION_PATCH}") +set(CPACK_PACKAGE_FILE_NAME "PrusaSlicer-Installer-${SLIC3R_VERSION}+BOSS") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)") +set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/mjonuschat/PrusaSlicer") +set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME}) +set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/resources/icons\\\\PrusaSlicer.ico") +set(CPACK_NSIS_MUI_ICON "${CPACK_PACKAGE_ICON}") +set(CPACK_NSIS_MUI_UNIICON "${CPACK_PACKAGE_ICON}") +set(CPACK_NSIS_INSTALLED_ICON_NAME "$INSTDIR\\\\prusa-slicer.exe") +set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS " + CreateShortCut \\\"$DESKTOP\\\\PrusaSlicer+BOSS.lnk\\\" \\\"$INSTDIR\\\\prusa-slicer.exe\\\" +") +set(CPACK_PACKAGE_CHECKSUM SHA256) +set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "PrusaSlicer+BOSS") +set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON) +set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".") +set(CPACK_PACKAGE_EXECUTABLES "prusa-slicer;PrusaSlicer") +set(CPACK_CREATE_DESKTOP_LINKS "prusa-slicer") +set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE) # must also include in install command + +set(CPACK_WIX_UPGRADE_GUID "9a6335f7-22a8-4da8-8475-fc6f03404544") +set(CPACK_GENERATOR NSIS) +include(CPack) diff --git a/version.inc b/version.inc index 6a581b8476c..fff32e4314e 100644 --- a/version.inc +++ b/version.inc @@ -7,3 +7,8 @@ set(SLIC3R_VERSION "2.8.1") set(SLIC3R_BUILD_ID "PrusaSlicer-${SLIC3R_VERSION}+UNKNOWN") set(SLIC3R_RC_VERSION "2,8,1,0") set(SLIC3R_RC_VERSION_DOTS "2.8.1.0") + +string(REPLACE "," ";" VERSION_LIST ${SLIC3R_RC_VERSION}) +list(GET VERSION_LIST 0 SLIC3R_VERSION_MAJOR) +list(GET VERSION_LIST 1 SLIC3R_VERSION_MINOR) +list(GET VERSION_LIST 2 SLIC3R_VERSION_PATCH)