-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathsetup_devenv.ps1
More file actions
90 lines (73 loc) · 2.73 KB
/
setup_devenv.ps1
File metadata and controls
90 lines (73 loc) · 2.73 KB
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
Add-Type -AssemblyName System.Windows.Forms
function Find-DSPPlugins {
$commonPaths = @(
"$env:USERPROFILE\AppData\Roaming\r2modmanPlus-local\DysonSphereProgram\profiles\Default\BepInEx\plugins",
"$env:ProgramFiles\Steam\steamapps\common\Dyson Sphere Program\BepInEx\plugins",
"${env:ProgramFiles(x86)}\Steam\steamapps\common\Dyson Sphere Program\BepInEx\plugins",
"$env:USERPROFILE\AppData\Roaming\com.kesomannen.gale\dyson-sphere-program\profiles\Default\BepInEx\plugins"
)
foreach ($path in $commonPaths) {
if (Test-Path $path) {
return $path
}
}
return $null
}
function Select-PluginsFolder {
$dialog = New-Object System.Windows.Forms.FolderBrowserDialog
$dialog.Description = "Select your DSP BepInEx plugins folder"
$dialog.ShowNewFolderButton = $false
# Try to start in a sensible location
$initialPath = Find-DSPPlugins
if ($initialPath) {
$dialog.SelectedPath = $initialPath
}
if ($dialog.ShowDialog() -eq 'OK') {
return $dialog.SelectedPath
}
return $null
}
function Test-PluginsDirectory {
param([string]$Path)
if (-not (Test-Path $Path)) {
return $false
}
# Check if this looks like a plugins directory
$parentDir = Split-Path $Path -Parent
$bepinexDir = Split-Path $parentDir -Leaf
return $bepinexDir -eq "BepInEx"
}
# Main script
Write-Host "GalacticScale 3 Development Environment Setup" -ForegroundColor Cyan
Write-Host "----------------------------------------" -ForegroundColor Cyan
$pluginsPath = Find-DSPPlugins
if (-not $pluginsPath) {
Write-Host "Could not automatically find DSP plugins directory."
Write-Host "Please select it manually..."
$pluginsPath = Select-PluginsFolder
}
if (-not $pluginsPath) {
Write-Host "No plugins directory selected. Setup cancelled." -ForegroundColor Red
exit 1
}
if (-not (Test-PluginsDirectory $pluginsPath)) {
Write-Host "Warning: Selected directory doesn't appear to be a BepInEx plugins folder." -ForegroundColor Yellow
$confirm = Read-Host "Continue anyway? (y/N)"
if ($confirm -ne "y") {
Write-Host "Setup cancelled." -ForegroundColor Red
exit 1
}
}
# Create DevEnv.targets with the correct format
$devEnvContent = @"
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PluginDir>$pluginsPath</PluginDir>
</PropertyGroup>
</Project>
"@
$devEnvContent | Out-File "DevEnv.targets" -Encoding UTF8
Write-Host "`nSetup complete!" -ForegroundColor Green
Write-Host "Created DevEnv.targets with plugins path: $pluginsPath"
Write-Host "You can now build the project in Visual Studio."