diff --git a/.github/workflows/build_story_editor_windows.yml b/.github/workflows/build_story_editor_windows.yml index 06042ac..a3b0273 100644 --- a/.github/workflows/build_story_editor_windows.yml +++ b/.github/workflows/build_story_editor_windows.yml @@ -35,6 +35,26 @@ jobs: run : | mkdir build cd build - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=${{ github.workspace }}\Qt\6.5.1\msvc2019_64 -DQT_DIR=${{ github.workspace }}\Qt\6.5.1\msvc2019_64\lib\cmake\Qt6 -G Ninja .. + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=${{ github.workspace }}\Qt\${{ env.QT_VERSION }}\msvc2019_64 -DQT_DIR=${{ github.workspace }}\Qt\6.5.1\msvc2019_64\lib\cmake\Qt6 -G Ninja .. ninja ls + mkdir story-editor + cp story-editor.exe story-editor + windeployqt story-editor/story-editor.exe --release + copy C:\Windows\System32\vccorlib140.dll story-editor\ + copy C:\Windows\System32\msvcp140.dll story-editor\ + copy C:\Windows\System32\vcruntime140.dll story-editor\ + ${{ github.workspace }}/Qt/${{ env.QT_VERSION }}/msvc2019_64/bin/windeployqt.exe story-editor\story-editor.exe + Compress-Archive story-editor StoryEditor-Windows.zip + makensis.exe /V3 nsis-installer.nsi + - name: upload_artefact + uses: actions/upload-artifact@v3 + with: + name: StoryEditorWindows-Zip + path: ./story-editor/build/StoryEditor-Windows.zip + - name: upload_artefact + uses: actions/upload-artifact@v3 + with: + name: StoryEditorWindows-Setup + path: ./story-editor/build/story-editor-setup.exe + diff --git a/story-editor/CMakeLists.txt b/story-editor/CMakeLists.txt index d9a6a53..44b970e 100644 --- a/story-editor/CMakeLists.txt +++ b/story-editor/CMakeLists.txt @@ -151,7 +151,9 @@ set(NODEEDITOR_HEADER_FILES ./nodeeditor/include/QtNodes/internal/UndoCommands.hpp ) - +if (WIN32) + list(APPEND PROJECT_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/icon.rc") +endif() qt_add_executable(${PROJECT_NAME} MANUAL_FINALIZATION @@ -174,6 +176,9 @@ target_link_libraries(${PROJECT_NAME} PUBLIC QHexView ) + + + if (UNIX) target_link_libraries(${PROJECT_NAME} PUBLIC dl) endif (UNIX) diff --git a/story-editor/icon.rc b/story-editor/icon.rc new file mode 100644 index 0000000..28fac41 --- /dev/null +++ b/story-editor/icon.rc @@ -0,0 +1 @@ +IDI_ICON1 ICON DISCARDABLE "story-editor-logo.ico" diff --git a/story-editor/nsis-installer.nsi b/story-editor/nsis-installer.nsi new file mode 100644 index 0000000..7330313 --- /dev/null +++ b/story-editor/nsis-installer.nsi @@ -0,0 +1,53 @@ +# define installer name +!define APPNAME "StoryEditor" +!define COMPANYNAME "OpenStoryTeller" +!define DESCRIPTION "A story editor using graphical nodes, for the OpenStoryTeller project. http://openstoryteller.org" + +!define VERSIONMAJOR 1 +!define VERSIONMINOR 3 +!define VERSIONBUILD 4 +OutFile "build/story-editor-setup.exe" + +# set desktop as install directory +InstallDir "$PROGRAMFILES64\${APPNAME}" +Name "${COMPANYNAME} - ${APPNAME}" + +# default section start +Section + +# define output path +SetOutPath $INSTDIR + +# specify file to go in output path +File /r "build/story-editor\*" +File "story-editor-logo.ico" + +# define uninstaller name +WriteUninstaller $INSTDIR\uninstaller.exe + +# Create shortcut +SetShellVarContext all +CreateDirectory "$SMPROGRAMS\${COMPANYNAME}" +CreateShortCut "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" "$INSTDIR\story-editor.exe" "" "$INSTDIR\story-editor-logo.ico" +SetShellVarContext current + + +#------- +# default section end +SectionEnd + +# create a section to define what the uninstaller does. +# the section will always be named "Uninstall" +Section "Uninstall" + +# Always delete uninstaller first +Delete $INSTDIR\uninstaller.exe +Delete "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" +Delete $INSTDIR\story-editor-logo.ico + +# now delete installed file +Delete $INSTDIR\* + +# Delete the directory +RMDir /r $INSTDIR +SectionEnd diff --git a/story-editor/story-editor-logo.ico b/story-editor/story-editor-logo.ico new file mode 100644 index 0000000..667cf60 Binary files /dev/null and b/story-editor/story-editor-logo.ico differ