-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackages_install.ps1
More file actions
250 lines (214 loc) · 8.6 KB
/
packages_install.ps1
File metadata and controls
250 lines (214 loc) · 8.6 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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# Run this file as administrator to avoid prompts
# TODOs:
# - ? repair broken packages e.g. by using the msstore version instead
# resp. disabling the hash check using the --ignore-security-hash option ?
# - fine-tune this file on a virtual machine
# - add MS Office
# - add Qt
# - add zig compiler
# - next time also create a winget config file (once winget-config is released)
# - optimize for runtime performance (if some program has a service that
# takes CPU/memory)
# TODO https://github.com/microsoft/winget-cli/blob/master/doc/Settings.md
# TODO nvidia driver (studio or gaming?)
# TODO other relevant drivers (maybe to a separate file...)
# TODO add useful packages from here: https://github.com/actions/runner-images/blob/main/images/win/Windows2022-Readme.md
# TODO add `--silent` and `--disable-interactivity` options to `winget install` commands? https://learn.microsoft.com/en-us/windows/package-manager/winget/install
# TODO install broken winget packages from msstore if possible
# TODO move some packages from here to optional and the most used optional packages here
# TODO make the script break if a single package installation fails (I think that currently the script continues in that case)
# TODO some packages fail to install - mark them and find an alternative way
# TODO add choco package managers and install stuff that fails or
# TODO add relevant packages from the package list here: <https://github.com/xsukax/xwgg/blob/main/index.html>
# TODO - make the install script list packages which failed to install (currently it just prints error codes in red to stdout)
# is not present in winget via choco
Set-PSDebug -Trace 1
$ErrorActionPreference = "Stop"
# Install Scoop
if (-not (Get-Command scoop -ErrorAction SilentlyContinue)) {
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
# TODO an attempt to reload the path (investigate further)
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
}
scoop bucket add extras
# TODO uncomment the next line resp. fix it so that it works and (scoop is not found right after the installation, probably path problem)
scoop install windows-virtualdesktop-helper
# TODO - go over this list https://github.com/ChrisTitusTech/winutil/blob/main/config/applications.json and add useful apps
# TODO add linux versions of the useful apps to linux initPC script
$WINGET_PACKAGES = @(
# HW monitoring
'CPUID.CPU-Z'
'CPUID.HWMonitor'
# Drivers and HW support
'Logitech.OptionsPlus'
# Runtimes
'Microsoft.DotNet.DesktopRuntime.6' # for GitExtensions
'Microsoft.DotNet.DesktopRuntime.7'
'Microsoft.VCRedist.2015+.x64'
'RubyInstallerTeam.RubyWithDevKit.3.2'
'Microsoft.PowerShell'
# Virtualisation and containers
'Docker.DockerDesktop'
'VMware.WorkstationPlayer' # broken
# TODO? add WSL installation here?
# Utils & TOSORT TODO - sort to cathegories
'7zip.7zip'
'Gyan.FFmpeg'
# TODO WizTree does what WinDirStat does but better and quicker, consider commenting WinDirStat out
'WinDirStat.WinDirStat'
'AntibodySoftware.WizTree'
'XAMPPRocky.tokei' # broken? TODO FIX?
'Ookla.Speedtest.Desktop'
'fzf'
'AlDanial.Cloc' # count number of lines of code
'starship.starship'
'pCloudAG.pCloudDrive'
'Anki.Anki'
'Hex-Rays.IDA.Free'
'Qalculate'
'Joplin'
'Geany.Geany'
'PuTTY.PuTTY'
'DBBrowserForSQLite.DBBrowserForSQLite'
'voidtools.Everything'
'Oracle.VirtualBox'
'Google.EarthPro'
'CodeSector.TeraCopy'
'Gyan.FFmpeg'
'NirSoft.OpenedFilesView'
'NirSoft.InsideClipboard'
'Google.GoogleDrive'
'qBittorrent.qBittorrent'
'dotPDN.PaintDotNet'
'Inkscape.Inkscape'
'Audacity.Audacity'
'KDE.Kdenlive'
'Microsoft.Sysinternals.Autoruns'
'Rufus.Rufus'
# Desktop environment & window management extensions
'AltSnap.AltSnap' # https://github.com/RamonUnch/AltSnap/wiki (TODO read)
# TODO implement matching behaviour in Win and Linux (same keyboard shortcuts
# and same possibilities)
'Microsoft.PowerToys'
'AutoHotkey.AutoHotkey'
# TODO add relevant sysinternals packages (see `winget search sysinternals`)
# Version control
'Git.Git'
'GitHub.cli'
'GitHub.GitHubDesktop'
'GitExtensionsTeam.GitExtensions'
'o2sh.onefetch'
# Code editors
'Microsoft.VisualStudioCode'
'Neovim.Neovim'
'Helix.Helix'
'Notepad++.Notepad++'
'WerWolv.ImHex'
'RKibria.frhed'
# Terminal emulators
'Alacritty.Alacritty'
'Microsoft.WindowsTerminal'
'wez.wezterm'
# compilers, build tools and interpreters
'Python.Python.3.13' # Try always installing the latest Python package instead of fixing the version
'Kitware.CMake'
'LLVM.LLVM'
'Rustlang.Rustup'
'JFrog.Conan'
'Ninja-build.Ninja'
'Microsoft.VisualStudio.2022.BuildTools'
'Cppcheck.Cppcheck'
'Microsoft.WinDbg'
# Web browsers
'Google.Chrome'
'Mozilla.Firefox'
# Office work & document readers & books
'Adobe.Acrobat.Reader.64-bit'
'TrackerSoftware.PDF-XChangeEditor'
'SumatraPDF.SumatraPDF'
'KDE.Okular'
'TheDocumentFoundation.LibreOffice'
'Amazon.Kindle'
'Grammarly.Grammarly'
'calibre.calibre'
# Messaging and videoconferencing apps
'Zoom.Zoom' # broken TODO FIX?
'9NKSQGP7F2NH' # WhatsApp, the winget package is broken
'OpenWhisperSystems.Signal'
'Facebook.Messenger' # broken? TODO FIX? TODO maybe replace with Chrome PWA
'Discord.Discord'
# Multimedia
'9NCBCSZSJRSB' # Spotify, the winget package is broken
'GIMP.GIMP'
'IrfanSkiljan.IrfanView'
'Audacity.Audacity'
'VideoLAN.VLC'
# Productivity
'Doist.Todoist'
)
$WINGET_PACKAGES | ForEach-Object {
echo "### Winget is installing a package: $PSItem"
winget install --accept-source-agreements --accept-package-agreements `
--silent --disable-interactivity -e --id $PSItem
}
winget upgrade --all --accept-source-agreements --accept-package-agreements `
--silent --disable-interactivity
# Pip packages
# TODO some packages below need to be fixed (or just installed globally?)
# TODO install python applications with pipx
# refresh Path variable
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" `
+ [System.Environment]::GetEnvironmentVariable("Path","User")
python -m pip install --upgrade pip
py -3 -m pip install --user pipx
py -3 -m pipx ensurepath
# refresh Path variable
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" `
+ [System.Environment]::GetEnvironmentVariable("Path","User")
# C++ linters
pipx install flawfinder
pipx install cpplint
# TODO try installing these packages directly via winget
pip install matplotlib
pip install mock
pip install numpy
pip install pandas
pip install pytest
pip install requests
pip install scipy # TODO broken
pip install statsmodels # TODO broken
pip install seaborn # TODO broken
pip install scikit-learn
pip install shap
# TODO an attempt to reload the path (investigate further)
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" `
+ [System.Environment]::GetEnvironmentVariable("Path","User")
# TODO uncomment and fix the next line
# gem install github-linguist
# TODO - investigate more and integrate: https://github.com/MScholtes/VirtualDesktop
# Install-Module -Name VirtualDesktop
## INSTALL RAW .EXE PACKAGES
# TODO solve updates, automatic config import (probably in C:\Program Files\Pentablet\config, diff the file
# with my saved config), maybe just check for the updates manually or find a link that always has the latest version
if (-not (Test-Path "C:\Program Files\Pentablet")) {
$downloadUrl = "https://www.xp-pen.com/download/file.html?id=2866&pid=51&ext=zip"
$zipPath = "$env:TEMP\xppen_driver.zip"
$extractPath = "$env:TEMP\xppen_driver"
# Create the extract path if it doesn't exist
if (-Not (Test-Path -Path $extractPath)) {
New-Item -ItemType Directory -Path $extractPath | Out-Null
}
# Download the ZIP file
Invoke-WebRequest -Uri $downloadUrl -OutFile $zipPath
# Unzip the file
Expand-Archive -Path $zipPath -DestinationPath $extractPath -Force
# Find the .exe installer (assumes there's only one .exe inside the ZIP)
$exeFile = Get-ChildItem -Path $extractPath -Filter *.exe -Recurse | Select-Object -First 1
# Check if the EXE was found
if ($exeFile) {
Start-Process -FilePath $exeFile.FullName -ArgumentList '/VERYSILENT', '/SUPPRESSMSGBOXES', '/NORESTART', '/SP-' -Wait
} else {
Write-Host "No executable installer found in the extracted files."
}
}
Set-PSDebug -Trace 0