Beta_cartrigesg_bd Beta v0.10
This commit is contained in:
BIN
installer/assets/cartridge/bd.bmp
Normal file
BIN
installer/assets/cartridge/bd.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 MiB |
BIN
installer/assets/cartridge/bd_setup.bmp
Normal file
BIN
installer/assets/cartridge/bd_setup.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 MiB |
BIN
installer/assets/cartridge/finish.bmp
Normal file
BIN
installer/assets/cartridge/finish.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 201 KiB |
BIN
installer/assets/cartridge/proces.bmp
Normal file
BIN
installer/assets/cartridge/proces.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 MiB |
BIN
installer/assets/cartridge/start.bmp
Normal file
BIN
installer/assets/cartridge/start.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 201 KiB |
68
installer/configure_inventera_service.ps1
Normal file
68
installer/configure_inventera_service.ps1
Normal file
@@ -0,0 +1,68 @@
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$ExecutablePath
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$serviceName = 'InventeraServer'
|
||||
$displayName = 'Inventera Server'
|
||||
$description = 'Автоматически запускает веб-сервер Inventera при старте Windows.'
|
||||
$postgresServiceName = 'InventeraPostgreSQL18'
|
||||
|
||||
if (-not (Test-Path -LiteralPath $ExecutablePath -PathType Leaf)) {
|
||||
throw "Не найден исполняемый файл службы: $ExecutablePath"
|
||||
}
|
||||
|
||||
$quotedExecutablePath = '"' + $ExecutablePath + '"'
|
||||
$service = Get-Service -Name $serviceName -ErrorAction SilentlyContinue
|
||||
|
||||
if ($null -eq $service) {
|
||||
New-Service `
|
||||
-Name $serviceName `
|
||||
-BinaryPathName $quotedExecutablePath `
|
||||
-DisplayName $displayName `
|
||||
-Description $description `
|
||||
-StartupType Automatic | Out-Null
|
||||
}
|
||||
else {
|
||||
if ($service.Status -ne 'Stopped') {
|
||||
Stop-Service -Name $serviceName -Force
|
||||
$service.WaitForStatus('Stopped', [TimeSpan]::FromSeconds(30))
|
||||
}
|
||||
|
||||
& sc.exe config $serviceName 'binPath=' $quotedExecutablePath 'start=' 'auto' | Out-Null
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Не удалось обновить службу $serviceName. Код ошибки: $LASTEXITCODE"
|
||||
}
|
||||
|
||||
& sc.exe description $serviceName $description | Out-Null
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Не удалось обновить описание службы. Код ошибки: $LASTEXITCODE"
|
||||
}
|
||||
}
|
||||
|
||||
& sc.exe failure $serviceName 'reset=' '86400' 'actions=' 'restart/60000/restart/60000/restart/60000' | Out-Null
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Не удалось настроить перезапуск службы. Код ошибки: $LASTEXITCODE"
|
||||
}
|
||||
|
||||
& sc.exe failureflag $serviceName '1' | Out-Null
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Не удалось включить действия при ошибке службы. Код ошибки: $LASTEXITCODE"
|
||||
}
|
||||
|
||||
if ($null -ne (Get-Service -Name $postgresServiceName -ErrorAction SilentlyContinue)) {
|
||||
& sc.exe config $serviceName 'depend=' $postgresServiceName | Out-Null
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Не удалось настроить зависимость от PostgreSQL. Код ошибки: $LASTEXITCODE"
|
||||
}
|
||||
}
|
||||
|
||||
Start-Service -Name $serviceName
|
||||
(Get-Service -Name $serviceName).WaitForStatus(
|
||||
'Running',
|
||||
[TimeSpan]::FromSeconds(30)
|
||||
)
|
||||
|
||||
Write-Host 'Служба Inventera установлена и запущена.'
|
||||
@@ -26,6 +26,10 @@ param(
|
||||
[ValidateRange(1, 65535)]
|
||||
[int]$ApplicationPort,
|
||||
|
||||
[Parameter(Mandatory = $false)]
|
||||
[ValidateSet('full', 'cartridge')]
|
||||
[string]$Edition = 'full',
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$ConfigPath
|
||||
)
|
||||
@@ -213,6 +217,7 @@ $configDirectory = Split-Path -Parent $ConfigPath
|
||||
New-Item -ItemType Directory -Path $configDirectory -Force | Out-Null
|
||||
|
||||
$config = [ordered]@{
|
||||
edition = $Edition
|
||||
database = [ordered]@{
|
||||
host = '127.0.0.1'
|
||||
port = $PostgreSqlPort
|
||||
|
||||
Reference in New Issue
Block a user