-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathPackager.ps1
44 lines (34 loc) · 1.09 KB
/
Packager.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
$version = Get-Content VERSION;
# Move Resources to Release dir
if(Test-Path -Path "$PSScriptRoot/bin/Release/Resources" ) {
move $PSScriptRoot/bin/Release/Resources/* $PSScriptRoot/bin/Release/
rmdir -r $PSScriptRoot/bin/Release/Resources/
}
# Create temporary Output dir
mkdir $PSScriptRoot/bin/Output
# Pt1 Create output.zip
$required_files = @(
# WebMCam
"WebMCam.exe",
"license.md",
# NAudio
"NAudio.dll",
"NAudio-license.txt"
)
foreach ($file in $required_files) {
copy $PSScriptRoot/bin/Release/$file $PSScriptRoot/bin/Output/$file
}
Add-Type -A System.IO.Compression.FileSystem
[IO.Compression.ZipFile]::CreateFromDirectory("$PSScriptRoot/bin/Output", "$PSScriptRoot/bin/WebMCam-$version.zip")
# Pt2 Create output-ffmpeg.zip
$ffmpeg_files = @(
# FFmpeg
"ffmpeg.exe",
"ffmpeg-license.txt"
);
foreach ($file in $ffmpeg_files) {
copy $PSScriptRoot/bin/Release/$file $PSScriptRoot/bin/Output/$file
}
[IO.Compression.ZipFile]::CreateFromDirectory("$PSScriptRoot/bin/Output", "$PSScriptRoot/bin/WebMCam-$version-FFmpeg.zip")
# Cleanup
rmdir -r bin/Output