diff --git a/installer/windows.ps1 b/installer/windows.ps1 index 02205fc..619b705 100755 --- a/installer/windows.ps1 +++ b/installer/windows.ps1 @@ -1,8 +1,12 @@ -# Installing chocolatey +# check if chocolatey is installed Set-ExecutionPolicy AllSigned -Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) -$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") - +if (Get-Command choco -ErrorAction SilentlyContinue) { + Write-Host "Chocolatey is already installed." +} else { + Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + Write-Host "Chocolatey has been installed." +} function pack_manager_install([string]$PACK_NAME, [string]$APP_NAME) { # Checking is package installed or not.