forked from RainbowMage/OverlayPlugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdistribute.ps1
71 lines (60 loc) · 2.82 KB
/
distribute.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Import-Module $PSScriptRoot\PS-Zip.psm1
# ビルド
./build.bat
# バージョン取得
$version = [System.Diagnostics.FileVersionInfo]::GetVersionInfo("BuildX86\OverlayPlugin.dll").FileVersion
# フォルダ名
$buildFolderX86 = ".\BuildX86"
$buildFolderX64 = ".\BuildX64"
$fullFolderX86 = ".\Distribute\OverlayPlugin-" + $version + "-x86-full"
$updateFolderX86 = ".\Distribute\OverlayPlugin-" + $version + "-x86-update"
$fullFolderX64 = ".\Distribute\OverlayPlugin-" + $version + "-x64-full"
$updateFolderX64 = ".\Distribute\OverlayPlugin-" + $version + "-x64-update"
# フォルダが既に存在するなら消去
if ( Test-Path $fullFolderX86 -PathType Container ) {
Remove-Item -Recurse -Force $fullFolderX86
}
if ( Test-Path $updateFolderX86 -PathType Container ) {
Remove-Item -Recurse -Force $updateFolderX86
}
if ( Test-Path $fullFolderX64 -PathType Container ) {
Remove-Item -Recurse -Force $fullFolderX64
}
if ( Test-Path $updateFolderX64 -PathType Container ) {
Remove-Item -Recurse -Force $updateFolderX64
}
# フォルダ作成
New-Item -ItemType directory -Path $fullFolderX86
New-Item -ItemType directory -Path $updateFolderX86
New-Item -ItemType directory -Path $fullFolderX64
New-Item -ItemType directory -Path $updateFolderX64
# X86版コピー
# full
xcopy /Y /R /S /EXCLUDE:full.exclude "$buildFolderX86\*" "$fullFolderX86"
# update
xcopy /Y /R "$buildFolderX86\HtmlRenderer.dll" "$updateFolderX86"
xcopy /Y /R "$buildFolderX86\OverlayPlugin.dll" "$updateFolderX86"
xcopy /Y /R "$buildFolderX86\OverlayPlugin.Core.dll" "$updateFolderX86"
xcopy /Y /R "$buildFolderX86\OverlayPlugin.Common.dll" "$updateFolderX86"
xcopy /Y /R "$buildFolderX86\README.md" "$updateFolderX86"
xcopy /Y /R "$buildFolderX86\LICENSE.txt" "$updateFolderX86"
xcopy /Y /R /S "$buildFolderX86\resources\*" "$updateFolderX86\resources\"
xcopy /Y /R /S "$buildFolderX86\ja-JP\*" "$updateFolderX86\ja-JP\"
# X64版コピー
# full
xcopy /Y /R /S /EXCLUDE:full.exclude "$buildFolderX64\*" "$fullFolderX64"
# update
xcopy /Y /R "$buildFolderX64\HtmlRenderer.dll" "$updateFolderX64"
xcopy /Y /R "$buildFolderX64\OverlayPlugin.dll" "$updateFolderX64"
xcopy /Y /R "$buildFolderX64\OverlayPlugin.Core.dll" "$updateFolderX64"
xcopy /Y /R "$buildFolderX64\OverlayPlugin.Common.dll" "$updateFolderX64"
xcopy /Y /R "$buildFolderX64\README.md" "$updateFolderX64"
xcopy /Y /R "$buildFolderX64\LICENSE.txt" "$updateFolderX64"
xcopy /Y /R /S "$buildFolderX64\resources\*" "$updateFolderX64\resources\"
xcopy /Y /R /S "$buildFolderX64\ja-JP\*" "$updateFolderX64\ja-JP\"
# アーカイブ
New-ZipCompress -source $fullFolderX86 -destination "$fullFolderX86.zip"
New-ZipCompress -source $updateFolderX86 -destination "$updateFolderX86.zip"
New-ZipCompress -source $fullFolderX64 -destination "$fullFolderX64.zip"
New-ZipCompress -source $updateFolderX64 -destination "$updateFolderX64.zip"
pause