copy-runtime-files.ps1 3.92 KB
Newer Older
1
2
[cmdletbinding()]
param (
3
    [string]$mode,
4
    [string]$qtver,
5
6
7
8
    [string]$daemonDir,
    [string]$lrcDir
);

9
write-host "Copying runtime files..." -ForegroundColor Green
10

11
12
# default values
$qtver = If ($qtver) {$qtver} Else {"5.9.4"}
13
$mode  = If ($mode)  {$mode} Else {"Release"}
14
15

$QtDir = "C:\Qt\$qtver\msvc2017_64"
16
17
$ClientDir = split-path -parent $MyInvocation.MyCommand.Definition

18
$OutDir = $ClientDir + "\x64\" + $mode
19
If(!(test-path $OutDir)) { New-Item -ItemType directory -Path $OutDir -Force }
20

21
22
if (!$daemonDir) { $daemonDir = $ClientDir + '\..\daemon' }
if (!$lrcDir) { $lrcDir = $ClientDir + '\..\lrc' }
23

24
25
26
27
28
write-host "********************************************************************************" -ForegroundColor Magenta
write-host "using daemonDir:    " $daemonDir -ForegroundColor Magenta
write-host "using lrcDir:       " $lrcDir -ForegroundColor Magenta
write-host "using QtDir:        " $QtDir -ForegroundColor Magenta
write-host "********************************************************************************" -ForegroundColor Magenta
29

30
# dependency bin files and misc
31
$FilesToCopy = @(
32
33
34
35
36
37
38
    "$daemonDir\contrib\build\ffmpeg\Build\win32\x64\bin\avcodec-58.dll",
    "$daemonDir\contrib\build\ffmpeg\Build\win32\x64\bin\avutil-56.dll",
    "$daemonDir\contrib\build\ffmpeg\Build\win32\x64\bin\avformat-58.dll",
    "$daemonDir\contrib\build\ffmpeg\Build\win32\x64\bin\avdevice-58.dll",
    "$daemonDir\contrib\build\ffmpeg\Build\win32\x64\bin\swresample-3.dll",
    "$daemonDir\contrib\build\ffmpeg\Build\win32\x64\bin\swscale-5.dll",
    "$daemonDir\contrib\build\ffmpeg\Build\win32\x64\bin\avfilter-7.dll",
39
40
    "$daemonDir\contrib\build\openssl\out32dll\libeay32.dll",
    "$daemonDir\contrib\build\openssl\out32dll\ssleay32.dll",
41
    "$ClientDir\qt.conf",
42
    "$ClientDir\images\jami.ico",
43
    "$ClientDir\License.rtf"
44
45
    )
foreach ($i in $FilesToCopy) {
46
    write-host "copying: " $i " => " $OutDir -ForegroundColor Cyan
47
    Copy-Item -Path $i -Recurse -Destination $OutDir -Force -Container
48
49
50
51
52
}

############
# qt
############
53
$windeployqt = "$QtDir\bin\windeployqt.exe --qmldir $ClientDir\src --release $OutDir\Jami.exe"
54
iex $windeployqt
55
56
57

# ringtones
$CopyDir = $OutDir + "\ringtones"
58
If(!(test-path $CopyDir)) { New-Item -ItemType directory -Path $CopyDir -Force }
59
60
$RingtonePath = "$ClientDir\..\daemon\ringtones"
write-host "copying ringtones..."
Andreas Traczyk's avatar
Andreas Traczyk committed
61
Get-ChildItem -Path $RingtonePath -Include *.ul, *.ogg, *.wav, *.opus -Recurse | ForEach-Object {
62
    write-host "copying ringtone: " $_.FullName " => " $CopyDir -ForegroundColor Cyan
63
64
65
66
67
68
69
    Copy-Item -Path $_.FullName -Destination $CopyDir -Force Recurse
}

# qt translations
$lrelease = "$QtDir\bin\lrelease.exe"

# lrc translations
70
$lrcTSPath = "$lrcDir\translations"
71
72
73
74
Get-ChildItem -Path $lrcTSPath -Include *.ts -Recurse | ForEach-Object {
    & $lrelease $_.FullName
}
$CopyDir = $OutDir + "\share\libringclient\translations"
75
76
If(!(test-path $CopyDir)) { New-Item -ItemType directory -Path $CopyDir -Force }
write-host "copying lrc translations..."
77
Get-ChildItem -Path $lrcTSPath -Include *.qm -Recurse | ForEach-Object {
78
    write-host "copying translation file: " $_.FullName " => " $CopyDir -ForegroundColor Cyan
79
80
81
82
83
84
85
86
87
    Copy-Item -Path $_.FullName -Destination $CopyDir -Force Recurse
}

# client translations
$clientTSPath = "$ClientDir\translations"
Get-ChildItem -Path $clientTSPath -Include *.ts -Recurse | ForEach-Object {
    & $lrelease $_.FullName
}
$CopyDir = $OutDir + "\share\ring\translations"
88
89
If(!(test-path $CopyDir)) { New-Item -ItemType directory -Path $CopyDir -Force }
write-host "copying client translations..."
90
Get-ChildItem -Path $clientTSPath -Include *.qm -Recurse | ForEach-Object {
91
    write-host "copying translation file: " $_.FullName " => " $CopyDir -ForegroundColor Cyan
92
93
94
    Copy-Item -Path $_.FullName -Destination $CopyDir -Force Recurse
}

95
write-host "copy completed" -NoNewline -ForegroundColor Green