support hybrid x86 and x64 installer for Windows

This commit is contained in:
Volker Fischer 2020-04-02 22:08:45 +02:00
parent 6b26cb02b4
commit 324287beda
3 changed files with 97 additions and 29 deletions

View File

@ -12,6 +12,13 @@
- changed the maximum number of clients supported by the server from 20 to 50
TODO x64 deploy version for Windows -> change deploy script
TODO client: larger sound card buffers are managed by conversion buffer, not in processintern for loop (note iSndCrdFrameSizeFactor!)
TODO check why for some servers we do not get client list in server list
TODO check server list registration for correct behavior

View File

@ -1,36 +1,72 @@
@echo off
rem To set up a new Qt and Visual Studio version
rem - set environment path variable to the correct Qt bin directory (e.g. 32 bit version)
rem - set environment path variable to the correct Qt bin directories:
rem - QTDIR32: points to the Qt 32 bit binaries, e.g., C:\Qt\5.10.1\msvc2015
rem - QTDIR64: points to the Qt 64 bin binaries, e.g., C:\Qt\5.10.1\msvc2015_64
rem - if using Visual Studio Express version, download the redistributable (it is not automatically there)
rem - change the Qt distribute dll names in the installer.nsi file (some contain version numbers)
rem settings and check ---------------------------------------------------------
set NSIS_PATH=%PROGRAMFILES(x86)%\NSIS
set VS_REDIST32_EXE=vc_redist.x86.exe
set VS_REDIST64_EXE=VC_redist.x64.exe
if "%VSINSTALLDIR%" == "" goto vsenvproblem
if "%QTDIR32%" == "" goto qtdirproblem
if "%QTDIR64%" == "" goto qtdirproblem
cd ..
rem ########################## 32 bit build ####################################
set QTDIR=%QTDIR32%
set Path=%QTDIR32%\bin;%Path%
rem create visual studio project file ------------------------------------------
qmake -tp vc -spec win32-msvc
rem TODO qmake seems to use the incorrect VS version to create the project file.
rem As a quick hack I simply replace the toolset version which seems to work.
powershell -Command "(gc jamulus.vcxproj) -replace '<PlatformToolset>v141</PlatformToolset>', '<PlatformToolset>v140</PlatformToolset>' | Out-File -encoding ASCII jamulus.vcxproj"
powershell -Command "(gc jamulus.vcxproj) -replace 'x64', 'Win32' | Out-File -encoding ASCII jamulus.vcxproj"
powershell -Command "(gc jamulus.vcxproj) -replace ';WIN64', '' | Out-File -encoding ASCII jamulus.vcxproj"
powershell -Command "(gc jamulus.vcxproj) -replace '-DWIN64 ', '' | Out-File -encoding ASCII jamulus.vcxproj"
rem clean and compile solution -------------------------------------------------
devenv Jamulus.vcxproj /Clean "Release|x86"
devenv Jamulus.vcxproj /Build "Release|x86"
mkdir release\x86
copy release\Jamulus.exe release\x86\
rem ########################## 64 bit build ####################################
set QTDIR=%QTDIR64%
set Path=%QTDIR64%\bin;%Path%
rem create visual studio project file ------------------------------------------
cd ..
qmake -tp vc -spec win32-msvc
qmake -tp vc
rem TODO qmake seems to use the incorrect VS version to create the project file.
rem As a quick hack I simply replace the toolset version which seems to work.
powershell -Command "(gc jamulus.vcxproj) -replace '<PlatformToolset>v141</PlatformToolset>', '<PlatformToolset>v140</PlatformToolset>' | Out-File -encoding ASCII jamulus.vcxproj"
rem clean and compile solution -------------------------------------------------
devenv Jamulus.vcxproj /Clean "Release|x86"
devenv Jamulus.vcxproj /Build "Release|x86"
devenv Jamulus.vcxproj /Clean "Release|x64"
devenv Jamulus.vcxproj /Build "Release|x64"
rem create installer -----------------------------------------------------------
rem ########################## create installer ################################
cd windows
"%NSIS_PATH%\makensis.exe" installer.nsi
move Jamulusinstaller.exe ../deploy/Jamulus-version-installer.exe
goto endofskript
:vsenvproblem
echo Use the Visual Studio Command Prompt to call this skript
echo Use the Visual Studio x86 x64 Cross Tools Command Prompt to call this skript
goto endofskript
:qtdirproblem
echo The QTDIR32 and QTDIR64 is not set, please set these environment variables correclty before calling this script
goto endofskript
:endofskript

View File

@ -1,4 +1,6 @@
; Jamulus NSIS installer script
!include LogicLib.nsh
!include x64.nsh
!define APP_NAME "Jamulus"
!define APP_EXE "Jamulus.exe"
@ -42,27 +44,44 @@ Section
SetOutPath $INSTDIR
; main application
${If} ${RunningX64}
File "${BINARY_PATH}${APP_EXE}"
${Else}
File "${BINARY_PATH}x86\${APP_EXE}"
${EndIf}
; QT dlls
File "$%QTDIR%\bin\Qt5Core.dll"
File "$%QTDIR%\bin\Qt5Gui.dll"
File "$%QTDIR%\bin\Qt5Widgets.dll"
File "$%QTDIR%\bin\Qt5Network.dll"
File "$%QTDIR%\bin\Qt5Xml.dll"
File "$%QTDIR%\bin\D3DCompiler_47.dll"
; File "$%QTDIR%\bin\icudt54.dll"
; File "$%QTDIR%\bin\icuin54.dll"
; File "$%QTDIR%\bin\icuuc54.dll"
File "$%QTDIR%\bin\libEGL.dll"
File "$%QTDIR%\bin\libGLESv2.dll"
${If} ${RunningX64}
File "$%QTDIR64%\bin\Qt5Core.dll"
File "$%QTDIR64%\bin\Qt5Gui.dll"
File "$%QTDIR64%\bin\Qt5Widgets.dll"
File "$%QTDIR64%\bin\Qt5Network.dll"
File "$%QTDIR64%\bin\Qt5Xml.dll"
File "$%QTDIR64%\bin\D3DCompiler_47.dll"
File "$%QTDIR64%\bin\libEGL.dll"
File "$%QTDIR64%\bin\libGLESv2.dll"
${Else}
File "$%QTDIR32%\bin\Qt5Core.dll"
File "$%QTDIR32%\bin\Qt5Gui.dll"
File "$%QTDIR32%\bin\Qt5Widgets.dll"
File "$%QTDIR32%\bin\Qt5Network.dll"
File "$%QTDIR32%\bin\Qt5Xml.dll"
File "$%QTDIR32%\bin\D3DCompiler_47.dll"
File "$%QTDIR32%\bin\libEGL.dll"
File "$%QTDIR32%\bin\libGLESv2.dll"
${EndIf}
; other files
File "..\COPYING"
; temporarily create Microsoft Visual Studio redistributable,
File "${VS_REDIST_EXE}"
ExecWait '"$INSTDIR\${VS_REDIST_EXE}" /q /norestart'
; temporarily create Microsoft Visual Studio redistributable
${If} ${RunningX64}
File "$%VS_REDIST64_EXE%"
ExecWait '"$INSTDIR\$%VS_REDIST64_EXE%" /q /norestart'
${Else}
File "$%VS_REDIST32_EXE%"
ExecWait '"$INSTDIR\$%VS_REDIST32_EXE%" /q /norestart'
${EndIf}
; uninstaller
WriteUninstaller $INSTDIR\${UNINSTALL_EXE}
@ -76,12 +95,21 @@ Section
CreateShortCut "$SMPROGRAMS\${APP_NAME}\${UNINSTALL_EXE}.lnk" "$INSTDIR\${UNINSTALL_EXE}"
; cleanup: remove temporary Microsoft Visual Studio redistributable executable
Delete $INSTDIR\${VS_REDIST_EXE}
${If} ${RunningX64}
Delete $INSTDIR\$%VS_REDIST64_EXE%
${Else}
Delete $INSTDIR\$%VS_REDIST32_EXE%
${EndIf}
; additional platform dlls
SetOutPath $INSTDIR\platforms
File "$%QTDIR%\plugins\platforms\qwindows.dll"
File "$%QTDIR%\plugins\platforms\qminimal.dll"
${If} ${RunningX64}
File "$%QTDIR64%\plugins\platforms\qwindows.dll"
File "$%QTDIR64%\plugins\platforms\qminimal.dll"
${Else}
File "$%QTDIR32%\plugins\platforms\qwindows.dll"
File "$%QTDIR32%\plugins\platforms\qminimal.dll"
${EndIf}
SectionEnd
@ -107,9 +135,6 @@ Delete $INSTDIR\Qt5Widgets.dll
Delete $INSTDIR\Qt5Network.dll
Delete $INSTDIR\Qt5Xml.dll
Delete $INSTDIR\D3DCompiler_47.dll
; Delete $INSTDIR\icudt54.dll
; Delete $INSTDIR\icuin54.dll
; Delete $INSTDIR\icuuc54.dll
Delete $INSTDIR\libEGL.dll
Delete $INSTDIR\libGLESv2.dll
Delete $INSTDIR\COPYING