From 854919e696f9830b6e840942c74a9c58a7ba7908 Mon Sep 17 00:00:00 2001 From: Dan Koller <57103678+dan-koller@users.noreply.github.com> Date: Wed, 13 Mar 2024 09:29:07 +0100 Subject: [PATCH] Added powershell script and updated batch & README --- README.md | 14 +++++++++++- install.bat | 23 ++++++++++++++------ install.ps1 | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+), 8 deletions(-) create mode 100644 install.ps1 diff --git a/README.md b/README.md index 436b4d1..75cb7cb 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,21 @@ Installation script for my personal apps on a windows system. Feel free to use a ### How to run +> Note: I recommend to run the powershell script. However, you can also run the `install.bat` file if you prefer. + - Open a terminal with administrator privileges -- Navigate to `install.bat` file location +- Navigate to `install.ps1` file location + + ```powershell + cd winget-install + ``` + - Run the file + + ```powershell + powershell -ExecutionPolicy Bypass -File .\install.ps1 + ``` + - Wait\* :) _\*You may need to accept some UAC pop-ups on individual installation processes._ diff --git a/install.bat b/install.bat index 2e578fc..fee25bd 100644 --- a/install.bat +++ b/install.bat @@ -1,5 +1,6 @@ :: Automatic installation for my personal apps on Windows systems :: Created by Dan Koller 2021 +@echo off echo "Installing essential software..." :: Install basic programs @@ -11,20 +12,17 @@ echo "...done!" echo "Installing utilities..." :: Install utility programs -winget install -e --id smartmontools.smartmontools winget install -e --id Microsoft.PowerToys +winget install -e --id smartmontools.smartmontools echo "...done!" echo "Installing development tools..." :: Install development programs -winget install -e --id Microsoft.OpenJDK.17 -winget install -e --id OpenJS.NodeJS.LTS winget install -e --id Python.Python.3 -winget install -e --id Microsoft.VisualStudio.2022.Community +winget install -e --id OpenJS.NodeJS.LTS +winget install -e --id Microsoft.OpenJDK.17 winget install -e --id Microsoft.VisualStudioCode -winget install -e --id Microsoft.SQLServer.2019.Developer -winget install -e --id Microsoft.SQLServerManagementStudio -winget install -e --id JetBrains.PyCharm.Community +winget install -e --id Microsoft.VisualStudio.2022.Community winget install -e --id Git.Git echo "...done!" @@ -32,6 +30,7 @@ echo "Installing security software..." :: Install security programs winget install -e --id Maltego.Maltego winget install -e --id WiresharkFoundation.Wireshark +winget install -e --id PortSwigger.BurpSuite.Community echo "...done!" echo "Installing WSL2..." @@ -39,6 +38,16 @@ echo "Installing WSL2..." wsl --install echo "...done!" +echo "Installing database software..." +:: Install database programs (may be error prone) +winget install -e --id Microsoft.SQLServer.2022.Developer +winget install -e --id Microsoft.SQLServerManagementStudio +if %ERRORLEVEL% NEQ 0 ( + echo Error: Could not install SQL Server. Please install manually. + echo SQL Server can be downloaded from https://www.microsoft.com/en-us/sql-server/sql-server-downloads +) +echo "...done!" + echo "Configuring additional settings..." :: Copy settings xcopy .gitconfig %userprofile%\ diff --git a/install.ps1 b/install.ps1 new file mode 100644 index 0000000..2387186 --- /dev/null +++ b/install.ps1 @@ -0,0 +1,62 @@ +# Automatic installation for my personal apps on Windows systems +# Created by Dan Koller 2024 + +Write-Host "Installing essential software..." +# Install basic programs +winget install -e --id Google.Chrome +winget install -e --id Google.Drive +winget install -e --id Brave.Brave +winget install -e --id Discord.Discord +Write-Host "...done!" + +Write-Host "Installing utilities..." +# Install utility programs +winget install -e --id 7zip.7zip +winget install -e --id Microsoft.PowerToys +winget install -e --id smartmontools.smartmontools +Write-Host "...done!" + +Write-Host "Installing development tools..." +# Install development programs +winget install -e --id Git.Git +winget install -e --id Python.Python.3 +winget install -e --id OpenJS.NodeJS.LTS +winget install -e --id Microsoft.OpenJDK.17 +winget install -e --id Microsoft.VisualStudioCode +winget install -e --id Microsoft.VisualStudio.2022.Community +Write-Host "...done!" + +Write-Host "Installing security software..." +# Install security programs +winget install -e --id Maltego.Maltego +winget install -e --id WiresharkFoundation.Wireshark +winget install -e --id PortSwigger.BurpSuite.Community +Write-Host "...done!" + +Write-Host "Installing WSL2..." +# Install WSL2 +wsl --install +Write-Host "...done!" + +Write-Host "Installing database software..." +# Install database programs (may be error prone) +winget install -e --id Microsoft.SQLServer.2022.Developer +winget install -e --id Microsoft.SQLServerManagementStudio +if ($?) { + Write-Host "...done!" +} else { + Write-Host "Error: Could not install SQL Server. Please install manually." -ForegroundColor Red + Write-Host "SQL Server can be downloaded from https://www.microsoft.com/en-us/sql-server/sql-server-downloads" +} + +Write-Host "Configuring additional settings..." +# Copy settings +Copy-Item -Path .gitconfig -Destination $env:USERPROFILE -Force + +# Reminders +Write-Host "Please configure your git user and email:" +Write-Host "git config --global user.name ''" +Write-Host "git config --global user.email ''" + +# Finish +Write-Host "Installation finished. Please restart your system now."