Win32: fix generation of NSIS installer when compiling with Qt 5.5

*.qm files are now in a translations subfolder

Change-Id: I233152cd2662aec7072769e27f7a278c6890d8ec
Reviewed-on: https://code.wireshark.org/review/9646
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
This commit is contained in:
Pascal Quantin 2015-07-15 21:32:44 +02:00
parent 41ed7127a5
commit 0b11d5dc75
2 changed files with 25 additions and 1 deletions

View File

@ -170,6 +170,7 @@ Delete "$INSTDIR\share\themes\Default\gtk-2.0\*.*"
Delete "$INSTDIR\snmp\*.*"
Delete "$INSTDIR\snmp\mibs\*.*"
Delete "$INSTDIR\tpncp\*.*"
Delete "$INSTDIR\translations\*.*"
Delete "$INSTDIR\ui\*.*"
Delete "$INSTDIR\wimaxasncp\*.*"
Delete "$INSTDIR\ws.css"
@ -243,6 +244,7 @@ RMDir "$INSTDIR\snmp"
RMDir "$INSTDIR\radius"
RMDir "$INSTDIR\dtds"
RMDir "$INSTDIR\tpncp"
RMDir "$INSTDIR\translations"
RMDir "$INSTDIR\ui"
RMDir "$INSTDIR\wimaxasncp"
RMDir "$INSTDIR"

View File

@ -13,6 +13,22 @@ SetCompressorDictSize 64 ; MB
!include "common.nsh"
!include 'LogicLib.nsh'
; See http://nsis.sourceforge.net/Check_if_a_file_exists_at_compile_time for documentation
!macro !defineifexist _VAR_NAME _FILE_NAME
!tempfile _TEMPFILE
!ifdef NSIS_WIN32_MAKENSIS
; Windows - cmd.exe
!system 'if exist "${_FILE_NAME}" echo !define ${_VAR_NAME} > "${_TEMPFILE}"'
!else
; Posix - sh
!system 'if [ -e "${_FILE_NAME}" ]; then echo "!define ${_VAR_NAME}" > "${_TEMPFILE}"; fi'
!endif
!include '${_TEMPFILE}'
!delfile '${_TEMPFILE}'
!undef _TEMPFILE
!macroend
!define !defineifexist "!insertmacro !defineifexist"
; ============================================================================
; Header configuration
; ============================================================================
@ -820,7 +836,13 @@ Section "${PROGRAM_NAME}" SecWiresharkQt
SetOutPath $INSTDIR
File "${QT_DIR}\${PROGRAM_NAME_PATH_QT}"
!include qt-dll-manifest.nsh
File "${QT_DIR}\*.qm"
${!defineifexist} TRANSLATIONS_FOLDER "${QT_DIR}\translations"
!ifdef TRANSLATIONS_FOLDER
; Starting from Qt 5.5, *.qm files are put in a translations subfolder
File /r "${QT_DIR}\translations"
!else
File "${QT_DIR}\*.qm"
!endif
Push $0
;SectionGetFlags ${SecWiresharkQt} $0