diff --git a/EXTENSION-DEV-FIX.md b/EXTENSION-DEV-FIX.md new file mode 100644 index 00000000..8fac3ba6 --- /dev/null +++ b/EXTENSION-DEV-FIX.md @@ -0,0 +1,109 @@ +# SASyLF VS Code Extension - Proper Fix for Logging Issue + +## Issue Summary + +The SASyLF VS Code extension crashes on Windows 11 due to a file access error in the logging utility: + +``` +Error: ENOENT: no such file or directory, open 'c:\Users\username\.vscode\extensions\sasylf.sasylf-2.0.0\logs\2025-09-09T03:09:37.667Z.log' + at createLogFile (c:\Users\username\.vscode\extensions\sasylf.sasylf-2.0.0\server\out\utils.js:153:12) + at logErrorToFile (c:\Users\username\.vscode\extensions\sasylf.sasylf-2.0.0\server\out\utils.js:160:25) +``` + +## Root Cause + +The language server's logging utility in `utils.ts` (compiled to `utils.js`) does not properly handle: +1. Directory creation before file access +2. Permission errors on Windows systems +3. Fallback mechanisms when file system access is restricted + +## Source Code Location + +The extension source code is available in [boyland/sasylf PR #127](https://github.com/boyland/sasylf/pull/127) in the `lsp-sasylf/server/src/` directory. + +## Recommended Fix + +Update the logging functions in `utils.ts` with proper error handling: + +```typescript +import * as fs from 'fs'; +import * as path from 'path'; + +export function createLogFile(logPath: string): boolean { + try { + // Ensure the directory exists + const logDir = path.dirname(logPath); + if (!fs.existsSync(logDir)) { + fs.mkdirSync(logDir, { recursive: true, mode: 0o755 }); + } + + // Test write access by creating an empty file + fs.writeFileSync(logPath, '', { flag: 'w' }); + return true; + } catch (error) { + // Log to console as fallback + console.warn(`Cannot create log file at ${logPath}:`, error.message); + return false; + } +} + +export function logErrorToFile(message: string, logPath?: string): void { + if (!logPath) { + console.error(message); + return; + } + + try { + // Try to create/access the log file + if (createLogFile(logPath)) { + const timestamp = new Date().toISOString(); + fs.appendFileSync(logPath, `${timestamp}: ${message}\n`); + } else { + // Fallback to console logging + console.error(`[LOG FALLBACK] ${message}`); + } + } catch (error) { + // Ultimate fallback to console + console.error(`[LOG ERROR] ${message}`); + console.error(`[LOG ERROR] Failed to write to ${logPath}:`, error.message); + } +} +``` + +## Key Improvements + +1. **Directory Creation**: Uses `fs.mkdirSync()` with `recursive: true` to ensure parent directories exist +2. **Error Handling**: Wraps all file operations in try-catch blocks +3. **Fallback Logging**: Falls back to console logging when file system access fails +4. **Permission Handling**: Uses appropriate file modes and flags for cross-platform compatibility +5. **Graceful Degradation**: Extension continues to work even if logging fails + +## Testing + +This fix should be tested on: +- Windows 11 with standard user permissions +- Windows 11 with restricted user permissions +- Windows Defender real-time protection enabled +- Corporate environments with strict file system policies + +## Alternative: Disable File Logging + +If the above fix still causes issues, consider disabling file logging entirely on Windows: + +```typescript +const isWindows = process.platform === 'win32'; +const enableFileLogging = !isWindows; // Disable on Windows to avoid permission issues + +export function logErrorToFile(message: string, logPath?: string): void { + if (!enableFileLogging || !logPath) { + console.error(message); + return; + } + + // ... rest of logging logic +} +``` + +## User Workarounds + +Until the extension is updated, users can apply the workarounds provided in `VSCODE-EXTENSION-FIX.md` to resolve permission issues manually. \ No newline at end of file diff --git a/README.md b/README.md index b0de3207..008103ae 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,23 @@ The [Wiki](https://github.com/boyland/sasylf/wiki) has pages for [installing](ht Summary: To use VSCode, type SASyLF in the Extensions:Marketplace search box and install the [extension](https://marketplace.visualstudio.com/items?itemName=sasylf.SASyLF). To use the Eclipse IDE or the command line, get the JAR file from the release page and either put in the `dropins/` folder of the Eclipse distribution or use it with `java -jar`. +**Note for Windows 11 users:** If the VS Code extension crashes with a logging error, please see [VSCODE-EXTENSION-FIX.md](VSCODE-EXTENSION-FIX.md) for user solutions, or run the provided fix script: `fix-sasylf-extension.ps1` (PowerShell) or `fix-sasylf-extension.bat` (Command Prompt). **Extension developers:** See [EXTENSION-DEV-FIX.md](EXTENSION-DEV-FIX.md) for the proper source code fix. + ## Documentation See the [Wiki](https://github.com/boyland/sasylf/wiki) for documentation. +## Troubleshooting + +### VS Code Extension Issues on Windows 11 + +If you're experiencing crashes with the VS Code extension on Windows 11, especially errors related to logging or file access, please refer to: + +- **Users**: [VSCODE-EXTENSION-FIX.md](VSCODE-EXTENSION-FIX.md) for workarounds and automated fix scripts +- **Extension Developers**: [EXTENSION-DEV-FIX.md](EXTENSION-DEV-FIX.md) for the proper source code fix + +The issue is in the extension's logging utility ([source code in PR #127](https://github.com/boyland/sasylf/pull/127)) which lacks proper directory creation and error handling on Windows systems. + ## SASyLF Examples Exercises to learn SASyLF are in the exercises/ directory diff --git a/VSCODE-EXTENSION-FIX.md b/VSCODE-EXTENSION-FIX.md new file mode 100644 index 00000000..7b08fbcf --- /dev/null +++ b/VSCODE-EXTENSION-FIX.md @@ -0,0 +1,295 @@ +# SASyLF VS Code Extension Windows 11 Fix + +## Issue Description + +The SASyLF VS Code extension (sasylf.sasylf-2.0.0) crashes on Windows 11 with the following error: + +``` +Error: ENOENT: no such file or directory, open 'c:\Users\username\.vscode\extensions\sasylf.sasylf-2.0.0\logs\2025-09-09T03:09:37.667Z.log' +``` + +This occurs even when the `logs` directory exists. The issue is that the extension cannot create or write to the specific log file within the directory. + +## Root Cause Analysis + +**The VS Code extension source code is available in [boyland/sasylf PR #127](https://github.com/boyland/sasylf/pull/127).** The issue is in the language server's `utils.js` file (compiled from TypeScript) where the `createLogFile` function attempts to create log files without properly checking directory existence or handling permission errors. + +The error occurs at: +- `createLogFile (c:\Users\username\.vscode\extensions\sasylf.sasylf-2.0.0\server\out\utils.js:153:12)` +- `logErrorToFile (c:\Users\username\.vscode\extensions\sasylf.sasylf-2.0.0\server\out\utils.js:160:25)` + +Common causes include: + +- **File permissions**: Directory exists but lacks write permissions for individual files +- **Windows security restrictions**: Windows Defender or security software blocking file creation +- **Electron/Node.js file access issues**: VS Code's Electron runtime having restricted file system access +- **Path length or character encoding issues**: Windows file system limitations with certain characters or long paths + +## Proper Fix for Extension Developers + +**For developers with access to the extension source code ([PR #127](https://github.com/boyland/sasylf/pull/127)):** + +The root issue is in the `utils.ts` file (compiled to `utils.js`) where logging functions don't properly handle directory creation. The fix should include: + +```typescript +import * as fs from 'fs'; +import * as path from 'path'; + +function createLogFile(logPath: string): void { + try { + // Ensure the directory exists + const logDir = path.dirname(logPath); + if (!fs.existsSync(logDir)) { + fs.mkdirSync(logDir, { recursive: true }); + } + + // Test write access + fs.writeFileSync(logPath, ''); + } catch (error) { + // Fallback to console logging if file system is restricted + console.error('Failed to create log file:', error); + // Disable file logging for this session + return; + } +} + +function logErrorToFile(error: any, logPath: string): void { + try { + createLogFile(logPath); + fs.appendFileSync(logPath, `${new Date().toISOString()}: ${error}\n`); + } catch (fsError) { + // Fallback to console if file logging fails + console.error('Logging error:', error); + console.error('File system error:', fsError); + } +} +``` + +This approach: +1. Creates directories recursively with proper error handling +2. Tests write access before attempting to log +3. Falls back to console logging if file system access fails +4. Handles Windows-specific permission issues gracefully + +## Workarounds for Users + +Since the extension cannot be immediately updated, users can apply these workarounds: + +### User Solution 1: File Permissions and Security Fix + +1. **Navigate to your VS Code extensions directory:** + ```cmd + cd %USERPROFILE%\.vscode\extensions\sasylf.sasylf-2.0.0 + ``` + +2. **Verify the logs directory exists:** + ```cmd + dir logs + ``` + +3. **Set comprehensive permissions on the logs directory:** + ```cmd + icacls logs /grant %USERNAME%:F /T + takeown /f logs /r /d y + icacls logs /reset /T + icacls logs /grant %USERNAME%:F /T + ``` + +4. **Test file creation permissions:** + ```cmd + echo test > logs\test.log + del logs\test.log + ``` + +5. **Add VS Code extensions directory to Windows Defender exclusions:** + - Open Windows Security → Virus & threat protection → Manage settings + - Add exclusion for folder: `%USERPROFILE%\.vscode\extensions` + +6. **Restart VS Code as Administrator** (temporarily to test): + - Right-click VS Code → "Run as administrator" + +### User Solution 2: PowerShell Script (Automated Fix) + +Create a file called `fix-sasylf-extension.ps1` with the following content: + +```powershell +# SASyLF VS Code Extension Fix for Windows 11 +# This script fixes file permissions and security issues preventing log file creation + +$extensionPath = "$env:USERPROFILE\.vscode\extensions" +$sasylf_extensions = Get-ChildItem -Path $extensionPath -Directory -Name "sasylf.sasylf-*" + +if ($sasylf_extensions.Count -eq 0) { + Write-Host "SASyLF extension not found. Please install the extension first." -ForegroundColor Red + exit 1 +} + +foreach ($extension in $sasylf_extensions) { + $fullPath = Join-Path $extensionPath $extension + $logsPath = Join-Path $fullPath "logs" + + Write-Host "Processing extension: $extension" -ForegroundColor Yellow + + # Ensure logs directory exists + if (!(Test-Path $logsPath)) { + New-Item -ItemType Directory -Path $logsPath -Force + Write-Host "Created logs directory: $logsPath" -ForegroundColor Green + } else { + Write-Host "Logs directory exists: $logsPath" -ForegroundColor Blue + } + + # Take ownership and reset permissions + try { + takeown /f "$logsPath" /r /d y 2>$null + icacls "$logsPath" /reset /T 2>$null + icacls "$logsPath" /grant "${env:USERNAME}:F" /T 2>$null + Write-Host "Fixed permissions on logs directory" -ForegroundColor Green + + # Test file creation + $testFile = Join-Path $logsPath "test.log" + "test" | Out-File $testFile + Remove-Item $testFile + Write-Host "File creation test successful" -ForegroundColor Green + + } catch { + Write-Host "Warning: Permission fix failed. Try running as Administrator." -ForegroundColor Yellow + } + + # Add to Windows Defender exclusions (requires admin) + try { + Add-MpPreference -ExclusionPath $extensionPath -ErrorAction Stop + Write-Host "Added to Windows Defender exclusions" -ForegroundColor Green + } catch { + Write-Host "Note: Could not add Windows Defender exclusion. Add manually: $extensionPath" -ForegroundColor Yellow + } +} + +Write-Host "`nFix completed. Please restart VS Code." -ForegroundColor Cyan +``` + +Run the script in PowerShell: +```powershell +PowerShell -ExecutionPolicy Bypass -File fix-sasylf-extension.ps1 +``` + +### User Solution 3: Batch Script (Alternative for cmd users) + +Create a file called `fix-sasylf-extension.bat`: + +```batch +@echo off +echo SASyLF VS Code Extension Fix for Windows 11 +echo. + +set "extensionPath=%USERPROFILE%\.vscode\extensions" + +if not exist "%extensionPath%" ( + echo VS Code extensions directory not found: %extensionPath% + echo Please make sure VS Code is installed and has been run at least once. + pause + exit /b 1 +) + +echo Looking for SASyLF extensions in: %extensionPath% +echo. + +for /d %%i in ("%extensionPath%\sasylf.sasylf-*") do ( + echo Found SASyLF extension: %%~nxi + + if not exist "%%i\logs" ( + mkdir "%%i\logs" + echo Created logs directory: %%i\logs + ) else ( + echo Logs directory exists: %%i\logs + ) + + echo Fixing permissions and ownership... + takeown /f "%%i\logs" /r /d y >nul 2>&1 + icacls "%%i\logs" /reset /T >nul 2>&1 + icacls "%%i\logs" /grant %USERNAME%:F /T >nul 2>&1 + + echo Testing file creation... + echo test > "%%i\logs\test.log" 2>nul + if exist "%%i\logs\test.log" ( + del "%%i\logs\test.log" + echo File creation test successful + ) else ( + echo Warning: File creation test failed + ) + echo. +) + +echo Fix completed. Please restart VS Code. +echo. +echo Note: If issues persist, try: +echo 1. Run this script as Administrator +echo 2. Add VS Code extensions folder to Windows Defender exclusions +echo 3. Restart VS Code as Administrator temporarily to test +pause +``` + +## Additional Troubleshooting + +### If the issue persists even with existing logs directory: + +1. **Windows Defender/Antivirus Exclusions:** + - Open Windows Security → Virus & threat protection → Manage settings → Add or remove exclusions + - Add folder exclusion: `%USERPROFILE%\.vscode\extensions` + - This prevents real-time scanning from blocking file operations + +2. **Run VS Code as Administrator (temporary test):** + ``` + Right-click VS Code → "Run as administrator" + ``` + If this fixes the issue, the problem is definitely permissions-related. + +3. **Check Windows Event Viewer:** + - Open Event Viewer → Windows Logs → Application + - Look for errors related to VS Code or file access around the time of the crash + - This may provide more specific error details + +4. **Alternative VS Code Installation:** + - Try the "System" installer instead of "User" installer + - System installer has broader file system access permissions + +5. **Clear VS Code Extension Host Cache:** + - Close VS Code completely + - Delete: `%APPDATA%\Code\User\workspaceStorage` + - Delete: `%APPDATA%\Code\CachedExtensions` + - Restart VS Code + +6. **File System Permissions Debug:** + ```cmd + whoami /groups + icacls "%USERPROFILE%\.vscode\extensions\sasylf.sasylf-2.0.0\logs" /T + ``` + This shows your user groups and detailed permissions on the logs directory. + +7. **Windows Long Path Support:** + - Enable long path support in Windows (may help with path-related issues): + ```cmd + reg add HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 + ``` + Requires restart. + +## Reporting Issues + +If none of these solutions work, please report the issue with: +- Your exact Windows version (`winver`) +- VS Code version (`Help > About`) +- Extension version +- Full error log from VS Code Developer Console (`Help > Toggle Developer Tools`) + +## Notes + +**Important**: This fix addresses the scenario where the logs directory exists but individual log files cannot be created within it. The original error `ENOENT: no such file or directory` refers to the specific log file, not the logs directory itself. + +**For Extension Developers**: The proper solution is to update the extension source code (available in [boyland/sasylf PR #127](https://github.com/boyland/sasylf/pull/127)) to include proper directory creation and error handling in the logging utilities. + +**For Users**: The workarounds above address permission and security issues that prevent file creation, providing immediate relief until the extension is updated. + +The root cause is in the extension's `utils.js` logging mechanism which should: +1. Check directory existence before attempting file operations +2. Handle permission errors gracefully with fallback logging +3. Create directories recursively when needed +4. Provide fallback mechanisms when file system access is restricted \ No newline at end of file diff --git a/fix-sasylf-extension.bat b/fix-sasylf-extension.bat new file mode 100644 index 00000000..18830108 --- /dev/null +++ b/fix-sasylf-extension.bat @@ -0,0 +1,105 @@ +@echo off +setlocal enabledelayedexpansion + +echo SASyLF VS Code Extension Fix for Windows 11 +echo ========================================== +echo Issue: Extension crashes due to logging utility file access problems +echo Source: https://github.com/boyland/sasylf/pull/127 (utils.js logging functions) +echo. + +set "extensionPath=%USERPROFILE%\.vscode\extensions" + +if not exist "%extensionPath%" ( + echo ERROR: VS Code extensions directory not found: %extensionPath% + echo Please make sure VS Code is installed and has been run at least once. + echo. + pause + exit /b 1 +) + +echo Scanning for SASyLF extensions in: %extensionPath% +echo. + +set "foundExtensions=0" +set "fixedExtensions=0" + +for /d %%i in ("%extensionPath%\sasylf.sasylf-*") do ( + set /a foundExtensions+=1 + echo Found SASyLF extension: %%~nxi + echo Path: %%i + + if not exist "%%i\logs" ( + mkdir "%%i\logs" 2>nul + if !errorlevel! equ 0 ( + echo ^✓ Created logs directory + ) else ( + echo ^✗ Failed to create logs directory + goto :continue + ) + ) else ( + echo ^✓ Logs directory already exists + ) + + echo ^→ Taking ownership and fixing permissions... + takeown /f "%%i\logs" /r /d y >nul 2>&1 + if !errorlevel! equ 0 ( + echo ^✓ Took ownership of logs directory + ) else ( + echo ^⚠ Could not take ownership + ) + + icacls "%%i\logs" /reset /T >nul 2>&1 + icacls "%%i\logs" /grant %USERNAME%:F /T >nul 2>&1 + if !errorlevel! equ 0 ( + echo ^✓ Set comprehensive file permissions + ) else ( + echo ^⚠ Could not set permissions fully + ) + + echo ^→ Testing file creation... + echo test > "%%i\logs\sasylf-test.log" 2>nul + if exist "%%i\logs\sasylf-test.log" ( + del "%%i\logs\sasylf-test.log" 2>nul + echo ^✓ File creation test successful + set /a fixedExtensions+=1 + ) else ( + echo ^⚠ File creation test failed - directory exists but file creation blocked + ) + + :continue + echo. +) + +if %foundExtensions% equ 0 ( + echo No SASyLF extensions found. Please install the extension first: + echo 1. Open VS Code + echo 2. Go to Extensions (Ctrl+Shift+X^) + echo 3. Search for 'SASyLF' + echo 4. Install the extension + echo 5. Run this script again + echo. + pause + exit /b 1 +) + +echo Summary: +echo Extensions found: %foundExtensions% +echo Successfully fixed: %fixedExtensions% +echo. + +if %fixedExtensions% gtr 0 ( + echo Fix completed! Next steps: + echo 1. Close VS Code completely + echo 2. Restart VS Code + echo 3. Open a .slf file to test the extension +) else ( + echo No extensions were successfully fixed. Additional steps: + echo 1. Run this script as Administrator + echo 2. Add VS Code extensions folder to Windows Defender exclusions: + echo %extensionPath% + echo 3. Try running VS Code as Administrator temporarily + echo 4. Check Windows Event Viewer for detailed error information +) + +echo. +pause \ No newline at end of file diff --git a/fix-sasylf-extension.ps1 b/fix-sasylf-extension.ps1 new file mode 100644 index 00000000..3e899cdf --- /dev/null +++ b/fix-sasylf-extension.ps1 @@ -0,0 +1,123 @@ +# SASyLF VS Code Extension Fix for Windows 11 +# This script fixes file permissions and security issues preventing log file creation +# Root cause: Extension logging utility lacks proper directory/permission handling + +Write-Host "SASyLF VS Code Extension Fix for Windows 11" -ForegroundColor Cyan +Write-Host "=========================================" -ForegroundColor Cyan +Write-Host "Issue: Extension crashes due to logging utility file access problems" -ForegroundColor Yellow +Write-Host "Source: https://github.com/boyland/sasylf/pull/127 (utils.js logging functions)" -ForegroundColor Yellow +Write-Host "" + +$extensionPath = "$env:USERPROFILE\.vscode\extensions" + +if (!(Test-Path $extensionPath)) { + Write-Host "VS Code extensions directory not found: $extensionPath" -ForegroundColor Red + Write-Host "Please make sure VS Code is installed and has been run at least once." -ForegroundColor Yellow + exit 1 +} + +Write-Host "Scanning for SASyLF extensions in: $extensionPath" -ForegroundColor Blue + +$sasylf_extensions = Get-ChildItem -Path $extensionPath -Directory -Name "sasylf.sasylf-*" + +if ($sasylf_extensions.Count -eq 0) { + Write-Host "No SASyLF extensions found. Please install the extension first:" -ForegroundColor Red + Write-Host "1. Open VS Code" -ForegroundColor Yellow + Write-Host "2. Go to Extensions (Ctrl+Shift+X)" -ForegroundColor Yellow + Write-Host "3. Search for 'SASyLF'" -ForegroundColor Yellow + Write-Host "4. Install the extension" -ForegroundColor Yellow + Write-Host "5. Run this script again" -ForegroundColor Yellow + exit 1 +} + +Write-Host "Found $($sasylf_extensions.Count) SASyLF extension(s)" -ForegroundColor Green +Write-Host "" + +$fixedCount = 0 + +foreach ($extension in $sasylf_extensions) { + $fullPath = Join-Path $extensionPath $extension + $logsPath = Join-Path $fullPath "logs" + + Write-Host "Processing extension: $extension" -ForegroundColor Yellow + Write-Host " Path: $fullPath" + + # Ensure logs directory exists + if (!(Test-Path $logsPath)) { + try { + New-Item -ItemType Directory -Path $logsPath -Force | Out-Null + Write-Host " ✓ Created logs directory" -ForegroundColor Green + } catch { + Write-Host " ✗ Failed to create logs directory: $($_.Exception.Message)" -ForegroundColor Red + continue + } + } else { + Write-Host " ✓ Logs directory already exists" -ForegroundColor Blue + } + + # Take ownership and reset permissions (more thorough than just setting ACL) + try { + Write-Host " → Taking ownership and resetting permissions..." -ForegroundColor Cyan + + # Take ownership + & takeown /f "$logsPath" /r /d y 2>&1 | Out-Null + + # Reset permissions to defaults + & icacls "$logsPath" /reset /T 2>&1 | Out-Null + + # Grant full control to current user + & icacls "$logsPath" /grant "${env:USERNAME}:F" /T 2>&1 | Out-Null + + Write-Host " ✓ Fixed ownership and permissions" -ForegroundColor Green + + # Test file creation to verify fix + $testFile = Join-Path $logsPath "sasylf-test.log" + try { + "Test log entry $(Get-Date)" | Out-File $testFile -ErrorAction Stop + Remove-Item $testFile -ErrorAction Stop + Write-Host " ✓ File creation test successful" -ForegroundColor Green + $fixedCount++ + } catch { + Write-Host " ⚠ File creation test failed: $($_.Exception.Message)" -ForegroundColor Yellow + Write-Host " The directory exists but file creation is still blocked" -ForegroundColor Yellow + } + + } catch { + Write-Host " ✗ Permission fix failed: $($_.Exception.Message)" -ForegroundColor Red + Write-Host " Try running PowerShell as Administrator" -ForegroundColor Yellow + } + + # Attempt to add Windows Defender exclusion (requires admin privileges) + try { + Add-MpPreference -ExclusionPath $extensionPath -ErrorAction Stop 2>&1 | Out-Null + Write-Host " ✓ Added Windows Defender exclusion" -ForegroundColor Green + } catch { + Write-Host " ⚠ Could not add Windows Defender exclusion automatically" -ForegroundColor Yellow + Write-Host " Manually add exclusion for: $extensionPath" -ForegroundColor Yellow + } + + Write-Host "" +} + +Write-Host "Summary:" -ForegroundColor Cyan +Write-Host " Extensions processed: $($sasylf_extensions.Count)" -ForegroundColor White +Write-Host " Successfully fixed: $fixedCount" -ForegroundColor Green + +if ($fixedCount -gt 0) { + Write-Host "" + Write-Host "Fix completed! Next steps:" -ForegroundColor Green + Write-Host "1. Close VS Code completely" -ForegroundColor Yellow + Write-Host "2. Restart VS Code" -ForegroundColor Yellow + Write-Host "3. Open a .slf file to test the extension" -ForegroundColor Yellow +} else { + Write-Host "" + Write-Host "No extensions were successfully fixed. Additional steps:" -ForegroundColor Red + Write-Host "1. Run PowerShell as Administrator and try again" -ForegroundColor Yellow + Write-Host "2. Manually add Windows Defender exclusion: $extensionPath" -ForegroundColor Yellow + Write-Host "3. Try running VS Code as Administrator temporarily" -ForegroundColor Yellow + Write-Host "4. Check Windows Event Viewer for detailed error logs" -ForegroundColor Yellow +} + +Write-Host "" +Write-Host "Press any key to continue..." +$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") \ No newline at end of file