Atualizacao Portrait Rua/Loja 14/04

This commit is contained in:
2026-04-14 09:39:58 -03:00
parent f81c29ddd0
commit 9a42386acd

View File

@@ -2,9 +2,10 @@ Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.Application]::EnableVisualStyles()
# ===== Configurações de versão 20032026 =====
$VersionPortrait = "2026.03.26.1"
$VersionPortraitR = "2026.03.26.5"
$VersionDual = "2026.03.05.2"
$VersionPortrait = "2026.04.10.1"
$VersionPortraitR = "2026.04.10.3"
$VersionDual = "2026.04.10.2"
$VersionDualR = "2026.04.10.4"
$VersionBotoneira = "2026.01.13.1"
$ReleaseBaseUrl = "https://ndlabversions.pilotgamingsys.com/devel"
@@ -63,42 +64,39 @@ powershell -command "Start-Process cabinet.exe -Verb runas -ArgumentList '-scree
}
function Get-ModeVersion {
param (
[string]$Mode
)
param ([string]$Mode)
switch ($Mode) {
"Portrait" { return $VersionPortrait }
"PortraitR" { return $VersionPortraitR }
"Dual" { return $VersionDual }
"DualR" { return $VersionDualR }
"Botoneira" { return $VersionBotoneira }
default { throw "Unknown mode: $Mode" }
}
}
function Get-ModeOrientation {
param (
[string]$Mode
)
param ([string]$Mode)
switch ($Mode) {
"Portrait" { return "Portrait" }
"PortraitR" { return "Portrait" }
"Dual" { return "Dual" }
"DualR" { return "Dual" }
"Botoneira" { return "Portrait" }
default { throw "Unknown mode: $Mode" }
}
}
function Get-ModeDisplayName {
param (
[string]$Mode
)
param ([string]$Mode)
switch ($Mode) {
"Portrait" { return "Portrait Lojas" }
"PortraitR" { return "Portrait Rua" }
"Dual" { return "Dual" }
"DualR" { return "Dual Rua" }
"Botoneira" { return "Botoneira" }
default { return $Mode }
}
@@ -158,12 +156,19 @@ function Install-Pilot {
} else {
Write-Log "Could not retrieve MAC address.`n"
}
Write-Log "`nSetting main connection as PRIVATE..."
Get-NetConnectionProfile | Where-Object { $_.InterfaceAlias -like "*Ethernet*" } | Set-NetConnectionProfile -NetworkCategory Private
Write-Log "`nAdjusting System Time..."
w32tm /resync /force
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: $_"
}
Write-Log "Stopping PilotGameAgent service..."
Stop-Service -Name "PilotGameAgent" -Force -ErrorAction SilentlyContinue
@@ -180,17 +185,17 @@ function Install-Pilot {
Remove-Item -Path "C:\pilotgames\BRGDRelease.bak" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "C:\pilotgames\NDGDRelease.bak" -Recurse -Force -ErrorAction SilentlyContinue
Write-Log "Waiting 10 seconds...."
Write-Log "Waiting 10 seconds..."
Start-Sleep -Seconds 10
if (Test-Path "C:\pilotgames\BRGDRelease") {
Write-Log "Backing up BRGDRelease folder..."
Move-Item "C:\pilotgames\BRGDRelease" "C:\pilotgames\BRGDRelease.bak" -Force
Move-Item "C:\pilotgames\BRGDRelease" "C:\pilotgames\BRGDRelease.bak" -Force -ErrorAction SilentlyContinue
}
if (Test-Path "C:\pilotgames\NDGDRelease") {
Write-Log "Backing up NDGDRelease folder..."
Move-Item "C:\pilotgames\NDGDRelease" "C:\pilotgames\NDGDRelease.bak" -Force
Move-Item "C:\pilotgames\NDGDRelease" "C:\pilotgames\NDGDRelease.bak" -Force -ErrorAction SilentlyContinue
}
$zipPath = Download-ReleaseZip -Version $version
@@ -280,34 +285,44 @@ function Disable-UACAndNotifications {
# GUI
$form = New-Object System.Windows.Forms.Form
$form.Text = "Pilot Installer"
$form.Size = New-Object System.Drawing.Size(940,500)
$form.Size = New-Object System.Drawing.Size(820, 560)
$form.StartPosition = "CenterScreen"
$buttonsPanel = New-Object System.Windows.Forms.FlowLayoutPanel
$buttonsPanel.Location = New-Object System.Drawing.Point(10, 10)
$buttonsPanel.Size = New-Object System.Drawing.Size(780, 80)
$buttonsPanel.AutoSize = $false
$buttonsPanel.WrapContents = $true
$buttonsPanel.FlowDirection = [System.Windows.Forms.FlowDirection]::LeftToRight
$buttonsPanel.Padding = New-Object System.Windows.Forms.Padding(0)
$buttonsPanel.Margin = New-Object System.Windows.Forms.Padding(0)
$form.Controls.Add($buttonsPanel)
$buttons = @(
@{ 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 Lojas"; Action = { Install-Pilot -Mode "Dual" } },
@{ Text = "Install Dual Rua"; Action = { Install-Pilot -Mode "DualR" } },
@{ Text = "Install Botoneira"; Action = { Install-Pilot -Mode "Botoneira" } },
@{ Text = "Exit"; Action = { $form.Close() } }
)
$x = 10
foreach ($btn in $buttons) {
$button = New-Object System.Windows.Forms.Button
$button.Text = $btn.Text
$button.Size = New-Object System.Drawing.Size(175,30)
$button.Location = New-Object System.Drawing.Point($x,20)
$button.Size = New-Object System.Drawing.Size(180, 30)
$button.Margin = New-Object System.Windows.Forms.Padding(5)
$button.Add_Click($btn.Action)
$form.Controls.Add($button)
$x += 185
$buttonsPanel.Controls.Add($button)
}
$outputBox = New-Object System.Windows.Forms.TextBox
$outputBox.Multiline = $true
$outputBox.ScrollBars = "Vertical"
$outputBox.ReadOnly = $true
$outputBox.Size = New-Object System.Drawing.Size(900,370)
$outputBox.Location = New-Object System.Drawing.Point(10,70)
$outputBox.Size = New-Object System.Drawing.Size(780, 420)
$outputBox.Location = New-Object System.Drawing.Point(10, 100)
$outputBox.Font = New-Object System.Drawing.Font("Consolas",10)
$outputBox.Name = "OutputTextBox"