# Force TLS 1.2 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 $goreloProcesses = @( "Gorelo.Rmm.Installer", "Gorelo.RemoteManagement.Shell", "Gorelo.RemoteManagement.Agent" ) $processList = (Get-Process -ErrorAction SilentlyContinue).ProcessName if ((($goreloProcesses | Where-Object { $_ -notin $processList }) | Measure-Object).Count -eq 0) { Write-Warning "Gorelo is already installed on this device" return } # Elevation check (Admin OR SYSTEM) $currentIdentity = [Security.Principal.WindowsIdentity]::GetCurrent() $currentPrincipal = New-Object Security.Principal.WindowsPrincipal($currentIdentity) $isElevated = $currentIdentity.IsSystem -or ` $currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) if (-not $isElevated) { Write-Error "Administrator privileges required" exit 1 } if (-not $Env:ProgramW6432) { Write-Error "64-bit Program Files folder not found" exit 1 } $headers = @{ "Content-Type" = "application/json" } $body = @{ LicenseKey = "UIe736W84CFxGFGOC/5ruN5CNSYpv3MQ6lYW/X5CZ5CTWdiS1kHXbw==" Hostname = $env:COMPUTERNAME Os = "windows" } | ConvertTo-Json try { $response = Invoke-RestMethod ` -Uri "https://gorelo-rmm.azurewebsites.net/api/rmm/device/registration/limit" ` -Method POST ` -Body $body ` -Headers $headers } catch { Write-Error "API call failed: $_" exit 2 } if ($response.isSuccess -eq $true) { $goreloDir = "$Env:ProgramW6432\Gorelo" $setupDir = "$goreloDir\Setup" $downloadsDirectory = "$goreloDir\Installer\Downloads" $downloadPath = "$downloadsDirectory\Gorelo.Rmm.Setup.zip" Remove-Item -Path $goreloDir -Recurse -Force -ErrorAction SilentlyContinue New-Item -Path $downloadsDirectory -ItemType Directory -Force | Out-Null Invoke-WebRequest -Uri $response.setupDownloadUrl -OutFile $downloadPath Expand-Archive -Path $downloadPath -DestinationPath $setupDir -Force Start-Process ` -FilePath "$setupDir\Gorelo.Rmm.Setup\Gorelo.Rmm.Setup.exe" ` -ArgumentList "--i --l UIe736W84CFxGFGOC/5ruN5CNSYpv3MQ6lYW/X5CZ5CTWdiS1kHXbw==" ` -WindowStyle Hidden ` -Wait Write-Host "Gorelo installation complete" } else { Write-Error "Failed to install: $($response.errorMessage)" exit 3 }