Beta_cartrigesg_bd Beta v0.12

This commit is contained in:
2026-08-05 16:15:35 +03:00
parent e6b8538679
commit 15d5e780ee
10 changed files with 365 additions and 8 deletions

BIN
installer/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,113 @@
param(
[Parameter(Mandatory = $true)]
[string]$InstallerPath,
[Parameter(Mandatory = $true)]
[string]$ConfigurationPath
)
$ErrorActionPreference = 'Stop'
if (-not (Test-Path -LiteralPath $ConfigurationPath)) {
throw "Файл параметров RustDesk не найден: $ConfigurationPath"
}
$configuration = @{}
foreach ($line in Get-Content -LiteralPath $ConfigurationPath) {
$separatorIndex = $line.IndexOf('=')
if ($separatorIndex -lt 0) {
continue
}
$name = $line.Substring(0, $separatorIndex)
$value = $line.Substring($separatorIndex + 1)
$configuration[$name] = $value
}
$Mode = [string]$configuration['Mode']
$IdServer = [string]$configuration['IdServer']
$RelayServer = [string]$configuration['RelayServer']
$Key = [string]$configuration['Key']
$Password = [string]$configuration['Password']
if ($Mode -notin @('automatic', 'manual')) {
throw "Неизвестный режим настройки RustDesk: $Mode"
}
function Find-RustDeskExecutable {
$candidates = @()
foreach ($basePath in @($env:ProgramFiles, ${env:ProgramFiles(x86)})) {
if ($basePath) {
$candidates += Join-Path $basePath 'RustDesk\rustdesk.exe'
}
}
if ($env:LOCALAPPDATA) {
$candidates += Join-Path $env:LOCALAPPDATA 'RustDesk\rustdesk.exe'
$candidates += Join-Path $env:LOCALAPPDATA 'Programs\RustDesk\rustdesk.exe'
}
foreach ($candidate in $candidates) {
if ($candidate -and (Test-Path -LiteralPath $candidate)) {
return $candidate
}
}
return $null
}
if (-not (Test-Path -LiteralPath $InstallerPath)) {
throw "Установщик RustDesk не найден: $InstallerPath"
}
$installProcess = Start-Process -FilePath $InstallerPath -ArgumentList '--silent-install' -Wait -PassThru -WindowStyle Hidden
if ($installProcess.ExitCode -ne 0) {
throw "Установка RustDesk завершилась с кодом $($installProcess.ExitCode)."
}
$rustDeskExecutable = $null
for ($attempt = 0; $attempt -lt 30; $attempt++) {
$rustDeskExecutable = Find-RustDeskExecutable
if ($rustDeskExecutable) {
break
}
Start-Sleep -Seconds 2
}
if (-not $rustDeskExecutable) {
throw 'После установки не найден rustdesk.exe.'
}
function Invoke-RustDeskCommand {
param([string[]]$Arguments)
& $rustDeskExecutable @Arguments
if ($LASTEXITCODE -ne 0) {
throw "Команда RustDesk $($Arguments[0]) завершилась с кодом $LASTEXITCODE."
}
}
$service = Get-Service -Name 'RustDesk' -ErrorAction SilentlyContinue
if (-not $service) {
Invoke-RustDeskCommand @('--install-service')
Start-Sleep -Seconds 3
$service = Get-Service -Name 'RustDesk' -ErrorAction SilentlyContinue
}
if (-not $service) {
throw 'Служба RustDesk не была установлена.'
}
if ($service.Status -ne 'Running') {
Start-Service -Name 'RustDesk'
$service.WaitForStatus('Running', [TimeSpan]::FromSeconds(30))
}
if ($Mode -eq 'manual') {
Invoke-RustDeskCommand @('--option', 'custom-rendezvous-server', $IdServer)
Invoke-RustDeskCommand @('--option', 'relay-server', $RelayServer)
Invoke-RustDeskCommand @('--option', 'key', $Key)
}
if ($Password) {
Invoke-RustDeskCommand @('--password', $Password)
}

View File

@@ -1,4 +1,4 @@
# PostgreSQL prerequisite
# Офлайн-компоненты установщиков
Перед сборкой вручную положите сюда официальный установщик PostgreSQL для Windows x64 под именем:
@@ -7,3 +7,14 @@ postgesql.exe
```
`build_inventera_installer_windows.bat` проверит наличие этого файла и включит его внутрь установщика `dist\Inventera.exe`. Автоматического скачивания больше нет.
Для сборки установщика клиента также положите сюда официальный установщик
RustDesk для Windows x64 под именем:
```text
rustdesk.exe
```
`build_client_agent_v2_installer_windows.bat` проверит наличие файла и включит
его в `dist\Inv_web_Client_Setup.exe`. В режиме без RustDesk этот компонент не
запускается.