Atualizacao Pilot_Install

This commit is contained in:
2026-07-21 11:51:50 -03:00
parent a939e4bfb6
commit cfd5590b5d
2 changed files with 71 additions and 386 deletions

View File

@@ -67,7 +67,9 @@ function Get-ModeVersion {
param ([string]$Mode)
switch ($Mode) {
"Dual" { return $VersionDual }
"Portrait" { return $VersionPortrait }
"PortraitR" { return $VersionPortraitR }
"Dual" { return $VersionDual }
"DualR" { return $VersionDualR }
"Botoneira" { return $VersionBotoneira }
default { throw "Unknown mode: $Mode" }
@@ -78,7 +80,9 @@ function Get-ModeOrientation {
param ([string]$Mode)
switch ($Mode) {
"Dual" { return "Dual" }
"Portrait" { return "Portrait" }
"PortraitR" { return "Portrait" }
"Dual" { return "Dual" }
"DualR" { return "Dual" }
"Botoneira" { return "Portrait" }
default { throw "Unknown mode: $Mode" }
@@ -89,7 +93,8 @@ function Get-ModeDisplayName {
param ([string]$Mode)
switch ($Mode) {
"PortraitCabTab" { return "Portrait CabTab" }
"Portrait" { return "Portrait CabTab" }
"PortraitR" { return "Portrait CabTab" }
"Dual" { return "Dual" }
"DualR" { return "Dual Rua" }
"Botoneira" { return "Botoneira" }
@@ -277,56 +282,6 @@ function Disable-UACAndNotifications {
}
}
function Upgrade-PortraitCabTab {
$CabDir="C:\PilotDownloads\CabTabInstall"
$files=@(
"credentials.dat","deployAgent.bat","deployCabinet.bat","site_director.cfg","start.bat",
"OHGDRelease-2026.05.07.1.zip","PilotGameAgentRelease-2026.6.2.1.zip",
"PG Settings.reg","windowsdesktop-runtime-8.0.15-win-x64.exe")
foreach($f in $files){
if(!(Test-Path (Join-Path $CabDir $f))){
[System.Windows.Forms.MessageBox]::Show("Arquivo não encontrado: $f")
return
}
}
Copy-Item "$CabDir\credentials.dat" C:\pilotgames -Force
Copy-Item "$CabDir\deployAgent.bat" C:\pilotgames -Force
Copy-Item "$CabDir\deployCabinet.bat" C:\pilotgames -Force
Copy-Item "$CabDir\site_director.cfg" C:\pilotgames -Force
Copy-Item "$CabDir\start.bat" C:\pilotgames -Force
Copy-Item "$CabDir\OHGDRelease-2026.05.07.1.zip" C:\pilotgames\downloads -Force
Copy-Item "$CabDir\PilotGameAgentRelease-2026.6.2.1.zip" C:\pilotgames\downloads -Force
reg import "$CabDir\PG Settings.reg"
Start-Process "$CabDir\windowsdesktop-runtime-8.0.15-win-x64.exe" -ArgumentList "/quiet /norestart" -Wait
Remove-Item C:\pilot -Recurse -Force -ErrorAction SilentlyContinue
Stop-Service PilotGameAgent -ErrorAction SilentlyContinue
sc.exe delete PilotGameAgent
Rename-Item C:\pilotgames\game_agent game_agent.ND -ErrorAction SilentlyContinue
New-Item C:\pilotgames\game_agent -ItemType Directory -Force|Out-Null
Push-Location C:\pilotgames
& .\deployAgent.bat 2026.6.2.1
& .\InstallGameAgentService.bat
Set-Service PilotGameAgent -StartupType Automatic
Remove-Item .\NDGDRelease*.zip -Force -ErrorAction SilentlyContinue
Remove-Item .\NDGDRelease.bak -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item .\BRGDRelease.bak -Recurse -Force -ErrorAction SilentlyContinue
if(Test-Path .\NDGDRelease){Move-Item .\NDGDRelease .\NDGDRelease.bak}
if(Test-Path .\BRGDRelease){Move-Item .\BRGDRelease .\BRGDRelease.bak}
& .\deployCabinet.bat 2026.05.07.1
Stop-Process -Name explorer -Force -ErrorAction SilentlyContinue
Start-Service PilotGameAgent
Pop-Location
}
# GUI
$form = New-Object System.Windows.Forms.Form
$form.Text = "Pilot Installer"
@@ -345,7 +300,8 @@ $buttonsPanel.Margin = New-Object System.Windows.Forms.Padding(0)
$form.Controls.Add($buttonsPanel)
$buttons = @(
@{ Text = "Portrait CabTab"; Action = { Upgrade-PortraitCabTab } },
@{ Text = "Install Portrait CabTab"; Action = { Install-Pilot -Mode "Portrait" } },
@{ Text = "Install Portrait CabTab"; Action = { Install-Pilot -Mode "PortraitR" } },
@{ Text = "Install Dual Lojas"; Action = { Install-Pilot -Mode "Dual" } },
@{ Text = "Install Dual Rua"; Action = { Install-Pilot -Mode "DualR" } },
@{ Text = "Install Botoneira"; Action = { Install-Pilot -Mode "Botoneira" } },
@@ -372,4 +328,64 @@ $outputBox.Name = "OutputTextBox"
$form.Controls.Add($outputBox)
$form.Topmost = $true
$form.ShowDialog()
$form.ShowDialog()
function Upgrade-PortraitCabTab {
Set-HighPerformancePowerPlan
Rename-PCToMac
Disable-UACAndNotifications
Write-Log "`nSetting main connection as PRIVATE..."
Get-NetConnectionProfile |
Where-Object { $_.InterfaceAlias -like "*Ethernet*" } |
Set-NetConnectionProfile -NetworkCategory Private
Write-Log "`nAdjusting System Time..."
try {
Set-Service w32time -StartupType Automatic -ErrorAction SilentlyContinue
Start-Service w32time -ErrorAction SilentlyContinue
w32tm /resync /force | Out-Null
Write-Log "System time synchronized."
} catch {
Write-Log "Could not synchronize system time: $_"
}
Set-Location C:\PilotDownloads\CabTabInstall
Copy-Item credentials.dat C:\pilotgames\ -Force
Copy-Item deployAgent.bat C:\pilotgames\ -Force
Copy-Item deployCabinet.bat C:\pilotgames\ -Force
Copy-Item site_director.cfg C:\pilotgames\ -Force
Copy-Item start.bat C:\pilotgames\ -Force
Copy-Item OHGDRelease-2026.05.07.1.zip C:\pilotgames\downloads\ -Force
Copy-Item PilotGameAgentRelease-2026.6.2.1.zip C:\pilotgames\downloads\ -Force
reg import "PG Settings.reg"
Start-Process windowsdesktop-runtime-8.0.15-win-x64.exe -ArgumentList "/quiet /norestart" -Wait
Remove-Item C:\pilot -Recurse -Force -ErrorAction SilentlyContinue
Set-Location C:\pilotgames
net stop PilotGameAgent
sc.exe delete PilotGameAgent
Rename-Item game_agent game_agent.ND -ErrorAction SilentlyContinue
New-Item game_agent -ItemType Directory -Force|Out-Null
.\deployAgent.bat 2026.6.2.1
.\InstallGameAgentService.bat
Set-Service -Name PilotGameAgent -StartupType Automatic
Remove-Item NDGDRelease*.zip -Force -ErrorAction SilentlyContinue
Remove-Item NDGDRelease.bak -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item BRGDRelease.bak -Recurse -Force -ErrorAction SilentlyContinue
if(Test-Path NDGDRelease){Move-Item NDGDRelease NDGDRelease.bak}
if(Test-Path BRGDRelease){Move-Item BRGDRelease BRGDRelease.bak}
.\deployCabinet.bat 2026.05.07.1
taskkill /IM explorer.exe /F
net start PilotGameAgent
}