Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ ui_*.h
moc_predefs.h
src/res/qrc_resources.cpp
windows/ASIOSDK2
windows/VC_redist.x64.exe
windows/vc_redist.x86.exe
windows/NSIS
debug/
release/
build/
Expand Down
54 changes: 21 additions & 33 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,37 +44,25 @@ matrix:
# on:
# repo: corrados/jamulus
# tags: true
# - os: windows
# before_install:
# - dir C:/Program\ Files\ \(x86\)/Windows\ Kits/10/bin/10.0.17134.0/x64
# - cmd.exe /C 'cd && "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat"
# x86 && cd && cd "C:/Users/travis/build/corrados/jamulus/windows" && dir'
# - curl -vLO http://download.qt.io/official_releases/online_installers/qt-unified-windows-x86-online.exe
# - curl -vLO http://www.steinberg.net/sdk_downloads/ASIOSDK2.3.2.zip
# - unzip ASIOSDK2.3.2.zip
# - mkdir ASIOSDK2
# - cp -rvu ASIOSDK2.3.2/* ASIOSDK2
# - pwd
# - mv qt-unified-windows-x86-online.exe windows
# - mv ASIOSDK2 windows
# - cd windows
# - "./qt-unified-windows-x86-online.exe --verbose --script qt-installer-windows.qs"
# - ls -la C:/Qt/5.12.3/msvc2017/bin/qtenv2.bat
# script:
# - cmd.exe /C 'cd && "C:\Qt\5.12.3\msvc2017\bin\qtenv2.bat" && cd && "C:\Program
# Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat"
# x86 && cd "C:\Users\travis\build\corrados\jamulus" && cd && qmake Jamulus.pro
# && nmake'
# #deploy function is only available in travis-ci.com (not free) but not in travis-ci.org (free)
# #deploy:
# # provider: releases
# # api_key:
# # secure: aQ93/8XU3HEGTif0/rSiF+gcm4uRhyWFdr3Va50BprwQOrZkNg8zIMwIKKODwjLDqxaH4msgNYutcr/VLdLjo4YP43It0UIfv3LGa2VFAkFhuQurMXZlVyx8RhIGLjIaWVWN1GCbNdAQwWNNo2mAkEdRaBrj/26geZotGcYZiztGwTAdy0t/vyYjO1sLZdBKcf7dJ06Pm2ktZO/rDyE4UtCTQiRfqLCKsQ/SILbewOMG/auaSUdU0utsbvXxr+dCzqBPwdSSptWqhIORXORL5oPn6242URzIJkmw5XPwhSabhdbzUjCIN9E24z1vp+cffAohuGXyXXZy9/bGeKa0mXfAaXV+TnJkpMd+i3fN5dY+vhFrlLOpRojRK6NqvaMID6tcNNtZMmFSgaZGyCUJQn4/0X+LdPwvK3/dXY+qElJW62QiJmQAt9OBGcq8EFqQDmEtRivRlbpbERsd/IJoOxP7nI2T00g04uV543ZmhU4fmGw6MVPAlIGRsBECjB0AMTp+3xW3OaUp7jy3WZpZXRrXNI41nZogrxhevPME1BRNk3V+MWQo8R3C+bIaCa5Um/3DZxnMxZgXjI9yzzR7Z8f4RWaQCKjXx41/pk7jxm1TcEyBfRVsb313l/fRLg+fjCmaEnnxu43333XGIv4eIyAGDR8ydF2VpmyP2ejzh8I=
# # file:
# # - Jamulus.exe
# # skip_cleanup: true
# # on:
# # repo: corrados/jamulus
# # tags: true

- os: windows
env:
# QT_ACCOUNT_USERNAME and QT_ACCOUNT_PASSWORD variables for Qt registration at install time
- secure: WlWyUMU53vGPwZ340bZZy3PVJJfuFZ8gegyLHGYXo1Hp++BCtHJ5FH2kVYxW0pUNqKobkrlGdNMLrhfDD5qATj6TqbRTQr/XKqK5Qhe8sf7Ag/Z+AUjguED7QL0th2Ll6eBlSc9ayrQfvCjvzmyFXGB85iXvuJlbqUCya6xRyiflq37KimLGjxFOhUkCGsIgraUxUxGm/dLj07x2gH1XeozzSOhX/4uDwlP+y642zWyWf/pOrUTSuid97TJseD9tAmLqFpVo43BqDuCe1/7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m5SyH4H1+8o1RytgbEZY=
before_install:
- curl -vL -o "${TEMP}/qt-installer.exe" http://download.qt.io/official_releases/online_installers/qt-unified-windows-x86-online.exe
- "${TEMP}/qt-installer.exe --verbose --script ./windows/qt-installer-windows.qs"
script:
- powershell -ExecutionPolicy ByPass -Command "./windows/deploy_windows.ps1"
#deploy function is only available in travis-ci.com (not free) but not in travis-ci.org (free)
#deploy:
# provider: releases
# api_key:
# secure: aQ93/8XU3HEGTif0/rSiF+gcm4uRhyWFdr3Va50BprwQOrZkNg8zIMwIKKODwjLDqxaH4msgNYutcr/VLdLjo4YP43It0UIfv3LGa2VFAkFhuQurMXZlVyx8RhIGLjIaWVWN1GCbNdAQwWNNo2mAkEdRaBrj/26geZotGcYZiztGwTAdy0t/vyYjO1sLZdBKcf7dJ06Pm2ktZO/rDyE4UtCTQiRfqLCKsQ/SILbewOMG/auaSUdU0utsbvXxr+dCzqBPwdSSptWqhIORXORL5oPn6242URzIJkmw5XPwhSabhdbzUjCIN9E24z1vp+cffAohuGXyXXZy9/bGeKa0mXfAaXV+TnJkpMd+i3fN5dY+vhFrlLOpRojRK6NqvaMID6tcNNtZMmFSgaZGyCUJQn4/0X+LdPwvK3/dXY+qElJW62QiJmQAt9OBGcq8EFqQDmEtRivRlbpbERsd/IJoOxP7nI2T00g04uV543ZmhU4fmGw6MVPAlIGRsBECjB0AMTp+3xW3OaUp7jy3WZpZXRrXNI41nZogrxhevPME1BRNk3V+MWQo8R3C+bIaCa5Um/3DZxnMxZgXjI9yzzR7Z8f4RWaQCKjXx41/pk7jxm1TcEyBfRVsb313l/fRLg+fjCmaEnnxu43333XGIv4eIyAGDR8ydF2VpmyP2ejzh8I=
# file:
# - Jamulus.exe
# skip_cleanup: true
# on:
# repo: corrados/jamulus
# tags: true

Binary file removed windows/FindProcDLL.dll
Binary file not shown.
72 changes: 0 additions & 72 deletions windows/deploy_windows.bat

This file was deleted.

209 changes: 209 additions & 0 deletions windows/deploy_windows.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
param(
# Replace default path with system Qt installation folder if necessary
[string] $QtInstallPath = "C:\Qt\5.12.3"
)

# Global constants
$RootPath = "$PWD"
$BuildPath = "$RootPath\build"
$DeployPath = "$RootPath\deploy"
$WindowsPath ="$RootPath\windows"
$AppName = "Jamulus"

# Stop at all errors
$ErrorActionPreference = "Stop"

# Execute native command with errorlevel handling
Function Execute-Native-Command {
Param(
[string] $Command,
[string[]] $Arguments
)

& "$Command" @Arguments

if ($LastExitCode -Ne 0)
{
Throw "Native command $Command returned with exit code $LastExitCode"
}
}

# Cleanup existing build folders
Function Clean-Build-Environment
{
if (Test-Path -Path $BuildPath) { Remove-Item -Path $BuildPath -Recurse -Force }
if (Test-Path -Path $DeployPath) { Remove-Item -Path $DeployPath -Recurse -Force }

New-Item -Path $BuildPath -ItemType Directory
New-Item -Path $DeployPath -ItemType Directory
}

# Download and uncompress dependency in ZIP format
Function Install-Dependency
{
param(
[Parameter(Mandatory=$true)]
[string] $Uri,
[Parameter(Mandatory=$true)]
[string] $Name,
[Parameter(Mandatory=$true)]
[string] $Destination
)

if (Test-Path -Path "$WindowsPath\$Destination") { return }

$TempFileName = [System.IO.Path]::GetTempFileName() + ".zip"
Invoke-WebRequest -Uri $Uri -OutFile $TempFileName
Expand-Archive -Path $TempFileName -DestinationPath $Env:TEMP -Force
Move-Item -Path "$Env:TEMP\$Name" -Destination "$WindowsPath\$Destination" -Force
Remove-Item -Path $TempFileName -Force
}

# Install VSSetup (Visual Studio detection), ASIO SDK and NSIS Installer
Function Install-Dependencies
{
Install-PackageProvider -Name "Nuget" -Scope CurrentUser -Force
Install-Module -Name "VSSetup" -Scope CurrentUser -Force
Install-Dependency -Uri "http://www.steinberg.net/sdk_downloads/ASIOSDK2.3.2.zip" `
-Name "ASIOSDK2.3.2" -Destination "ASIOSDK2"
Install-Dependency -Uri "https://netix.dl.sourceforge.net/project/nsis/NSIS%203/3.05/nsis-3.05.zip" `
-Name "nsis-3.05" -Destination "NSIS"
}

# Setup environment variables and build tool paths
Function Setup-Build-Environment
{
param(
[Parameter(Mandatory=$true)]
[string] $QtInstallPath,
[Parameter(Mandatory=$true)]
[string] $BuildArch
)

# Look for Visual Studio/Build Tools 2017 or later (version 15.0 or above)
$VsInstallPath = Get-VSSetupInstance | `
Select-VSSetupInstance -Product "*" -Version "15.0" -Latest | `
Select-Object -ExpandProperty "InstallationPath"

if ($VsInstallPath -Eq "") { $VsInstallPath = "<N/A>" }

if ($BuildArch -Eq "x86_64")
{
$VcVarsBin = "$VsInstallPath\VC\Auxiliary\build\vcvars64.bat"
$QtMsvcSpecPath = "$QtInstallPath\msvc2017_64\bin"
}
else
{
$VcVarsBin = "$VsInstallPath\VC\Auxiliary\build\vcvars32.bat"
$QtMsvcSpecPath = "$QtInstallPath\msvc2017\bin"
}

# Setup Qt executables paths for later calls
Set-Item Env:QtQmakePath "$QtMsvcSpecPath\qmake.exe"
Set-Item Env:QtWinDeployPath "$QtMsvcSpecPath\windeployqt.exe"

""
"**********************************************************************"
"Using Visual Studio/Build Tools environment settings located at"
$VcVarsBin
"**********************************************************************"
""
"**********************************************************************"
"Using Qt binaries for Visual C++ located at"
$QtMsvcSpecPath
"**********************************************************************"
""

if (-Not (Test-Path -Path $VcVarsBin))
{
Throw "Microsoft Visual Studio ($BuildArch variant) is not installed. " + `
"Please install Visual Studio 2017 or above it before running this script."
}

if (-Not (Test-Path -Path $Env:QtQmakePath))
{
Throw "The Qt binaries for Microsoft Visual C++ 2017 (msvc2017) could not be located. " + `
"Please install Qt with support for MSVC 2017 before running this script," + `
"then call this script with the Qt install location, for example C:\Qt\5.12.3"
}

# Import environment variables set by vcvarsXX.bat into current scope
$EnvDump = [System.IO.Path]::GetTempFileName()
Execute-Native-Command -Command "cmd" `
-Arguments ("/c", "`"$VcVarsBin`" && set > `"$EnvDump`"")

foreach ($_ in Get-Content -Path $EnvDump)
{
if ($_ -Match "^([^=]+)=(.*)$")
{
Set-Item "Env:$($Matches[1])" $Matches[2]
}
}

Remove-Item -Path $EnvDump -Force
}

# Build Jamulus x86_64 and x86
Function Build-App
{
param(
[Parameter(Mandatory=$true)]
[string] $BuildConfig,
[Parameter(Mandatory=$true)]
[string] $BuildArch
)

Execute-Native-Command -Command "$Env:QtQmakePath" `
-Arguments ("$RootPath\$AppName.pro", "CONFIG+=$BuildConfig $BuildArch", `
"-o", "$BuildPath\Makefile")

Set-Location -Path $BuildPath
Execute-Native-Command -Command "nmake" -Arguments ("$BuildConfig")
Execute-Native-Command -Command "$Env:QtWinDeployPath" `
-Arguments ("--$BuildConfig", "--compiler-runtime", "--dir=$DeployPath\$BuildArch",
"$BuildPath\$BuildConfig\$AppName.exe")

Move-Item -Path "$BuildPath\$BuildConfig\$AppName.exe" -Destination "$DeployPath\$BuildArch" -Force
Execute-Native-Command -Command "nmake" -Arguments ("clean")
Set-Location -Path $RootPath
}

# Build and deploy Jamulus 64bit and 32bit variants
function Build-App-Variants
{
param(
[Parameter(Mandatory=$true)]
[string] $QtInstallPath
)

foreach ($_ in ("x86_64", "x86"))
{
$OriginalEnv = Get-ChildItem Env:
Setup-Build-Environment -QtInstallPath $QtInstallPath -BuildArch $_
Build-App -BuildConfig "release" -BuildArch $_
$OriginalEnv | % { Set-Item "Env:$($_.Name)" $_.Value }
}
}

# Build Windows installer
Function Build-Installer
{
foreach ($_ in Get-Content -Path "$RootPath\$AppName.pro")
{
if ($_ -Match "^VERSION *= *(.*)$")
{
$AppVersion = $Matches[1]
break
}
}

Execute-Native-Command -Command "$WindowsPath\NSIS\makensis" `
-Arguments ("/v4", "/DAPP_NAME=$AppName", "/DAPP_VERSION=$AppVersion", `
"/DROOT_PATH=$RootPath", "/DWINDOWS_PATH=$WindowsPath", "/DDEPLOY_PATH=$DeployPath", `
"$WindowsPath\installer.nsi")
}

Clean-Build-Environment
Install-Dependencies
Build-App-Variants -QtInstallPath $QtInstallPath
Build-Installer
Binary file added windows/installer-banner.bmp
Binary file not shown.
Binary file added windows/installer-banner.xcf
Binary file not shown.
Binary file added windows/installer-welcome.bmp
Binary file not shown.
Loading