File size: 3,934 Bytes
0e0fe0a | 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 | # appsONLINE Setup - PowerShell Script
# Checks prerequisites and installs dependencies
Write-Host "`n╔════════════════════════════════════════╗" -ForegroundColor Cyan
Write-Host "║ appsONLINE Setup & Verification ║" -ForegroundColor Cyan
Write-Host "╚════════════════════════════════════════╝`n" -ForegroundColor Cyan
# Check Node.js
Write-Host "📦 Checking Node.js..." -ForegroundColor Yellow
$nodeCheck = Get-Command node -ErrorAction SilentlyContinue
if ($null -ne $nodeCheck) {
$nodeVersion = & node --version
Write-Host " ✅ Node.js $nodeVersion found`n" -ForegroundColor Green
} else {
Write-Host " ❌ Node.js not found!" -ForegroundColor Red
Write-Host " Download from: https://nodejs.org/`n" -ForegroundColor Yellow
}
# Check npm
Write-Host "📦 Checking npm..." -ForegroundColor Yellow
$npmCheck = Get-Command npm -ErrorAction SilentlyContinue
if ($null -ne $npmCheck) {
$npmVersion = & npm --version
Write-Host " ✅ npm $npmVersion found`n" -ForegroundColor Green
} else {
Write-Host " ❌ npm not found!`n" -ForegroundColor Red
}
# Check .NET SDK
Write-Host "📦 Checking .NET SDK..." -ForegroundColor Yellow
$dotnetCheck = Get-Command dotnet -ErrorAction SilentlyContinue
if ($null -ne $dotnetCheck) {
$dotnetVersion = & dotnet --version
Write-Host " ✅ .NET SDK $dotnetVersion found`n" -ForegroundColor Green
} else {
Write-Host " ❌ .NET SDK 8.0+ not found!" -ForegroundColor Red
Write-Host " Download from: https://dotnet.microsoft.com/download`n" -ForegroundColor Yellow
}
# Check for .csproj files
Write-Host "📁 Scanning for MVC applications..." -ForegroundColor Yellow
$csprojFiles = Get-ChildItem -Path $PSScriptRoot -Filter "*.csproj" -Recurse -Depth 4
if ($csprojFiles.Count -gt 0) {
Write-Host " ✅ Found $($csprojFiles.Count) MVC application(s):" -ForegroundColor Green
$csprojFiles | ForEach-Object {
$relativePath = Resolve-Path -Path $_.FullName -Relative
Write-Host " - $relativePath"
}
Write-Host ""
} else {
Write-Host " ⚠️ No MVC applications found (yet)" -ForegroundColor Yellow
Write-Host " You can add them later in subfolders`n" -ForegroundColor Gray
}
# Check dependencies
Write-Host "📚 Checking dependencies..." -ForegroundColor Yellow
$nodeModulesPath = Join-Path -Path $PSScriptRoot -ChildPath "node_modules"
if (Test-Path -Path $nodeModulesPath) {
Write-Host " ✅ Dependencies already installed`n" -ForegroundColor Green
} else {
Write-Host " Installing dependencies..." -ForegroundColor Yellow
npm install
if ($LASTEXITCODE -eq 0) {
Write-Host " ✅ Dependencies installed successfully`n" -ForegroundColor Green
} else {
Write-Host " ❌ Failed to install dependencies!" -ForegroundColor Red
Write-Host ""
exit 1
}
}
# Summary
Write-Host "╔════════════════════════════════════════╗" -ForegroundColor Green
Write-Host "║ ✅ Setup complete! ║" -ForegroundColor Green
Write-Host "╚════════════════════════════════════════╝`n" -ForegroundColor Green
Write-Host "🚀 To start the launcher, run:" -ForegroundColor Cyan
Write-Host " npm start" -ForegroundColor White
Write-Host ""
Write-Host "Or execute this script:" -ForegroundColor Cyan
Write-Host " .\start.ps1" -ForegroundColor White
Write-Host ""
Write-Host "Or double-click the batch file:" -ForegroundColor Cyan
Write-Host " start.bat" -ForegroundColor White
Write-Host ""
|