feat: Добавлены скрипты для работы с сетью, системными утилитами и настройки Discord.

This commit is contained in:
2025-12-30 21:08:02 +03:00
parent 99bb23201b
commit d7a3b20da9
3 changed files with 96 additions and 1 deletions

View File

@@ -72,6 +72,9 @@ function Download-File {
$stream.Close()
$resp.Close()
# Unblock file to prevent "Mark of the Web" issues
Unblock-File -Path $Destination -ErrorAction SilentlyContinue
return $true
}
catch {
@@ -80,6 +83,7 @@ function Download-File {
}
}
function Get-SubscriptionData {
param(
[string]$Url,

View File

@@ -2,6 +2,7 @@
# 🖥️ SYSTEM UTILS
# ==========================================
# --- СИСТЕМНАЯ ИНФОРМАЦИЯ ---
function Get-SystemInfo {
@@ -11,6 +12,42 @@ function Get-SystemInfo {
}
}
function Ensure-VCRedist {
Write-Info "Проверка Visual C++ Redistributable..."
# Check registry for VC++ 2015-2022 (x64)
# Key: HKLM:\SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64
$regPath = "HKLM:\SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64"
if (Test-Path $regPath) {
$installed = (Get-ItemProperty -Path $regPath).Installed
if ($installed -eq 1) {
Write-Success "Visual C++ Redistributable уже установлен."
return
}
}
Write-Warning "Visual C++ Redistributable не найден. Устанавливаю..."
$vcUrl = "https://aka.ms/vs/17/release/vc_redist.x64.exe"
$vcFile = "$env:TEMP\vc_redist.x64.exe"
if (Download-File -Url $vcUrl -Destination $vcFile) {
Write-Step "Установка библиотек Visual C++..."
$process = Start-Process -FilePath $vcFile -ArgumentList "/install", "/quiet", "/norestart" -PassThru -Wait
if ($process.ExitCode -eq 0 -or $process.ExitCode -eq 3010) {
# 3010 = reboot required (usually works without immediate reboot)
Write-Success "Библиотеки установлены!"
}
else {
Write-Error "Ошибка установки VC++ (Код: $($process.ExitCode))"
Write-Host " Попробуйте установить вручную: https://aka.ms/vs/17/release/vc_redist.x64.exe"
}
Remove-Item $vcFile -Force -ErrorAction SilentlyContinue
}
}
# --- DOCKER ---
function Test-Docker {