-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcheck-dependencies.ps1
More file actions
117 lines (103 loc) · 4.51 KB
/
check-dependencies.ps1
File metadata and controls
117 lines (103 loc) · 4.51 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
# ComputerInfo Dependency Checker
# This script checks if all required dependencies are properly installed
Write-Host "================================================" -ForegroundColor Cyan
Write-Host " ComputerInfo Dependency Checker" -ForegroundColor Cyan
Write-Host "================================================" -ForegroundColor Cyan
Write-Host ""
$allGood = $true
$projectRoot = $PSScriptRoot
# Check for required DLL files
Write-Host "Checking for required DLL files..." -ForegroundColor Yellow
Write-Host ""
# Define expected library locations
$gchartLibPath = Join-Path $projectRoot "lib\GChartLib\GChartLib.dll"
$metroSuitePath = Join-Path $projectRoot "lib\MetroSuite\MetroSuite 2.0.dll"
# Alternative paths (in case user placed them in different location)
$altGchartLibPath = Join-Path $projectRoot "..\..\..\Form Skins\GChartLib\GChartLib.dll"
$altMetroSuitePath = Join-Path $projectRoot "..\..\..\Form Skins\MetroSuite\MetroSuite 2.0.dll"
# Check GChartLib
Write-Host "1. GChartLib.dll" -NoNewline
if (Test-Path $gchartLibPath) {
Write-Host " [✓ FOUND]" -ForegroundColor Green
Write-Host " Location: $gchartLibPath" -ForegroundColor Gray
} elseif (Test-Path $altGchartLibPath) {
Write-Host " [✓ FOUND]" -ForegroundColor Green
Write-Host " Location: $altGchartLibPath" -ForegroundColor Gray
Write-Host " Note: Using original path. Consider moving to lib folder." -ForegroundColor Yellow
} else {
Write-Host " [✗ MISSING]" -ForegroundColor Red
Write-Host " Expected at: $gchartLibPath" -ForegroundColor Gray
$allGood = $false
}
Write-Host ""
# Check MetroSuite 2.0
Write-Host "2. MetroSuite 2.0.dll" -NoNewline
if (Test-Path $metroSuitePath) {
Write-Host " [✓ FOUND]" -ForegroundColor Green
Write-Host " Location: $metroSuitePath" -ForegroundColor Gray
} elseif (Test-Path $altMetroSuitePath) {
Write-Host " [✓ FOUND]" -ForegroundColor Green
Write-Host " Location: $altMetroSuitePath" -ForegroundColor Gray
Write-Host " Note: Using original path. Consider moving to lib folder." -ForegroundColor Yellow
} else {
Write-Host " [✗ MISSING]" -ForegroundColor Red
Write-Host " Expected at: $metroSuitePath" -ForegroundColor Gray
$allGood = $false
}
Write-Host ""
# Check NuGet packages
Write-Host "Checking NuGet packages..." -ForegroundColor Yellow
Write-Host ""
$packagesPath = Join-Path $projectRoot "packages"
$requiredPackages = @(
"MetroModernUI.1.4.0.0",
"MaterialSkin.0.2.1",
"System.Management.4.7.0"
)
foreach ($package in $requiredPackages) {
$packagePath = Join-Path $packagesPath $package
Write-Host "3. $package" -NoNewline
if (Test-Path $packagePath) {
Write-Host " [✓ FOUND]" -ForegroundColor Green
} else {
Write-Host " [✗ MISSING]" -ForegroundColor Red
Write-Host " Run 'nuget restore' or 'Restore NuGet Packages' in Visual Studio" -ForegroundColor Gray
$allGood = $false
}
}
Write-Host ""
# Check .NET Framework
Write-Host "Checking .NET Framework..." -ForegroundColor Yellow
Write-Host ""
$dotNetPath = "HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full"
if (Test-Path $dotNetPath) {
$release = (Get-ItemProperty $dotNetPath).Release
if ($release -ge 528040) {
Write-Host "4. .NET Framework 4.8 [✓ INSTALLED]" -ForegroundColor Green
} else {
Write-Host "4. .NET Framework 4.8 [✗ NOT FOUND]" -ForegroundColor Red
Write-Host " Please install .NET Framework 4.8 or later" -ForegroundColor Gray
$allGood = $false
}
} else {
Write-Host "4. .NET Framework [✗ UNABLE TO DETECT]" -ForegroundColor Yellow
Write-Host " Please ensure .NET Framework 4.8 is installed" -ForegroundColor Gray
}
Write-Host ""
# Summary
Write-Host "================================================" -ForegroundColor Cyan
if ($allGood) {
Write-Host " ✓ All dependencies are satisfied!" -ForegroundColor Green
Write-Host " You can now build and run the project." -ForegroundColor Green
} else {
Write-Host " ✗ Some dependencies are missing!" -ForegroundColor Red
Write-Host ""
Write-Host " Please refer to:" -ForegroundColor Yellow
Write-Host " - DEPENDENCY_GUIDE.md (English)" -ForegroundColor Yellow
Write-Host " - DEPENDENCY_GUIDE_KR.md (한국어)" -ForegroundColor Yellow
Write-Host " - README.md for installation instructions" -ForegroundColor Yellow
}
Write-Host "================================================" -ForegroundColor Cyan
Write-Host ""
# Pause to allow user to read the output
Read-Host "Press Enter to exit"