-
Notifications
You must be signed in to change notification settings - Fork 11
/
release.ps1
41 lines (34 loc) · 1.21 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
41
if ($PSScriptRoot -match '.+?\\bin\\?') {
$dir = $PSScriptRoot + "\"
}
else {
$dir = $PSScriptRoot + "\bin\"
}
$patreonFile = $dir + "\patreon.txt"
function CreateZip ($subfolder)
{
$name = $subfolder.Name
$ver = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($subfolder.GetFiles("*.exe").Fullname).FileVersion.ToString()
$launcherDir = $subfolder.Fullname + "\BepInEx\LauncherEN"
New-Item -ItemType Directory -Force -Path ($launcherDir)
foreach($langDir in Get-ChildItem -Path $subfolder -Directory -Force -Exclude BepInEx)
{
#$langDir.MoveTo($launcherDir + "\" + $langDir.Name)
Move-Item -Path $langDir -Destination ($launcherDir + "\" + $langDir.Name) -Force
}
Copy-Item -Path $patreonFile -Destination $launcherDir -Force -ErrorAction Ignore
Compress-Archive -Path ($subfolder.FullName + "\*") -Force -CompressionLevel "Optimal" -DestinationPath ($subfolder.Parent.FullName + "\IllusionLaunchers_" + $name + "_" + $ver + ".zip")
}
$subfolders = Get-ChildItem -Path $dir -Directory -Force -Exclude out
foreach ($subfolder in $subfolders)
{
try
{
CreateZip ($subfolder)
}
catch
{
# retry
CreateZip ($subfolder)
}
}