Merge branch 'develop' into bugfix/hide-menu
This commit is contained in:
commit
f6486d80b0
16
build/start/change-service-timeout.bat
Normal file
16
build/start/change-service-timeout.bat
Normal file
@ -0,0 +1,16 @@
|
||||
@echo off
|
||||
|
||||
PUSHD %~dp0..
|
||||
call runasadmin.bat "%~dpnx0"
|
||||
|
||||
POPD
|
||||
|
||||
if %errorlevel% == 0 (
|
||||
pwsh %~dp0/command.ps1 "increase-service-timeout"
|
||||
)
|
||||
|
||||
echo.
|
||||
|
||||
if "%1"=="nopause" goto start
|
||||
pause
|
||||
:start
|
@ -2,14 +2,29 @@ $PSversionMajor = $PSVersionTable.PSVersion | sort-object major | ForEach-Object
|
||||
$PSversionMinor = $PSVersionTable.PSVersion | sort-object minor | ForEach-Object {$_.minor}
|
||||
|
||||
if ($PSversionMajor -lt 7 -or $PSversionMinor -lt 2) {
|
||||
Write-Error "Powershell version must be greater than or equal to 7.2. Press Enter to exit."
|
||||
Pause
|
||||
Write-Error "Powershell version must be greater than or equal to 7.2."
|
||||
exit
|
||||
}
|
||||
|
||||
$WorkDir = "$(Split-Path -Parent $PSScriptRoot)\run";
|
||||
$CommandName = "$($args[0])";
|
||||
|
||||
if ( $CommandName -eq "increase-service-timeout" ) {
|
||||
$RegistryPath = 'HKLM:\SYSTEM\CurrentControlSet\Control'
|
||||
$Name = 'ServicesPipeTimeout'
|
||||
$Value = '90000'
|
||||
|
||||
Write-Output "Changing service start timeout from default value (30000 ms ) to $($Value) ms"
|
||||
|
||||
New-ItemProperty -Path $RegistryPath -Name $Name -Value $Value -PropertyType DWORD -Force
|
||||
|
||||
|
||||
Write-Warning "Please, restart the computer for the changes to take effect."
|
||||
exit
|
||||
}
|
||||
|
||||
|
||||
|
||||
#Write-Output "Starting $($CommandName) services at time: $(Get-Date -Format HH:mm:ss)"
|
||||
#Write-Output ""
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user