-
Notifications
You must be signed in to change notification settings - Fork 0
/
initialize.ps1
100 lines (89 loc) · 3.06 KB
/
initialize.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
[System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms")
Write-Output "====== Installing Software ======="
try
{
git | Out-Null
"Git is installed"
}
catch [System.Management.Automation.CommandNotFoundException]
{
winget install --id Git.Git -e --source winget
}
try
{
$netsdks = dotnet --list-sdks
if (-not ($netsdks -like "*sdk*")) {
winget install dotnet-sdk-8
}
else
{
".NET SDK is installed"
}
}
catch [System.Management.Automation.CommandNotFoundException]
{
winget install dotnet-sdk-8
}
Write-Output "====== Cleaning Projects ======="
dotnet clean
# CommonAPI
Remove-Item ".\libs\BRC-CommonAPI\bin" -Recurse -ErrorAction SilentlyContinue
Remove-Item ".\libs\BRC-CommonAPI\obj" -Recurse -ErrorAction SilentlyContinue
# Common
Remove-Item ".\MapStation.Common\bin" -Recurse -ErrorAction SilentlyContinue
Remove-Item ".\MapStation.Common\obj" -Recurse -ErrorAction SilentlyContinue
# Plugin
Remove-Item ".\MapStation.Plugin\bin" -Recurse -ErrorAction SilentlyContinue
Remove-Item ".\MapStation.Plugin\obj" -Recurse -ErrorAction SilentlyContinue
Write-Output "====== BepInEx Directory ======="
Write-Output "Example BepInEx Root Directory: C:\Users\(User)\AppData\Roaming\r2modmanPlus-local\BombRushCyberfunk\profiles\(Profile)\BepInEx"
$bepinexPathAlreadySet = $false
if ($env:BepInExDirectory)
{
$bepinexPathAlreadySet = $true
Write-Output "Your BepInEx Directory is already set to $env:BepInExDirectory. Click Cancel to leave it unchanged"
}
$foldername = New-Object System.Windows.Forms.FolderBrowserDialog
$foldername.Description = "Locate your BepInEx root Directory."
$foldername.rootfolder = "Desktop"
$foldername.SelectedPath = $env:APPDATA
$dialogResult = $foldername.ShowDialog()
if ($dialogResult -eq "Cancel" -and -not $bepinexPathAlreadySet)
{
Write-Output "Cancelling as you didn't set your BepInEx directory."
exit
}
if ($dialogResult -eq "OK")
{
$path = $foldername.SelectedPath
[Environment]::SetEnvironmentVariable("BepInExDirectory", $path, "User")
$env:BepInExDirectory = $path
}
Write-Output "====== Bomb Rush Cyberfunk Directory ======="
Write-Output "Example Bomb Rush Cyberfunk installation Directory: E:\Steam\steamapps\common\BombRushCyberfunk"
$brcPathAlreadySet = $false
if ($env:BRCPath)
{
$brcPathAlreadySet = $true
Write-Output "Your Bomb Rush Cyberfunk installation directory is already set to $env:BRCPath. Click Cancel to leave it unchanged"
}
$foldername = New-Object System.Windows.Forms.FolderBrowserDialog
$foldername.Description = "Locate your Bomb Rush Cyberfunk installation Directory."
$foldername.rootfolder = "Desktop"
$dialogResult = $foldername.ShowDialog()
if ($dialogResult -eq "Cancel" -and -not $brcPathAlreadySet)
{
Write-Output "Cancelling as you didn't set your Bomb Rush Cyberfunk directory."
exit
}
if ($dialogResult -eq "OK")
{
$path = $foldername.SelectedPath
[Environment]::SetEnvironmentVariable("BRCPath", $path, "User")
$env:BRCPath = $path
}
cd scripts
./rebuild.ps1
cd scripts
./copy-assets.ps1
read-host Press ENTER to continue