-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchoco_start.ps1
More file actions
215 lines (178 loc) · 14.3 KB
/
choco_start.ps1
File metadata and controls
215 lines (178 loc) · 14.3 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# choco_start.ps1 by Alex Manoel Ferreira Silva
# Create symbolic links
New-Item -Path "${env:USERPROFILE}\3D Objects" -ItemType SymbolicLink -Value "C:\Users\Dados\3D Objects"
New-Item -Path "${env:USERPROFILE}\Contacts" -ItemType SymbolicLink -Value "C:\Users\Dados\Contacts"
New-Item -Path "${env:USERPROFILE}\Desktop" -ItemType SymbolicLink -Value "C:\Users\Dados\Desktop"
New-Item -Path "${env:USERPROFILE}\Documents" -ItemType SymbolicLink -Value "C:\Users\Dados\Documents"
New-Item -Path "${env:USERPROFILE}\Documentos" -ItemType SymbolicLink -Value "C:\Users\Dados\Documents"
New-Item -Path "${env:USERPROFILE}\Downloads" -ItemType SymbolicLink -Value "C:\Users\Dados\Downloads"
New-Item -Path "${env:USERPROFILE}\Favorites" -ItemType SymbolicLink -Value "C:\Users\Dados\Favorites"
New-Item -Path "${env:USERPROFILE}\Links" -ItemType SymbolicLink -Value "C:\Users\Dados\Links"
New-Item -Path "${env:USERPROFILE}\Music" -ItemType SymbolicLink -Value "C:\Users\Dados\Music"
New-Item -Path "${env:USERPROFILE}\Pictures" -ItemType SymbolicLink -Value "C:\Users\Dados\Pictures"
New-Item -Path "${env:USERPROFILE}\Saved Games" -ItemType SymbolicLink -Value "C:\Users\Dados\Saved Games"
New-Item -Path "${env:USERPROFILE}\Searches" -ItemType SymbolicLink -Value "C:\Users\Dados\Searches"
New-Item -Path "${env:USERPROFILE}\Videos" -ItemType SymbolicLink -Value "C:\Users\Dados\Videos"
# New-Item -Path "${env:USERPROFILE}\Google Drive" -ItemType SymbolicLink -Value "C:\Users\Dados\Google Drive"
New-Item -Path "${env:USERPROFILE}\Environment" -ItemType SymbolicLink -Value "C:\Users\Dados\Environment"
New-Item -Path "${env:USERPROFILE}\StudioProjects" -ItemType SymbolicLink -Value "C:\Users\Dados\StudioProjects"
# New-Item -Path "${env:USERPROFILE}\temp" -ItemType SymbolicLink -Value "C:\Users\Dados\temp"
# New-Item -Path "${env:USERPROFILE}\.android" -ItemType SymbolicLink -Value "C:\Users\Dados\.android"
# New-Item -Path "${env:USERPROFILE}\.cleverfiles" -ItemType SymbolicLink -Value "C:\Users\Dados\.cleverfiles"
# New-Item -Path "${env:USERPROFILE}\.eclipse" -ItemType SymbolicLink -Value "C:\Users\Dados\.eclipse"
# New-Item -Path "${env:USERPROFILE}\.espressif" -ItemType SymbolicLink -Value "C:\Users\Dados\.espressif"
# New-Item -Path "${env:USERPROFILE}\.config" -ItemType SymbolicLink -Value "C:\Users\Dados\.config"
# New-Item -Path "${env:USERPROFILE}\.docker" -ItemType SymbolicLink -Value "C:\Users\Dados\.docker"
# New-Item -Path "${env:USERPROFILE}\.gradle" -ItemType SymbolicLink -Value "C:\Users\Dados\.gradle"
# New-Item -Path "${env:USERPROFILE}\.ssh" -ItemType SymbolicLink -Value "C:\Users\Dados\.ssh"
# New-Item -Path "${env:USERPROFILE}\.vscode" -ItemType SymbolicLink -Value "C:\Users\Dados\.vscode"
# New-Item -Path "${env:USERPROFILE}\.bash_history" -ItemType SymbolicLink -Value "C:\Users\Dados\.bash_history"
# New-Item -Path "${env:USERPROFILE}\.emulator_console_auth_token" -ItemType SymbolicLink -Value "C:\Users\Dados\.emulator_console_auth_token"
# New-Item -Path "${env:USERPROFILE}\.gitconfig" -ItemType SymbolicLink -Value "C:\Users\Dados\.gitconfig"
# New-Item -Path "${env:USERPROFILE}\.jgitconfig" -ItemType SymbolicLink -Value "C:\Users\Dados\.jgitconfig"
# New-Item -Path "${env:USERPROFILE}\_netrc" -ItemType SymbolicLink -Value "C:\Users\Dados\_netrc"
New-Item -Path "${env:USERPROFILE}\AppData\Roaming\Factorio" -ItemType SymbolicLink -Value "C:\Users\Dados\Jogos\Factorio Roaming"
# New-Item -Path "C:\Riot Games" -ItemType SymbolicLink -Value "C:\Users\Dados\Jogos\Riot Games"
# New-Item -Path "${env:USERPROFILE}\.AndroidStudio4.0" -ItemType SymbolicLink -Value "C:\Users\Dados\.AndroidStudio4.0"
# New-Item -Path "${env:USERPROFILE}\AppData\Local\Arduino15" -ItemType SymbolicLink -Value "C:\Users\Dados\AppData\Local\Arduino15"
# New-Item -Path "${env:USERPROFILE}\AppData\Roaming\Arduino" -ItemType SymbolicLink -Value "C:\Users\Dados\AppData\Roaming\Arduino"
# New-Item -Path "${env:ProgramData}\DockerDesktop" -ItemType SymbolicLink -Value "C:\Users\Dados\ProgramData\DockerDesktop"
# New-Item -Path "${env:USERPROFILE}\AppData\Roaming\stremio" -ItemType SymbolicLink -Value "C:\Users\Dados\AppData\Roaming\stremio"
# New-Item -Path "${env:USERPROFILE}\AppData\Local\Google" -ItemType SymbolicLink -Value "C:\Users\Dados\AppData\Local\Google"
# New-Item -Path "C:\Android" -ItemType SymbolicLink -Value "C:\Users\Dados\Programas\Android"
# New-Item -Path "C:\tools" -ItemType SymbolicLink -Value "C:\Users\Dados\Programas\tools"
# New-Item -Path "${env:USERPROFILE}\AppData\Local\Docker" -ItemType SymbolicLink -Value "C:\Users\Dados\AppData\Local\Docker"
# New-Item -Path "${env:ProgramData}\Package Cache" -ItemType SymbolicLink -Value "C:\Users\Dados\ProgramData\Package Cache"
# New-Item -Path "${env:ProgramData}\Dell" -ItemType SymbolicLink -Value "C:\Users\Dados\ProgramData\Dell"
# New-Item -Path "${env:ProgramFiles}\Docker" -ItemType SymbolicLink -Value "C:\Users\Dados\Program Files\Docker"
# New-Item -Path "${env:ProgramFiles(x86)}\Microsoft Visual Studio" -ItemType SymbolicLink -Value "C:\Users\Dados\Program Files (x86)\Microsoft Visual Studio"
New-Item -Path "${env:CommonProgramFiles}\Siemens" -ItemType SymbolicLink -Value "C:\Users\Dados\Program Files\Common Files\Siemens"
New-Item -Path "${env:ProgramFiles}\Siemens" -ItemType SymbolicLink -Value "C:\Users\Dados\Program Files\Siemens"
New-Item -Path "${env:CommonProgramFiles(x86)}\Siemens" -ItemType SymbolicLink -Value "C:\Users\Dados\Program Files (x86)\Common Files\Siemens"
New-Item -Path "${env:ProgramData}\Siemens" -ItemType SymbolicLink -Value "C:\Users\Dados\ProgramData\Siemens"
# New-Item -Path "${env:ProgramFiles}\Microsoft Visual Studio" -ItemType SymbolicLink -Value "C:\Users\Dados\Program Files\Microsoft Visual Studio"
# New-Item -Path "${env:USERPROFILE}\AppData\Local\Packages" -ItemType SymbolicLink -Value "C:\Users\Dados\AppData\Local\Packages"
# New-Item -Path "${env:USERPROFILE}\AppData\Local\Autodesk" -ItemType SymbolicLink -Value "C:\Users\Dados\AppData\Local\Autodesk"
# New-Item -Path "${env:USERPROFILE}\AppData\Local\WhatsApp" -ItemType SymbolicLink -Value "C:\Users\Dados\AppData\Local\WhatsApp"
# New-Item -Path "${env:USERPROFILE}\AppData\Roaming\Code" -ItemType SymbolicLink -Value "C:\Users\Dados\AppData\Roaming\Code"
New-Item -Path "${env:USERPROFILE}\AppData\Roaming\Eagle" -ItemType SymbolicLink -Value "C:\Users\Dados\AppData\Roaming\Eagle"
New-Item -Path "${env:USERPROFILE}\AppData\Roaming\obs-studio" -ItemType SymbolicLink -Value "C:\Users\Dados\AppData\Roaming\obs-studio"
# New-Item -Path "${env:ProgramFiles(x86)}\Steam" -ItemType SymbolicLink -Value "C:\Users\Dados\Program Files (x86)\Steam"
New-Item -Path "${env:ProgramFiles}\Altium" -ItemType SymbolicLink -Value "C:\Users\Dados\Program Files\Altium"
$DEV_DRIVE = "E:"
$PACKAGES_PATH = "$DEV_DRIVE\packages"
mkdir $PACKAGES_PATH\npm
mkdir $PACKAGES_PATH\.nuget
mkdir $PACKAGES_PATH\vcpkg
mkdir $PACKAGES_PATH\pip
mkdir $PACKAGES_PATH\cargo
mkdir $PACKAGES_PATH\maven
mkdir $PACKAGES_PATH\gradle
setx /M npm_config_cache $PACKAGES_PATH\npm
setx /M NUGET_PACKAGES $PACKAGES_PATH\.nuget
setx /M VCPKG_DEFAULT_BINARY_CACHE $PACKAGES_PATH\vcpkg
setx /M PIP_CACHE_DIR $PACKAGES_PATH\pip
setx /M CARGO_HOME $PACKAGES_PATH\cargo
setx /M MAVEN_OPTS -Dmaven.repo.local=$PACKAGES_PATH\maven
setx /M GRADLE_USER_HOME $PACKAGES_PATH\gradle
fsutil devdrv trust $DEV_DRIVE
fsutil devdrv enable /disallowAv
# Activate Windows
irm https://get.activated.win | iex
Import-Certificate -CertStoreLocation Cert:\LocalMachine\Root -FilePath "${env:ProgramFiles}\Siemens\Automation\Portal V16\Bin\CA_STEP7.cer"
Import-Certificate -CertStoreLocation Cert:\LocalMachine\Root -FilePath "${env:ProgramFiles}\Siemens\Automation\Portal V16\Bin\Siemens_Automation_CA_2019.cer"
# Get Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# See packages at https://chocolatey.org/packages/
# Use according to your own needs...
# Essentials
choco install googlechrome google-drive-file-stream -y --ignore-checksums
choco install brave -y
# More Tools
choco install powershell-core dotnetcore-runtime powertoys -y
# easybcd recuva -y
# Dev
choco install wsl git tortoisegit -y
# choco install nodejs android-sdk flutter python llvm golang openjdk scrcpy -y
choco install nodejs python openjdk scrcpy -y
# choco install visualstudio2019community visualstudio2019buildtools visualstudio2019-workload-vctools visualstudio2019-workload-nativedesktop -y
choco install vscode -y
# choco install docker-desktop docker-machine -y
choco install docker-desktop -y
# Games
choco install discord -y
# leagueoflegends
# Others
winget install --accept-source-agreements -e --id WhatsApp.WhatsApp
choco install whatsapp stremio ghostscript winpcap obs-studio obs-virtualcam streamlabs-obs chocolateygui slack -y
# skyfonts ext2fsd microsoft-teams
winget install --id=Anysphere.Cursor -e
# choco install cursoride -y
# Install conform
# go get github.com/talos-systems/conform
# npm install -g standard-version
# WSL 2
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
DISM /Online /Enable-Feature /FeatureName:Microsoft-Hyper-V /All /norestart
bcdedit /set hypervisorlaunchtype auto
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
DISM /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
DISM /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
# https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
wsl --set-default-version 2
wsl --list --verbose
# https://docs.microsoft.com/pt-br/windows/wsl/install-win10#step-4---download-the-linux-kernel-update-package
wsl --install -d ubuntu
wsl --update
wsl --shutdown
# Environments
function Expand-EnvironmentVariablesRecursively($unexpanded) {
$previous = ''
$expanded = $unexpanded
while($previous -ne $expanded) {
$previous = $expanded
$expanded = [System.Environment]::ExpandEnvironmentVariables($previous)
}
return $expanded
}
# Create variables
[System.Environment]::SetEnvironmentVariable('ENVIRONMENT_PATH', 'C:\Users\Dados\Environment', [System.EnvironmentVariableTarget]::Machine)
[System.Environment]::SetEnvironmentVariable('IDF_PATH', '%ENVIRONMENT_PATH%\eclipse-cpp\esp-idf', [System.EnvironmentVariableTarget]::Machine)
[System.Environment]::SetEnvironmentVariable('RMAKER_PATH', '%ENVIRONMENT_PATH%\eclipse-cpp\esp-rainmaker', [System.EnvironmentVariableTarget]::Machine)
# [System.Environment]::SetEnvironmentVariable('IDF_PATH_SET', '%IDF_PATH%\tools;%IDF_PATH%\components\esptools_py\esptool;%IDF_PATH%\components\espcoredump;%IDF_PATH%\components\partition_table', [System.EnvironmentVariableTarget]::Machine)
# [System.Environment]::SetEnvironmentVariable('FLUTTER_PATH', '%ChocolateyToolsLocation%\flutter', [System.EnvironmentVariableTarget]::Machine)
# [System.Environment]::SetEnvironmentVariable('FLUTTER_PATH_SET', '%FLUTTER_PATH%;%FLUTTER_PATH%\bin;%FLUTTER_PATH%\.pub-cache\bin', [System.EnvironmentVariableTarget]::Machine)
[System.Environment]::SetEnvironmentVariable('IDF_TOOLS_PATH', '%USERPROFILE%\.espressif', [System.EnvironmentVariableTarget]::Machine)
# [System.Environment]::SetEnvironmentVariable('MSYS32_PATH', '%ENVIRONMENT_PATH%\msys32', [System.EnvironmentVariableTarget]::Machine)
# [System.Environment]::SetEnvironmentVariable('MSYS32_PATH_SET', '%MSYS32_PATH%\usr\bin;%MSYS32_PATH%\mingw32\bin;%MSYS32_PATH%\opt\xtensa-esp32-elf\bin', [System.EnvironmentVariableTarget]::Machine)
[System.Environment]::SetEnvironmentVariable('GIT_SSH', 'G:\My Drive\PortableApps\PuTTYPortable\App\putty\PLINK.EXE', [System.EnvironmentVariableTarget]::Machine)
[System.Environment]::SetEnvironmentVariable('SSH_AUTH_SOCK', '\\.\pipe\ssh-pageant', [System.EnvironmentVariableTarget]::Machine)
[System.Environment]::SetEnvironmentVariable('ESPPORT', 'COM7', [System.EnvironmentVariableTarget]::Machine)
# Update variables
$oldpath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).path
[System.Environment]::SetEnvironmentVariable("OriginalPath", $oldpath, [System.EnvironmentVariableTarget]::Machine)
# [System.Environment]::SetEnvironmentVariable("CustomPathPrefix", "%ANDROID_HOME%\emulator;%IDF_PATH_SET%", [System.EnvironmentVariableTarget]::Machine)
# [System.Environment]::SetEnvironmentVariable("CustomPathSuffix", "%FLUTTER_PATH_SET%;%MSYS32_PATH_SET%", [System.EnvironmentVariableTarget]::Machine)
$newpath = "%ANDROID_HOME%\emulator;%IDF_PATH_SET%;%OriginalPath%;%FLUTTER_PATH_SET%;%MSYS32_PATH_SET%"
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $newPath
# Load variables to this session
$env:OriginalPath = Expand-EnvironmentVariablesRecursively([System.Environment]::GetEnvironmentVariable("OriginalPath","Machine")
$env:CustomPathPrefix = Expand-EnvironmentVariablesRecursively([System.Environment]::GetEnvironmentVariable("CustomPathPrefix","Machine")
$env:CustomPathSuffix = Expand-EnvironmentVariablesRecursively([System.Environment]::GetEnvironmentVariable("CustomPathSuffix","Machine")
$env:Path = Expand-EnvironmentVariablesRecursively([System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User"))
$env:IDF_PATH = Expand-EnvironmentVariablesRecursively([System.Environment]::GetEnvironmentVariable("IDF_PATH","Machine"))
$env:IDF_PATH_SET = Expand-EnvironmentVariablesRecursively([System.Environment]::GetEnvironmentVariable("IDF_PATH_SET","Machine"))
# Install environment
git clone -b release-v4.1 --recursive https://github.com/espressif/esp-idf.git $env:IDF_PATH
cmd /c %IDF_PATH%\install.bat
$IDF_TOOLS_EXPORTS_FILE="$env:TEMP\idf_export_vars.tmp"
python.exe $env:IDF_PATH\tools\idf_tools.py export --format key-value > "$IDF_TOOLS_EXPORTS_FILE"
foreach($line in Get-Content "$IDF_TOOLS_EXPORTS_FILE") {
$key, $value = $line.split('=')
[System.Environment]::SetEnvironmentVariable($key, $value, [System.EnvironmentVariableTarget]::Machine)
}
cmd /c %IDF_PATH%\export.bat
wsl --upgrade Ubuntu
$backuppath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).path
[System.Environment]::SetEnvironmentVariable("BackupPath", $backuppath, [System.EnvironmentVariableTarget]::Machine)
# You´re done. ;)