-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.ps1
More file actions
137 lines (114 loc) · 5.9 KB
/
install.ps1
File metadata and controls
137 lines (114 loc) · 5.9 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# Install plugin to TeamSpeak (with Python support)
# Usage: .\install.ps1 [-Configuration Release|Debug] [-Architecture x64|x86]
param(
[ValidateSet('Release', 'Debug')]
[string]$Configuration = 'Release',
[ValidateSet('x64', 'x86')]
[string]$Architecture = 'x64'
)
$ErrorActionPreference = "Stop"
$PresetName = "$Architecture-$($Configuration.ToLower())"
$PluginsPath = "$env:APPDATA\TS3Client\plugins"
$DllPath = "build\$PresetName\bin\Debug\tspy_plugin.dll"
Write-Host "======================================" -ForegroundColor Cyan
Write-Host "🐍 TsPy Plugin Installer v1.3.0" -ForegroundColor Cyan
Write-Host "Configuration: $Configuration" -ForegroundColor Cyan
Write-Host "Architecture: $Architecture" -ForegroundColor Cyan
Write-Host "======================================" -ForegroundColor Cyan
# Check if DLL exists
if (!(Test-Path $DllPath)) {
Write-Host "`nError: Plugin DLL not found!" -ForegroundColor Red
Write-Host "Expected location: $DllPath" -ForegroundColor Yellow
Write-Host "`nPlease build the plugin first:" -ForegroundColor Yellow
Write-Host " .\build.ps1 -Configuration $Configuration -Architecture $Architecture" -ForegroundColor Gray
exit 1
}
# Create plugins folder if it doesn't exist
Write-Host "`nCreating plugins directory..." -ForegroundColor Yellow
New-Item -ItemType Directory -Force -Path $PluginsPath | Out-Null
Write-Host "Plugins path: $PluginsPath" -ForegroundColor Gray
# Copy DLL
Write-Host "`nCopying plugin DLL..." -ForegroundColor Yellow
try {
Copy-Item $DllPath -Destination $PluginsPath -Force
Write-Host "Plugin DLL copied successfully!" -ForegroundColor Green
} catch {
Write-Host "Error copying DLL: $_" -ForegroundColor Red
Write-Host "`nMake sure TeamSpeak is closed before installing." -ForegroundColor Yellow
exit 1
}
# Copy PDB for debugging (if debug build)
if ($Configuration -eq "Debug") {
$PdbPath = "build\$PresetName\bin\Debug\tspy_plugin.pdb"
if (Test-Path $PdbPath) {
Write-Host "Copying debug symbols..." -ForegroundColor Yellow
Copy-Item $PdbPath -Destination $PluginsPath -Force
Write-Host "Debug symbols copied." -ForegroundColor Green
}
}
# Copy icons (optional)
$IconsSource = "resources\icons"
$IconsDest = "$env:APPDATA\TS3Client\plugins\tspy_plugin"
if (Test-Path $IconsSource) {
Write-Host "`nCopying plugin resources..." -ForegroundColor Yellow
New-Item -ItemType Directory -Force -Path $IconsDest | Out-Null
Copy-Item "$IconsSource\*" -Destination $IconsDest -Force
Write-Host "Resources copied successfully!" -ForegroundColor Green
}
# Copy Python DLL (v1.3.0 requirement) - DISABLED
# NOTE: Python DLL should NOT be in plugins folder as TeamSpeak tries to load it as a plugin
# When Python support is re-enabled, we'll use a different approach (subdirectory or system PATH)
Write-Host "`n🐍 Python support temporarily disabled" -ForegroundColor Yellow
Write-Host " (Python DLL not copied to avoid TS3 loading conflicts)" -ForegroundColor Gray
<#
# Original Python DLL copy code (disabled):
Write-Host "`n🐍 Checking for Python DLL..." -ForegroundColor Yellow
try {
$pythonPath = python -c "import sys; print(sys.executable)" 2>$null
if ($pythonPath) {
$pythonDir = Split-Path $pythonPath
$pythonDll = Get-ChildItem "$pythonDir\python3*.dll" -Filter "python3??.dll" -ErrorAction SilentlyContinue | Select-Object -First 1
if ($pythonDll) {
Write-Host "Found Python DLL: $($pythonDll.Name)" -ForegroundColor Green
# DON'T copy to plugins folder - TeamSpeak tries to load it as a plugin!
# Copy-Item $pythonDll.FullName -Destination $PluginsPath -Force
Write-Host "Python DLL NOT copied (prevents TS3 loading errors)" -ForegroundColor Green
} else {
Write-Host "⚠️ Warning: Python DLL not found!" -ForegroundColor Yellow
}
} else {
Write-Host "⚠️ Warning: Python not found in PATH!" -ForegroundColor Yellow
}
} catch {
Write-Host "⚠️ Warning: Could not check for Python" -ForegroundColor Yellow
}
#>
# Copy Python scripts (optional)
$ScriptsSource = "scripts"
$ScriptsDest = "$env:APPDATA\TS3Client\plugins\scripts"
if (Test-Path $ScriptsSource) {
Write-Host "`n🐍 Copying Python scripts..." -ForegroundColor Yellow
New-Item -ItemType Directory -Force -Path $ScriptsDest | Out-Null
New-Item -ItemType Directory -Force -Path "$ScriptsDest\examples" | Out-Null
Copy-Item "$ScriptsSource\tspy_init.py" -Destination $ScriptsDest -Force -ErrorAction SilentlyContinue
Copy-Item "$ScriptsSource\examples\*.py" -Destination "$ScriptsDest\examples\" -Force -ErrorAction SilentlyContinue
Copy-Item "$ScriptsSource\README.md" -Destination $ScriptsDest -Force -ErrorAction SilentlyContinue
Write-Host "Python scripts copied successfully!" -ForegroundColor Green
}
Write-Host "`n========================================" -ForegroundColor Cyan
Write-Host "✅ Installation Complete!" -ForegroundColor Green
Write-Host "========================================" -ForegroundColor Cyan
Write-Host "`nPlugin Location:" -ForegroundColor Cyan
Write-Host " $PluginsPath\tspy_plugin.dll" -ForegroundColor Gray
Write-Host "`n⚙️ Plugin Status:" -ForegroundColor Cyan
Write-Host " ✅ Core features: Working" -ForegroundColor Green
Write-Host " 🐍 Python support: ENABLED (NEW!)" -ForegroundColor Green
Write-Host " Note: Python support is experimental" -ForegroundColor Yellow
Write-Host "`nNext Steps:" -ForegroundColor Yellow
Write-Host " 1. Start TeamSpeak 3" -ForegroundColor White
Write-Host " 2. Go to: Tools → Options → Addons" -ForegroundColor White
Write-Host " 3. Enable 'TsPy Plugin'" -ForegroundColor White
Write-Host " 4. Click OK" -ForegroundColor White
Write-Host " 5. Try: /tspy help" -ForegroundColor White
Write-Host "`nFor testing guide, see:" -ForegroundColor Cyan
Write-Host " TESTING.md" -ForegroundColor Gray