Skip to content
This repository has been archived by the owner on Jul 26, 2021. It is now read-only.

Commit

Permalink
- изменена установка chocolatey из-за явной несовместимости последних…
Browse files Browse the repository at this point in the history
… версий и PackageManagement в PowerShell (#29, #30)
  • Loading branch information
sergey-s-betke committed Oct 3, 2017
1 parent 010c92b commit 5e370ba
Showing 1 changed file with 8 additions and 29 deletions.
37 changes: 8 additions & 29 deletions install/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -67,27 +67,12 @@ switch ( $env:PROCESSOR_ARCHITECTURE ) {
};
$ToPath = @();

Import-Module -Name PackageManagement;

$null = Install-PackageProvider -Name NuGet -Force;
$null = Import-PackageProvider -Name NuGet -Force;
$null = (
Get-PackageSource -ProviderName NuGet `
| Set-PackageSource -Trusted `
);
$null = Install-PackageProvider -Name Chocolatey -Force;
$null = Import-PackageProvider -Name Chocolatey -Force;
$null = (
Get-PackageSource -ProviderName Chocolatey `
| Set-PackageSource -Trusted `
);

[String] $choco;
[String] $chocoExe;

if ( -not ( $env:APPVEYOR -eq 'True' ) ) {
$null = Install-Package -Name chocolatey -MinimumVersion 0.9.10.3 -ProviderName Chocolatey;
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'));
};
$choco = Join-Path `
$chocoExe = Join-Path `
-Path (
Join-Path `
-Path ( [Environment]::GetEnvironmentVariable( 'ChocolateyInstall', [System.EnvironmentVariableTarget]::Machine ) ) `
Expand All @@ -97,15 +82,15 @@ $choco = Join-Path `
;

if ( -not ( $env:APPVEYOR -eq 'True' ) ) {
& $choco install cygwin --confirm --failonstderr | Out-String -Stream | Write-Verbose;
& $chocoExe install cygwin --confirm --failonstderr | Out-String -Stream | Write-Verbose;
$env:CygWin = Get-ItemPropertyValue `
-Path HKLM:\SOFTWARE\Cygwin\setup `
-Name rootdir `
;
Write-Verbose "CygWin root directory: $env:CygWin";
$ToPath += "$env:CygWin\bin";

#& $choco install make mkdir touch --source cygwin --confirm --failonstderr | Out-String -Stream | Write-Verbose;
#& $chocoExe install make mkdir touch --source cygwin --confirm --failonstderr | Out-String -Stream | Write-Verbose;
# исправляем проблемы совместимости chocolatey, cyg-get и cygwin
If ( Test-Path "$env:CygWin\cygwinsetup.exe" ) {
$cygwinsetup = "$env:CygWin\cygwinsetup.exe";
Expand Down Expand Up @@ -143,13 +128,7 @@ $env:CygWin = Get-ItemPropertyValue `
Write-Verbose "CygWin root directory: $env:CygWin";
$ToPath += "$env:CygWin\bin";

$null = Import-PackageProvider -Name Chocolatey -Force;
$null = (
Get-PackageSource -ProviderName Chocolatey `
| Set-PackageSource -Trusted `
);

& $choco install Ghostscript --confirm --failonstderr | Out-String -Stream | Write-Verbose;
& $chocoExe install Ghostscript --confirm --failonstderr | Out-String -Stream | Write-Verbose;
$ToPath += Split-Path `
-LiteralPath (
(
Expand All @@ -162,8 +141,8 @@ $ToPath += Split-Path `
;

if ( $GUI ) {
& $choco install SourceTree --confirm --failonstderr | Out-String -Stream | Write-Verbose;
& $choco install notepadplusplus --confirm --failonstderr | Out-String -Stream | Write-Verbose;
& $chocoExe install SourceTree --confirm --failonstderr | Out-String -Stream | Write-Verbose;
& $chocoExe install notepadplusplus --confirm --failonstderr | Out-String -Stream | Write-Verbose;
};

Write-Verbose 'Preparing PATH environment variable...';
Expand Down

0 comments on commit 5e370ba

Please sign in to comment.