Atualizacao Portrait Rua/Loja

This commit is contained in:
2026-03-31 17:12:33 -03:00
parent 4ac80449b0
commit f81c29ddd0

View File

@@ -2,7 +2,8 @@ Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.Application]::EnableVisualStyles() [System.Windows.Forms.Application]::EnableVisualStyles()
# ===== Configurações de versão 20032026 ===== # ===== Configurações de versão 20032026 =====
$VersionPortrait = "2026.03.06.3" $VersionPortrait = "2026.03.26.1"
$VersionPortraitR = "2026.03.26.5"
$VersionDual = "2026.03.05.2" $VersionDual = "2026.03.05.2"
$VersionBotoneira = "2026.01.13.1" $VersionBotoneira = "2026.01.13.1"
$ReleaseBaseUrl = "https://ndlabversions.pilotgamingsys.com/devel" $ReleaseBaseUrl = "https://ndlabversions.pilotgamingsys.com/devel"
@@ -68,6 +69,7 @@ function Get-ModeVersion {
switch ($Mode) { switch ($Mode) {
"Portrait" { return $VersionPortrait } "Portrait" { return $VersionPortrait }
"PortraitR" { return $VersionPortraitR }
"Dual" { return $VersionDual } "Dual" { return $VersionDual }
"Botoneira" { return $VersionBotoneira } "Botoneira" { return $VersionBotoneira }
default { throw "Unknown mode: $Mode" } default { throw "Unknown mode: $Mode" }
@@ -81,12 +83,27 @@ function Get-ModeOrientation {
switch ($Mode) { switch ($Mode) {
"Portrait" { return "Portrait" } "Portrait" { return "Portrait" }
"PortraitR" { return "Portrait" }
"Dual" { return "Dual" } "Dual" { return "Dual" }
"Botoneira" { return "Portrait" } "Botoneira" { return "Portrait" }
default { throw "Unknown mode: $Mode" } default { throw "Unknown mode: $Mode" }
} }
} }
function Get-ModeDisplayName {
param (
[string]$Mode
)
switch ($Mode) {
"Portrait" { return "Portrait Lojas" }
"PortraitR" { return "Portrait Rua" }
"Dual" { return "Dual" }
"Botoneira" { return "Botoneira" }
default { return $Mode }
}
}
function Download-ReleaseZip { function Download-ReleaseZip {
param ( param (
[string]$Version [string]$Version
@@ -100,6 +117,10 @@ function Download-ReleaseZip {
Write-Log "URL: $zipUrl" Write-Log "URL: $zipUrl"
try { try {
if (-not (Test-Path "C:\pilotgames\downloads")) {
New-Item -ItemType Directory -Path "C:\pilotgames\downloads" -Force | Out-Null
}
if (Test-Path $zipDest) { if (Test-Path $zipDest) {
Remove-Item -Path $zipDest -Force -ErrorAction SilentlyContinue Remove-Item -Path $zipDest -Force -ErrorAction SilentlyContinue
} }
@@ -117,11 +138,14 @@ function Install-Pilot {
param ([string]$Mode) param ([string]$Mode)
$outputBox.Clear() $outputBox.Clear()
Write-Log "Starting $Mode installation..."
$displayMode = Get-ModeDisplayName -Mode $Mode
Write-Log "Starting $displayMode installation..."
$version = Get-ModeVersion -Mode $Mode $version = Get-ModeVersion -Mode $Mode
$orient = Get-ModeOrientation -Mode $Mode $orient = Get-ModeOrientation -Mode $Mode
Write-Log "Selected mode: $displayMode"
Write-Log "Selected version: $version" Write-Log "Selected version: $version"
Write-Log "Selected orientation: $orient" Write-Log "Selected orientation: $orient"
@@ -135,14 +159,12 @@ function Install-Pilot {
Write-Log "Could not retrieve MAC address.`n" Write-Log "Could not retrieve MAC address.`n"
} }
Write-Log "`nSetting main connectio as PRIVATE..." Write-Log "`nSetting main connection as PRIVATE..."
Get-NetConnectionProfile | Where-Object {$_.InterfaceAlias -like "*Ethernet*"} | Set-NetConnectionProfile -NetworkCategory Private Get-NetConnectionProfile | Where-Object { $_.InterfaceAlias -like "*Ethernet*" } | Set-NetConnectionProfile -NetworkCategory Private
Write-Log "`nAdjusting System Time..." Write-Log "`nAdjusting System Time..."
w32tm /resync /force w32tm /resync /force
Write-Log "Stopping PilotGameAgent service..." Write-Log "Stopping PilotGameAgent service..."
Stop-Service -Name "PilotGameAgent" -Force -ErrorAction SilentlyContinue Stop-Service -Name "PilotGameAgent" -Force -ErrorAction SilentlyContinue
@@ -183,10 +205,10 @@ function Install-Pilot {
Start-Sleep -Seconds 20 Start-Sleep -Seconds 20
Write-Log "Starting PilotGameAgent service..." Write-Log "Starting PilotGameAgent service..."
Set-Service -Name "PilotGameAgent" -StartupType Automatic -PassThru Set-Service -Name "PilotGameAgent" -StartupType Automatic -PassThru | Out-Null
Start-Service -Name "PilotGameAgent" Start-Service -Name "PilotGameAgent"
Write-Log "$Mode installation completed successfully." Write-Log "$displayMode installation completed successfully."
} }
catch { catch {
Write-Log "Installation error: $_" Write-Log "Installation error: $_"
@@ -258,11 +280,12 @@ function Disable-UACAndNotifications {
# GUI # GUI
$form = New-Object System.Windows.Forms.Form $form = New-Object System.Windows.Forms.Form
$form.Text = "Pilot Installer" $form.Text = "Pilot Installer"
$form.Size = New-Object System.Drawing.Size(760,500) $form.Size = New-Object System.Drawing.Size(940,500)
$form.StartPosition = "CenterScreen" $form.StartPosition = "CenterScreen"
$buttons = @( $buttons = @(
@{ Text = "Install Portrait"; Action = { Install-Pilot -Mode "Portrait" } }, @{ Text = "Install Portrait Lojas"; Action = { Install-Pilot -Mode "Portrait" } },
@{ Text = "Install Portrait Rua"; Action = { Install-Pilot -Mode "PortraitR" } },
@{ Text = "Install Dual"; Action = { Install-Pilot -Mode "Dual" } }, @{ Text = "Install Dual"; Action = { Install-Pilot -Mode "Dual" } },
@{ Text = "Install Botoneira"; Action = { Install-Pilot -Mode "Botoneira" } }, @{ Text = "Install Botoneira"; Action = { Install-Pilot -Mode "Botoneira" } },
@{ Text = "Exit"; Action = { $form.Close() } } @{ Text = "Exit"; Action = { $form.Close() } }
@@ -272,18 +295,18 @@ $x = 10
foreach ($btn in $buttons) { foreach ($btn in $buttons) {
$button = New-Object System.Windows.Forms.Button $button = New-Object System.Windows.Forms.Button
$button.Text = $btn.Text $button.Text = $btn.Text
$button.Size = New-Object System.Drawing.Size(170,30) $button.Size = New-Object System.Drawing.Size(175,30)
$button.Location = New-Object System.Drawing.Point($x,20) $button.Location = New-Object System.Drawing.Point($x,20)
$button.Add_Click($btn.Action) $button.Add_Click($btn.Action)
$form.Controls.Add($button) $form.Controls.Add($button)
$x += 180 $x += 185
} }
$outputBox = New-Object System.Windows.Forms.TextBox $outputBox = New-Object System.Windows.Forms.TextBox
$outputBox.Multiline = $true $outputBox.Multiline = $true
$outputBox.ScrollBars = "Vertical" $outputBox.ScrollBars = "Vertical"
$outputBox.ReadOnly = $true $outputBox.ReadOnly = $true
$outputBox.Size = New-Object System.Drawing.Size(720,370) $outputBox.Size = New-Object System.Drawing.Size(900,370)
$outputBox.Location = New-Object System.Drawing.Point(10,70) $outputBox.Location = New-Object System.Drawing.Point(10,70)
$outputBox.Font = New-Object System.Drawing.Font("Consolas",10) $outputBox.Font = New-Object System.Drawing.Font("Consolas",10)
$outputBox.Name = "OutputTextBox" $outputBox.Name = "OutputTextBox"