forked from mosirnik/KK_MainGameVR
-
Notifications
You must be signed in to change notification settings - Fork 12
/
release.ps1
40 lines (24 loc) · 1.65 KB
/
release.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
if ($PSScriptRoot -match '.+?\\bin\\?') {
$dir = $PSScriptRoot + "\"
}
else {
$dir = $PSScriptRoot + "\bin\"
}
$solutionDir = $dir + "..\"
$copy = $dir + "\copy\BepInEx\plugins\KKS_VR"
$ver = "v" + (Get-ChildItem -Path ($dir) -Filter ("KKS_MainGameVR.dll") -Recurse -Force)[0].VersionInfo.FileVersion.ToString() -replace "([\d+\.]+?\d+)[\.0]*$", '${1}'
Remove-Item -Force -Path ($dir + "\copy") -Recurse -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Force -Path $copy
Copy-Item -Path ($dir + "\KKS_*.dll") -Destination $copy -Recurse -Force
Copy-Item -Path ($solutionDir + "\VRGIN_OpenXR\bin\*.dll") -Destination $copy -Force
Copy-Item -Path ($solutionDir + "\README.md") -Destination $copy -Recurse -Force
Copy-Item -Path ($solutionDir + "\LICENSE") -Destination $copy -Recurse -Force
New-Item -ItemType Directory -Force -Path ($copy + "\Images")
Copy-Item -Path ($solutionDir + "\Images\*") -Destination ($copy + "\Images") -Recurse -Force
Copy-Item -Path ($solutionDir + "\VRGIN_OpenXR\Libs\*.dll") -Destination $copy -Force
New-Item -ItemType Directory -Force -Path ($dir + "\copy\CharaStudio_Data")
Copy-Item -Path ($solutionDir + "\VRGIN_OpenXR\Libs\_Data\*") -Destination ($dir + "\copy\CharaStudio_Data") -Recurse -Force
New-Item -ItemType Directory -Force -Path ($dir + "\copy\KoikatsuSunshine_Data")
Copy-Item -Path ($solutionDir + "\VRGIN_OpenXR\Libs\_Data\*") -Destination ($dir + "\copy\KoikatsuSunshine_Data") -Recurse -Force
Compress-Archive -Path ($dir + "\copy\*") -Force -CompressionLevel "Optimal" -DestinationPath ($dir +"KKS_VR_" + $ver + ".zip")
Remove-Item -Force -Path ($dir + "\copy") -Recurse -ErrorAction SilentlyContinue