|
| 1 | +name: Run CTT-Remote |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main ] |
| 6 | + pull_request: |
| 7 | + branches: [ main ] |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +jobs: |
| 11 | + run-ctt-remote: |
| 12 | + runs-on: windows-latest |
| 13 | + |
| 14 | + steps: |
| 15 | + - name: Checkout repository |
| 16 | + uses: actions/checkout@v4 |
| 17 | + |
| 18 | + - name: Setup .NET Framework 4.8 |
| 19 | + shell: powershell |
| 20 | + run: | |
| 21 | + # Check if .NET Framework 4.8 is already installed |
| 22 | + $dotNetVersion = Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\' | Get-ItemPropertyValue -Name Release -ErrorAction SilentlyContinue |
| 23 | +
|
| 24 | + if ($dotNetVersion -ge 528040) { |
| 25 | + Write-Host ".NET Framework 4.8 or later is already installed" |
| 26 | + } else { |
| 27 | + Write-Host "Installing .NET Framework 4.8..." |
| 28 | + # Download .NET Framework 4.8 installer |
| 29 | + $installerUrl = "https://download.visualstudio.microsoft.com/download/pr/2d6bb6b2-226a-4baa-bdec-798822606ff1/8494001c276a4b96804cde7829c04d7f/ndp48-x86-x64-allos-enu.exe" |
| 30 | + $installerPath = "$env:TEMP\ndp48-installer.exe" |
| 31 | +
|
| 32 | + Invoke-WebRequest -Uri $installerUrl -OutFile $installerPath |
| 33 | +
|
| 34 | + # Install silently |
| 35 | + Start-Process -FilePath $installerPath -ArgumentList "/q", "/norestart" -Wait -NoNewWindow |
| 36 | +
|
| 37 | + Write-Host ".NET Framework 4.8 installation completed" |
| 38 | + } |
| 39 | +
|
| 40 | + - name: Verify .NET Framework installation |
| 41 | + shell: powershell |
| 42 | + run: | |
| 43 | + $dotNetVersion = Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\' | Get-ItemPropertyValue -Name Release -ErrorAction SilentlyContinue |
| 44 | + Write-Host ".NET Framework version: $dotNetVersion" |
| 45 | +
|
| 46 | + if ($dotNetVersion -ge 528040) { |
| 47 | + Write-Host ".NET Framework 4.8 or later is installed ✓" |
| 48 | + } else { |
| 49 | + Write-Error ".NET Framework 4.8 is not installed" |
| 50 | + exit 1 |
| 51 | + } |
| 52 | +
|
| 53 | + - name: Run CTT-Remote.exe |
| 54 | + shell: powershell |
| 55 | + run: | |
| 56 | + $exePath = "CTT-Remote/CTT-Remote.exe" |
| 57 | +
|
| 58 | + if (Test-Path $exePath) { |
| 59 | + Write-Host "Running $exePath..." |
| 60 | + & $exePath |
| 61 | + } else { |
| 62 | + Write-Error "Executable not found at: $exePath" |
| 63 | + exit 1 |
| 64 | + } |
0 commit comments