Skip to content

Commit

Permalink
[TASK] Windows Installer
Browse files Browse the repository at this point in the history
  • Loading branch information
mjonuschat committed Nov 2, 2024
1 parent 2e4f84e commit 8382e6c
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 3 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/build_prusa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
Expand Down
35 changes: 32 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$<TARGET_PROPERTY:${target},BINARY_DIR>/$<CONFIG>")
set(_out_dir "$<TARGET_PROPERTY:${target},BINARY_DIR>/$<CONFIG>")
else ()
set (_out_dir "$<TARGET_PROPERTY:${target},BINARY_DIR>")
set(_out_dir "$<TARGET_PROPERTY:${target},BINARY_DIR>")
endif ()

# This has to be a separate target due to the windows command line lenght limits
Expand Down Expand Up @@ -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)
5 changes: 5 additions & 0 deletions version.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 8382e6c

Please sign in to comment.