This repository has been archived by the owner on Mar 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathinstall.ps1
68 lines (53 loc) · 2.62 KB
/
install.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Import-Module .\settings.psm1
Import-Module .\envy.psm1
$is64bit = "$env:PROCESSOR_ARCHITECTURE" -like "AMD64"
# Setup chocolatey in known location.
Set-Var -scope Process -name ChocolateyInstall -value "$chocolateyRoot"
(iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')))>$null 2>&1
Add-Path -scope Process -path "$chocolateyRoot\bin"
# Setup tools/bin root for portable packages.
Set-Var -scope Process -name ChocolateyBinRoot -value "$chocolateyToolsRoot"
Set-Var -scope User -name ChocolateyBinRoot -value "$chocolateyToolsRoot"
Add-Path -scope Process -path "$chocolateyToolsRoot"
Add-Path -scope User -path "$chocolateyToolsRoot"
# Allow uninstallers to be executed.
choco feature enable --name=autoUninstaller
# Setup ConEmu.
Write-Host "Installing ConEmu..."
$chocolateyRoot | .\Invoke-ElevatedCommand.ps1 { &"$input\bin\choco" install conemu -y }
# Install git.
Write-Host "Installing git..."
$chocolateyRoot | .\Invoke-ElevatedCommand.ps1 { &"$input\bin\choco" install git.install -y -params '"/GitAndUnixToolsOnPath /NoAutoCrlf"' }
# Help git tools find correct locations.
Set-Var User HOME $root
$gitRegistryKey = "HKLM:\SOFTWARE\GitForWindows"
$gitKeys = Get-ItemProperty -Path $gitRegistryKey
$gitLocation = $gitKeys.InstallPath
if ($gitLocation -ne "") {
$gitPath = Join-Path $gitLocation "cmd"
Add-Path -scope Process -path "$gitPath"
}
# Install git credentials manager.
Write-Host "Installing git credentials manager..."
$chocolateyRoot | .\Invoke-ElevatedCommand.ps1 { &"$input\bin\choco" install git-credential-manager-for-windows -y }
git config --global credential.helper manager
# Install nodejs and configure NPM to use known locations.
Write-Host "Installing nodejs..."
$nodeRoot = "$env:ProgramFiles\nodejs"
$chocolateyRoot | .\Invoke-ElevatedCommand.ps1 { &"$input\bin\choco" install nodejs.install -y --ia "ADDLOCAL=NodeRuntime,npm" }
Add-Path -scope User -path "$nodeRoot"
Add-Path -scope Process -path "$nodeRoot"
# Setup local NPM cache and repository.
npm config set cache "$npmCache"
npm config set prefix "$npmRepository"
Add-Path -scope User -path "$npmRepository"
# Install default set of NPM modules.
npm install -g $defaultNpmModules
# Setup .NET.
&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}
&"$dnxRoot\bin\dnvm" upgrade
# Install Visual Studio Code.
$vscodeRoot = "$env:LOCALAPPDATA\Code\bin"
choco install visualstudiocode -y
Add-Path -scope User -path "$vscodeRoot"
Write-Host "All done! Please close this window and start ConEmu."