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

write-host "copying runtime files..."
8
9
10
11
12
13
14

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

$OutDir = $ClientDir + "\x64\Release"
New-Item -ItemType directory -Path $OutDir -Force

15
if (-not ($daemonDir)) {
Philippe Gorley's avatar
Philippe Gorley committed
16
    $daemonDir = $ClientDir + '\..\daemon'
17
18
}

19
if (-not ($lrcDir)) {
Philippe Gorley's avatar
Philippe Gorley committed
20
    $lrcDir = $ClientDir + '\..\lrc'
21
22
23
24
}

# dependency bin files
$FilesToCopy = @(
25
26
27
28
29
30
31
32
33
    "$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",
    "$daemonDir\contrib\build\restbed\dependency\openssl\out32dll\libeay32.dll",
    "$daemonDir\contrib\build\restbed\dependency\openssl\out32dll\ssleay32.dll",
34
35
    "$ClientDir\winsparkle\x64\Release\WinSparkle.dll",
    "$ClientDir\ring.nsi",
36
    "$ClientDir\images\jami.ico"
37
    "$ClientDir\License.rtf"
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
    )
foreach ($i in $FilesToCopy) {
    write-host "copying: " $i " => " $OutDir
    Copy-Item -Path $i -Destination $OutDir -Force
}

############
# qt
############

# qt bin files
$FilesToCopy = @(
    "$QtDir\bin\Qt5Core.dll",
    "$QtDir\bin\Qt5Gui.dll",
    "$QtDir\bin\Qt5Network.dll",
    "$QtDir\bin\Qt5Positioning.dll",
    "$QtDir\bin\Qt5PrintSupport.dll",
    "$QtDir\bin\Qt5Qml.dll",
    "$QtDir\bin\Qt5Quick.dll",
    "$QtDir\bin\Qt5QuickWidgets.dll",
    "$QtDir\bin\Qt5Sql.dll",
    "$QtDir\bin\Qt5Svg.dll",
    "$QtDir\bin\Qt5WebChannel.dll",
    "$QtDir\bin\Qt5WebEngine.dll",
    "$QtDir\bin\Qt5WebEngineCore.dll",
    "$QtDir\bin\Qt5WebEngineWidgets.dll",
    "$QtDir\bin\Qt5Widgets.dll",
    "$QtDir\bin\Qt5WinExtras.dll",
    "$QtDir\bin\Qt5Xml.dll",
67
68
    "$QtDir\bin\Qt5Multimedia.dll",
    "$QtDir\bin\Qt5MultimediaWidgets.dll",
Andreas Traczyk's avatar
Andreas Traczyk committed
69
    "$QtDir\bin\Qt5OpenGL.dll",
70
71
    "$QtDir\bin\libEGL.dll",
    "$QtDir\bin\libGLESv2.dll",
72
    "$QtDir\bin\d3dcompiler_47.dll",
73
74
    "$QtDir\bin\QtWebEngineProcess.exe",
    "$QtDir\resources\qtwebengine_resources.pak",
75
76
    "$QtDir\resources\qtwebengine_resources_100p.pak",
    "$QtDir\resources\qtwebengine_resources_200p.pak",
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
    "$QtDir\resources\icudtl.dat"
    )
foreach ($i in $FilesToCopy) {
    write-host "copying: " $i " => " $OutDir
    Copy-Item -Path $i -Destination $OutDir -Force
}

# qt imageformats
$FilesToCopy = @(
    "$QtDir\plugins\imageformats\qgif.dll",
    "$QtDir\plugins\imageformats\qico.dll",
    "$QtDir\plugins\imageformats\qjpeg.dll",
    "$QtDir\plugins\imageformats\qsvg.dll"
    )
$CopyDir = $OutDir + "\imageformats"
New-Item -ItemType directory -Path $CopyDir -Force
foreach ($i in $FilesToCopy) {
    write-host "copying: " $i " => " $CopyDir
    Copy-Item -Path $i -Destination $CopyDir -Force
}

# qt platform dll for windows
$CopyDir = $OutDir + "\platforms"
New-Item -ItemType directory -Path $CopyDir -Force
$file = "$QtDir\plugins\platforms\qwindows.dll"
write-host "copying: " $file " => " $CopyDir
Copy-Item -Path $file -Destination $CopyDir -Force

# qt sql driver
$CopyDir = $OutDir + "\sqldrivers"
New-Item -ItemType directory -Path $CopyDir -Force
$file = "$QtDir\plugins\sqldrivers\qsqlite.dll"
write-host "copying: " $file " => " $CopyDir
Copy-Item -Path $file -Destination $CopyDir -Force

# ringtones
$CopyDir = $OutDir + "\ringtones"
New-Item -ItemType directory -Path $CopyDir -Force
$RingtonePath = "$ClientDir\..\daemon\ringtones"
write-host "copying ringtones..."
Get-ChildItem -Path $RingtonePath -Include *.ul, *.wav, *.ogg -Recurse | ForEach-Object {
    write-host "copying ringtone: " $_.FullName " => " $CopyDir
    Copy-Item -Path $_.FullName -Destination $CopyDir -Force Recurse
}

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

# lrc translations
126
$lrcTSPath = "$lrcDir\translations"
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
Get-ChildItem -Path $lrcTSPath -Include *.ts -Recurse | ForEach-Object {
    & $lrelease $_.FullName
}
$CopyDir = $OutDir + "\share\libringclient\translations"
New-Item -ItemType directory -Path $CopyDir -Force
write-host "copying ringtones..."
Get-ChildItem -Path $lrcTSPath -Include *.qm -Recurse | ForEach-Object {
    write-host "copying translation file: " $_.FullName " => " $CopyDir
    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"
New-Item -ItemType directory -Path $CopyDir -Force
write-host "copying ringtones..."
Get-ChildItem -Path $lrcTSPath -Include *.qm -Recurse | ForEach-Object {
    write-host "copying translation file: " $_.FullName " => " $CopyDir
    Copy-Item -Path $_.FullName -Destination $CopyDir -Force Recurse
}

write-host "copy completed" -NoNewline