added NSIS script

This commit is contained in:
Syping 2019-10-18 15:26:59 +02:00
parent a509408b05
commit 6c76172378
4 changed files with 273 additions and 6 deletions

258
.ci/luaengine.nsi Normal file
View file

@ -0,0 +1,258 @@
######################################################################
!define APP_NAME "LuaEngine"
!define COMP_NAME "Syping"
!define WEB_SITE "https://luaengine.syping.de/"
!define VERSION "0.1.0.0"
!define COPYRIGHT "Copyright © 2018-2019 Syping"
!define DESCRIPTION "LuaEngine Runtime and Compiler"
!define INSTALLER_NAME "luaengine_setup.exe"
!define MAIN_APP_RUNTIME "LuaEngine.exe"
!define MAIN_APP_COMPILER "luaenginec.exe"
!define INSTALL_TYPE "SetShellVarContext all"
!define REG_ROOT "HKLM"
!define REG_APP_RUNTIME "Software\Microsoft\Windows\CurrentVersion\App Paths\${MAIN_APP_RUNTIME}"
!define REG_APP_COMPILER "Software\Microsoft\Windows\CurrentVersion\App Paths\${MAIN_APP_COMPILER}"
!define REG_ENV_RUNTIME "System\ControlSet001\Control\Session Manager\Environment\LUAENGINE_RUNTIME"
!define UNINSTALL_PATH "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}"
!define LICENSE_TXT "LICENSE"
######################################################################
VIProductVersion "${VERSION}"
VIAddVersionKey "ProductName" "${APP_NAME}"
VIAddVersionKey "ProductVersion" "${VERSION}"
VIAddVersionKey "CompanyName" "${COMP_NAME}"
VIAddVersionKey "LegalCopyright" "${COPYRIGHT}"
VIAddVersionKey "FileDescription" "${DESCRIPTION}"
VIAddVersionKey "FileVersion" "${VERSION}"
######################################################################
!include "x64.nsh"
SetCompressor LZMA
Name "${APP_NAME}"
Caption "${APP_NAME}"
OutFile "${INSTALLER_NAME}"
#BrandingText "${APP_NAME}"
XPStyle on
Unicode true
InstallDirRegKey "${REG_ROOT}" "${REG_APP_RUNTIME}" ""
InstallDir "$PROGRAMFILES64\Syping\LuaEngine"
######################################################################
!include "MUI2.nsh"
!define MUI_ABORTWARNING
!define MUI_UNABORTWARNING
!define MUI_LANGDLL_REGISTRY_ROOT "${REG_ROOT}"
!define MUI_LANGDLL_REGISTRY_KEY "${UNINSTALL_PATH}"
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
!insertmacro MUI_PAGE_WELCOME
!ifdef LICENSE_TXT
!insertmacro MUI_PAGE_LICENSE "${LICENSE_TXT}"
!endif
!insertmacro MUI_PAGE_DIRECTORY
!ifdef REG_START_MENU
!define MUI_STARTMENUPAGE_NODISABLE
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "LuaEngine"
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${REG_ROOT}"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "${UNINSTALL_PATH}"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${REG_START_MENU}"
!insertmacro MUI_PAGE_STARTMENU Application $SM_Folder
!endif
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_RUN "$INSTDIR\${MAIN_APP_RUNTIME}"
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_RESERVEFILE_LANGDLL
######################################################################
Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
!ifdef WIN32
MessageBox MB_OK|MB_ICONSTOP "Windows 32-Bit is not supported anymore!"
Quit
!endif
SetRegView 64
FunctionEnd
######################################################################
Section -MainProgram
${INSTALL_TYPE}
SetOverwrite ifnewer
SetOutPath "$INSTDIR"
File "LuaEngine.dll"
File "LuaEngine.exe"
File "luaenginec.exe"
File "LuaEngineGui.dll"
File "LuaEngineIO.dll"
File "LuaEngineOS.dll"
File "/usr/lib/gcc/x86_64-w64-mingw32/8.3-win32/libgcc_s_seh-1.dll"
File "/usr/lib/gcc/x86_64-w64-mingw32/8.3-win32/libstdc++-6.dll"
File "/opt/windev/libjpeg-turbo-latest_qt64d/bin/libjpeg-62.dll"
File "/opt/windev/qt64d-latest/bin/Qt5Core.dll"
File "/opt/windev/qt64d-latest/bin/Qt5Gui.dll"
File "/opt/windev/qt64d-latest/bin/Qt5Svg.dll"
File "/opt/windev/qt64d-latest/bin/Qt5Widgets.dll"
SetOutPath "$INSTDIR\sstubs"
File "windows.le"
SetOutPath "$INSTDIR\imageformats"
File "/opt/windev/qt64d-latest/plugins/imageformats/qgif.dll"
File "/opt/windev/qt64d-latest/plugins/imageformats/qicns.dll"
File "/opt/windev/qt64d-latest/plugins/imageformats/qico.dll"
File "/opt/windev/qt64d-latest/plugins/imageformats/qjpeg.dll"
File "/opt/windev/qt64d-latest/plugins/imageformats/qsvg.dll"
File "/opt/windev/qt64d-latest/plugins/imageformats/qtga.dll"
File "/opt/windev/qt64d-latest/plugins/imageformats/qtiff.dll"
File "/opt/windev/qt64d-latest/plugins/imageformats/qwbmp.dll"
File "/opt/windev/qt64d-latest/plugins/imageformats/qwebp.dll"
SetOutPath "$INSTDIR\platforms"
File "/opt/windev/qt64d-latest/plugins/platforms/qwindows.dll"
SetOutPath "$INSTDIR\styles"
File "/opt/windev/qt64d-latest/plugins/styles/qcleanlooksstyle.dll"
File "/opt/windev/qt64d-latest/plugins/styles/qplastiquestyle.dll"
File "/opt/windev/qt64d-latest/plugins/styles/qwindowsvistastyle.dll"
SectionEnd
######################################################################
Section -Icons_Reg
SetOutPath "$INSTDIR"
WriteUninstaller "$INSTDIR\uninstall.exe"
!ifdef REG_START_MENU
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
CreateDirectory "$SMPROGRAMS\$SM_Folder"
CreateShortCut "$SMPROGRAMS\$SM_Folder\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_RUNTIME}"
CreateShortCut "$SMPROGRAMS\$SM_Folder\${APP_NAME} Compiler.lnk" "$INSTDIR\${MAIN_APP_COMPILER}"
CreateShortCut "$SMPROGRAMS\$SM_Folder\Uninstall ${APP_NAME}.lnk" "$INSTDIR\uninstall.exe"
!ifdef WEB_SITE
WriteIniStr "$INSTDIR\${APP_NAME} Website.url" "InternetShortcut" "URL" "${WEB_SITE}"
CreateShortCut "$SMPROGRAMS\$SM_Folder\${APP_NAME} Website.lnk" "$INSTDIR\${APP_NAME} Website.url"
!endif
!insertmacro MUI_STARTMENU_WRITE_END
!endif
!ifndef REG_START_MENU
CreateDirectory "$SMPROGRAMS\LuaEngine"
CreateShortCut "$SMPROGRAMS\LuaEngine\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_RUNTIME}"
CreateShortCut "$SMPROGRAMS\LuaEngine\Uninstall ${APP_NAME}.lnk" "$INSTDIR\uninstall.exe"
!ifdef WEB_SITE
WriteIniStr "$INSTDIR\${APP_NAME} Website.url" "InternetShortcut" "URL" "${WEB_SITE}"
CreateShortCut "$SMPROGRAMS\LuaEngine\${APP_NAME} Website.lnk" "$INSTDIR\${APP_NAME} Website.url"
!endif
!endif
WriteRegStr ${REG_ROOT} "${REG_APP_RUNTIME}" "" "$INSTDIR\${MAIN_APP_RUNTIME}"
WriteRegStr ${REG_ROOT} "${REG_APP_COMPILER}" "" "$INSTDIR\${MAIN_APP_COMPILER}"
WriteRegStr ${REG_ROOT} "${REG_ENV_RUNTIME}" "" "$INSTDIR\${MAIN_APP_RUNTIME}"
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayName" "${APP_NAME}"
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "UninstallString" "$INSTDIR\uninstall.exe"
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayIcon" "$INSTDIR\${MAIN_APP_RUNTIME}"
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayVersion" "${VERSION}"
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "Publisher" "${COMP_NAME}"
!ifdef WEB_SITE
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "URLInfoAbout" "${WEB_SITE}"
!endif
SectionEnd
######################################################################
Section Uninstall
${INSTALL_TYPE}
Delete "$INSTDIR\LuaEngine.dll"
Delete "$INSTDIR\LuaEngine.exe"
Delete "$INSTDIR\luaenginec.exe"
Delete "$INSTDIR\LuaEngineGui.dll"
Delete "$INSTDIR\LuaEngineIO.dll"
Delete "$INSTDIR\LuaEngineOS.dll"
Delete "$INSTDIR\libgcc_s_seh-1.dll"
Delete "$INSTDIR\libstdc++-6.dll"
Delete "$INSTDIR\libjpeg-62.dll"
Delete "$INSTDIR\Qt5Core.dll"
Delete "$INSTDIR\Qt5Gui.dll"
Delete "$INSTDIR\Qt5Svg.dll"
Delete "$INSTDIR\Qt5Widgets.dll"
Delete "$INSTDIR\sstubs\windows.le"
Delete "$INSTDIR\imageformats\qgif.dll"
Delete "$INSTDIR\imageformats\qicns.dll"
Delete "$INSTDIR\imageformats\qico.dll"
Delete "$INSTDIR\imageformats\qjpeg.dll"
Delete "$INSTDIR\imageformats\qsvg.dll"
Delete "$INSTDIR\imageformats\qtga.dll"
Delete "$INSTDIR\imageformats\qtiff.dll"
Delete "$INSTDIR\imageformats\qwbmp.dll"
Delete "$INSTDIR\imageformats\qwebp.dll"
Delete "$INSTDIR\platforms\qwindows.dll"
Delete "$INSTDIR\styles\qcleanlooksstyle.dll"
Delete "$INSTDIR\styles\qplastiquestyle.dll"
Delete "$INSTDIR\styles\qwindowsvistastyle.dll"
RmDir "$INSTDIR\sstubs"
RmDir "$INSTDIR\imageformats"
RmDir "$INSTDIR\platforms"
RmDir "$INSTDIR\styles"
Delete "$INSTDIR\uninstall.exe"
!ifdef WEB_SITE
Delete "$INSTDIR\${APP_NAME} Website.url"
!endif
RmDir "$INSTDIR"
!ifdef REG_START_MENU
!insertmacro MUI_STARTMENU_GETFOLDER "Application" $SM_Folder
Delete "$SMPROGRAMS\$SM_Folder\${APP_NAME}.lnk"
Delete "$SMPROGRAMS\LuaEngine\${APP_NAME} Compiler.lnk"
Delete "$SMPROGRAMS\$SM_Folder\Uninstall ${APP_NAME}.lnk"
!ifdef WEB_SITE
Delete "$SMPROGRAMS\$SM_Folder\${APP_NAME} Website.lnk"
!endif
RmDir "$SMPROGRAMS\$SM_Folder"
!endif
!ifndef REG_START_MENU
Delete "$SMPROGRAMS\LuaEngine\${APP_NAME}.lnk"
Delete "$SMPROGRAMS\LuaEngine\${APP_NAME} Compiler.lnk"
Delete "$SMPROGRAMS\LuaEngine\Uninstall ${APP_NAME}.lnk"
!ifdef WEB_SITE
Delete "$SMPROGRAMS\LuaEngine\${APP_NAME} Website.lnk"
!endif
RmDir "$SMPROGRAMS\LuaEngine"
!endif
DeleteRegKey ${REG_ROOT} "${REG_APP_RUNTIME}"
DeleteRegKey ${REG_ROOT} "${REG_APP_COMPILER}"
DeleteRegKey ${REG_ROOT} "${REG_ENV_RUNTIME}"
DeleteRegKey ${REG_ROOT} "${UNINSTALL_PATH}"
SectionEnd
######################################################################
Function un.onInit
!insertmacro MUI_UNGETLANGUAGE
SetRegView 64
FunctionEnd
######################################################################

View file

@ -10,7 +10,7 @@ LuaEngine Windows:
script: script:
- mkdir -p ${CI_PROJECT_DIR}/build - mkdir -p ${CI_PROJECT_DIR}/build
- cd ${CI_PROJECT_DIR}/build - cd ${CI_PROJECT_DIR}/build
- qmake CONFIG+=WITH_LUAENGINECOM CONFIG+=WITH_LUAENGINERUN ${CI_PROJECT_DIR}/luaengine.pro - qmake CONFIG+=WITH_LUAENGINE_COMPILER CONFIG+=WITH_LUAENGINE_RUNTIME ${CI_PROJECT_DIR}/luaengine.pro
- make -j4 - make -j4
- cp -Rf src/luaenginecore/release/LuaEngine.dll ${CI_PROJECT_DIR}/ - cp -Rf src/luaenginecore/release/LuaEngine.dll ${CI_PROJECT_DIR}/
- cp -Rf src/luaenginegui/release/LuaEngineGui.dll ${CI_PROJECT_DIR}/ - cp -Rf src/luaenginegui/release/LuaEngineGui.dll ${CI_PROJECT_DIR}/
@ -36,7 +36,7 @@ LuaEngine Debian:
- apt-get install checkinstall gcc g++ make qtbase5-dev -qq - apt-get install checkinstall gcc g++ make qtbase5-dev -qq
- mkdir -p ${CI_PROJECT_DIR}/build - mkdir -p ${CI_PROJECT_DIR}/build
- cd ${CI_PROJECT_DIR}/build - cd ${CI_PROJECT_DIR}/build
- /usr/lib/x86_64-linux-gnu/qt5/bin/qmake LUAENGINE_PREFIX=/usr LUAENGINE_LIBDIR=/usr/lib/x86_64-linux-gnu CONFIG+=WITH_LUAENGINECOM CONFIG+=WITH_LUAENGINERUN ${CI_PROJECT_DIR}/luaengine.pro - /usr/lib/x86_64-linux-gnu/qt5/bin/qmake LUAENGINE_PREFIX=/usr LUAENGINE_LIBDIR=/usr/lib/x86_64-linux-gnu CONFIG+=WITH_LUAENGINE_COMPILER CONFIG+=WITH_LUAENGINE_RUNTIME ${CI_PROJECT_DIR}/luaengine.pro
- make -j4 - make -j4
- echo "LuaEngine" > description-pak - echo "LuaEngine" > description-pak
- checkinstall --default --fstrans=no --install=no --nodoc --pkgname=luaengine "--pkglicense=Apache 2.0" --pkggroup=utility --pkgrelease=deb9u${CI_PIPELINE_IID} "--maintainer=Syping GitLab \<gitlab@syping.de\>" --requires=libqt5core5a,libqt5gui5,libqt5widgets5,qttranslations5-l10n --provides=libluaengine,libluaenginegui,libluaengineio,libluaengineos --conflicts=libluaengine,libluaenginegui,libluaengineio,libluaengineos --pakdir=${CI_PROJECT_DIR} - checkinstall --default --fstrans=no --install=no --nodoc --pkgname=luaengine "--pkglicense=Apache 2.0" --pkggroup=utility --pkgrelease=deb9u${CI_PIPELINE_IID} "--maintainer=Syping GitLab \<gitlab@syping.de\>" --requires=libqt5core5a,libqt5gui5,libqt5widgets5,qttranslations5-l10n --provides=libluaengine,libluaenginegui,libluaengineio,libluaengineos --conflicts=libluaengine,libluaenginegui,libluaengineio,libluaengineos --pakdir=${CI_PROJECT_DIR}
@ -53,7 +53,7 @@ LuaEngine PE Windows:
script: script:
- mkdir -p ${CI_PROJECT_DIR}/build - mkdir -p ${CI_PROJECT_DIR}/build
- cd ${CI_PROJECT_DIR}/build - cd ${CI_PROJECT_DIR}/build
- qmake-static CONFIG+=WITH_LUAENGINEAPP ${CI_PROJECT_DIR}/luaengine.pro - qmake-static CONFIG+=WITH_LUAENGINE_APPSTUB ${CI_PROJECT_DIR}/luaengine.pro
- make -j4 - make -j4
- cp -Rf src/luaengineapp/release/LuaEngineApp.exe ${CI_PROJECT_DIR}/windows.le - cp -Rf src/luaengineapp/release/LuaEngineApp.exe ${CI_PROJECT_DIR}/windows.le
- cd ${CI_PROJECT_DIR} - cd ${CI_PROJECT_DIR}
@ -67,6 +67,7 @@ LuaEngine Setup:
script: script:
- apt-get update -qq - apt-get update -qq
- apt-get install nsis -qq - apt-get install nsis -qq
- makensis -NOCD ${CI_PROJECT_DIR}/.ci/luaengine.nsi
artifacts: artifacts:
name: "luaengine-$CI_COMMIT_REF_NAME-${CI_COMMIT_SHA:0:8}" name: "luaengine-$CI_COMMIT_REF_NAME-${CI_COMMIT_SHA:0:8}"
paths: paths:

View file

@ -47,3 +47,11 @@ unix {
target.path = $$LUAENGINE_BINDIR target.path = $$LUAENGINE_BINDIR
INSTALLS += target INSTALLS += target
} }
win32 {
RC_LANG = 0x0
QMAKE_TARGET_COMPANY = "Syping"
QMAKE_TARGET_DESCRIPTION = "LuaEngine Runtime"
QMAKE_TARGET_COPYRIGHT = "Copyright (c) 2018-2019 Syping"
QMAKE_TARGET_PRODUCT = "LuaEngine"
}

View file

@ -23,6 +23,6 @@ SUBDIRS += luaenginecore \
luaengineio \ luaengineio \
luaengineos luaengineos
CONFIG(WITH_LUAENGINERUN): SUBDIRS += luaengine CONFIG(WITH_LUAENGINE_RUNTIME): SUBDIRS += luaengine
CONFIG(WITH_LUAENGINEAPP): SUBDIRS += luaengineapp CONFIG(WITH_LUAENGINE_APPSTUB): SUBDIRS += luaengineapp
CONFIG(WITH_LUAENGINECOM): SUBDIRS += luaenginec CONFIG(WITH_LUAENGINE_COMPILER): SUBDIRS += luaenginec