From 2ab8296b71ef9641d555d7416e43fed679e68b5a Mon Sep 17 00:00:00 2001 From: Michael Valdron Date: Fri, 1 Jul 2022 16:58:50 -0400 Subject: [PATCH 01/17] windows script testing added. Signed-off-by: Michael Valdron --- test/windows/Dockerfile | 16 ++++++++++++++++ test/windows/test.ps1 | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 test/windows/Dockerfile create mode 100644 test/windows/test.ps1 diff --git a/test/windows/Dockerfile b/test/windows/Dockerfile new file mode 100644 index 0000000..9c3b37f --- /dev/null +++ b/test/windows/Dockerfile @@ -0,0 +1,16 @@ +FROM mcr.microsoft.com/windows:20H2 + +ARG target +ARG script + +USER root + +COPY ${target} /target + +WORKDIR /target + +RUN powershell.exe -executionpolicy bypass ${script} + +WORKDIR / + +RUN rm -rf /target diff --git a/test/windows/test.ps1 b/test/windows/test.ps1 new file mode 100644 index 0000000..d68e92f --- /dev/null +++ b/test/windows/test.ps1 @@ -0,0 +1,36 @@ +#!/usr/bin/env pwsh + +if (!$args[0]) { + Write-Output 'Please specify script to test.' + exit 1 +} + +$script = Resolve-Path -Path $args[0] +$target_dir = (Get-Item $script).Directory.FullName +$build_path = (Get-Item $MyInvocation.MyCommand.Path).Directory.FullName +$img = ([System.Environment]::UserName + "/" + (Get-Item $build_path).BaseName) +$tag = "testing" + +# Copy target script to pwd +Copy-Item -Recurse $target_dir ($build_path + "/" + (Get-Item $target_dir).BaseName) + +# Test build image with target script +$target_wkdir = (Get-Item $target_dir).BaseName +$target_script = (Get-Item $script).Name +docker build --no-cache --force-rm -t ($img + ":" + $tag) ` +--build-arg target=$target_wkdir ` +--build-arg script=$target_script ` +$build_path + +# Set build status code +$status = $LASTEXITCODE + +# Remove testing image +docker rmi ($img + ":" + $tag) + +# Remove target script from pwd +Remove-Item -Recurse ($build_path + "/" + (Get-Item $target_dir).BaseName) + +# Exit with build status code +exit $status + From 9664dee585a9ef51d32338ff596aa9584de972fb Mon Sep 17 00:00:00 2001 From: Michael Valdron Date: Fri, 1 Jul 2022 16:59:57 -0400 Subject: [PATCH 02/17] windows install packages script file added with testing CI workflow Signed-off-by: Michael Valdron --- .github/workflows/test-installers.yml | 8 ++++++++ installers/win_install_packages.ps1 | 1 + 2 files changed, 9 insertions(+) create mode 100644 installers/win_install_packages.ps1 diff --git a/.github/workflows/test-installers.yml b/.github/workflows/test-installers.yml index 4b7ae64..d1eb6a4 100644 --- a/.github/workflows/test-installers.yml +++ b/.github/workflows/test-installers.yml @@ -72,3 +72,11 @@ jobs: - uses: actions/checkout@v3 - name: Test Manjaro Gaming Install run: sh test/archlinux/test.sh installers/manjaro_gaming_install_packages.sh + + windows: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v3 + - name: Test Windows Install + run: powershell.exe -executionpolicy bypass test/windows/test.ps1 installers/win_install_packages.ps1 diff --git a/installers/win_install_packages.ps1 b/installers/win_install_packages.ps1 new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/installers/win_install_packages.ps1 @@ -0,0 +1 @@ + From 7b1c9fc68c738b412cebaa97f573374bb9e06ccc Mon Sep 17 00:00:00 2001 From: Michael Valdron Date: Fri, 1 Jul 2022 17:20:41 -0400 Subject: [PATCH 03/17] match windows versions Signed-off-by: Michael Valdron --- .github/workflows/test-installers.yml | 2 +- test/windows/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-installers.yml b/.github/workflows/test-installers.yml index d1eb6a4..bc5f06a 100644 --- a/.github/workflows/test-installers.yml +++ b/.github/workflows/test-installers.yml @@ -74,7 +74,7 @@ jobs: run: sh test/archlinux/test.sh installers/manjaro_gaming_install_packages.sh windows: - runs-on: windows-latest + runs-on: windows-2022 steps: - uses: actions/checkout@v3 diff --git a/test/windows/Dockerfile b/test/windows/Dockerfile index 9c3b37f..c0d9ae1 100644 --- a/test/windows/Dockerfile +++ b/test/windows/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/windows:20H2 +FROM mcr.microsoft.com/windows/server:ltsc2022 ARG target ARG script From 77e4551a61cff9f838a11a87bbbd26d854f04304 Mon Sep 17 00:00:00 2001 From: Michael Valdron Date: Fri, 1 Jul 2022 17:32:35 -0400 Subject: [PATCH 04/17] removed 'root' user select for windows testing image build. Signed-off-by: Michael Valdron --- test/windows/Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/windows/Dockerfile b/test/windows/Dockerfile index c0d9ae1..aec6c7b 100644 --- a/test/windows/Dockerfile +++ b/test/windows/Dockerfile @@ -3,8 +3,6 @@ FROM mcr.microsoft.com/windows/server:ltsc2022 ARG target ARG script -USER root - COPY ${target} /target WORKDIR /target From 8c36fc015a4dabca6996d7f2bebdaa8cdfb2753b Mon Sep 17 00:00:00 2001 From: Michael Valdron Date: Fri, 1 Jul 2022 17:50:12 -0400 Subject: [PATCH 05/17] remove /target cmd fixed for windows testing image build. Signed-off-by: Michael Valdron --- test/windows/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/windows/Dockerfile b/test/windows/Dockerfile index aec6c7b..ce05bf9 100644 --- a/test/windows/Dockerfile +++ b/test/windows/Dockerfile @@ -11,4 +11,4 @@ RUN powershell.exe -executionpolicy bypass ${script} WORKDIR / -RUN rm -rf /target +RUN powershell.exe -Command Remove-Item -Recurse /target From abb3e9b276bca2b4fa1ae5035dff5f13b073c9f6 Mon Sep 17 00:00:00 2001 From: Michael Valdron Date: Fri, 1 Jul 2022 20:07:45 -0400 Subject: [PATCH 06/17] Windows setup script file added with setup testing CI Signed-off-by: Michael Valdron --- .github/workflows/test-setups.yml | 8 ++++++++ installers/win_setup.ps1 | 10 ++++++++++ 2 files changed, 18 insertions(+) create mode 100644 installers/win_setup.ps1 diff --git a/.github/workflows/test-setups.yml b/.github/workflows/test-setups.yml index c8a1ce6..0208292 100644 --- a/.github/workflows/test-setups.yml +++ b/.github/workflows/test-setups.yml @@ -47,3 +47,11 @@ jobs: - uses: actions/checkout@v3 - name: Test Debian Bullseye Setup run: sh test/debian/bullseye/test.sh installers/debian_setup.sh + + windows: + runs-on: windows-2022 + + steps: + - uses: actions/checkout@v3 + - name: Test Windows Setup + run: powershell.exe -executionpolicy bypass test/windows/test.ps1 installers/win_setup.ps1 diff --git a/installers/win_setup.ps1 b/installers/win_setup.ps1 new file mode 100644 index 0000000..90c38c6 --- /dev/null +++ b/installers/win_setup.ps1 @@ -0,0 +1,10 @@ +#!/usr/bin/env pwsh + +$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()) +$base_dir = (Get-Item $MyInvocation.MyCommand.Path).Directory.FullName + +if (!$currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { + Write-Output 'Please run as administrator' + exit 1 +} + From a33abd7ed03a0ea9c6248b9d74088595a8c9936d Mon Sep 17 00:00:00 2001 From: Michael Valdron Date: Fri, 1 Jul 2022 21:35:46 -0400 Subject: [PATCH 07/17] Changed Write-Output to Write-Error for error logging under windows powershell scripts Signed-off-by: Michael Valdron --- installers/win_install_packages.ps1 | 12 ++++++++++++ installers/win_setup.ps1 | 3 ++- test/windows/test.ps1 | 3 ++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/installers/win_install_packages.ps1 b/installers/win_install_packages.ps1 index 8b13789..871c1df 100644 --- a/installers/win_install_packages.ps1 +++ b/installers/win_install_packages.ps1 @@ -1 +1,13 @@ +#!/usr/bin/env pwsh + +$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()) +$base_dir = (Get-Item $MyInvocation.MyCommand.Path).Directory.FullName + +# Check if running as an administrator +if (!$currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { + Write-Error 'Please run as administrator' + exit 1 +} + +powershell.exe -executionpolicy bypass ($base_dir + "/win_setup.ps1") diff --git a/installers/win_setup.ps1 b/installers/win_setup.ps1 index 90c38c6..d3cf814 100644 --- a/installers/win_setup.ps1 +++ b/installers/win_setup.ps1 @@ -3,8 +3,9 @@ $currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()) $base_dir = (Get-Item $MyInvocation.MyCommand.Path).Directory.FullName +# Check if running as an administrator if (!$currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { - Write-Output 'Please run as administrator' + Write-Error 'Please run as administrator' exit 1 } diff --git a/test/windows/test.ps1 b/test/windows/test.ps1 index d68e92f..f976201 100644 --- a/test/windows/test.ps1 +++ b/test/windows/test.ps1 @@ -1,7 +1,8 @@ #!/usr/bin/env pwsh +# Check if script to test if specified if (!$args[0]) { - Write-Output 'Please specify script to test.' + Write-Error 'Please specify script to test.' exit 1 } From 6eb35119d3fb5a5b171c5cd78515cd84afe2c039 Mon Sep 17 00:00:00 2001 From: Michael Valdron Date: Fri, 1 Jul 2022 21:36:36 -0400 Subject: [PATCH 08/17] Setup script source added. Signed-off-by: Michael Valdron --- installers/win_setup.ps1 | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/installers/win_setup.ps1 b/installers/win_setup.ps1 index d3cf814..b8f23b3 100644 --- a/installers/win_setup.ps1 +++ b/installers/win_setup.ps1 @@ -9,3 +9,38 @@ if (!$currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Adminis exit 1 } +# Check if winget is installed +try { + # Install git if winget is installed + winget install git +} +catch { + # If not, install winget then git + Write-Output 'winget is not installed, attempting install..' + $winget_version = (Invoke-WebRequest "https://api.github.com/repos/microsoft/winget-cli/releases/latest" | ConvertFrom-Json)[0].tag_name + $winget_package = "$base_dir/winget.msixbundle" + Invoke-WebRequest -Uri "https://github.com/microsoft/winget-cli/releases/download/$winget_version/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" ` + -OutFile $winget_package + Add-AppxPackage -Path $winget_package -Confirm + + try { + winget install git + } + catch { + Write-Error 'winget did not install correctly' + exit 2 + } +} + +# Using git, download and install the Windows 10 Debloater scripts to debloat Windows +try { + $windebloater_root = "$base_dir/windows10debloater" + git clone "https://github.com/Sycnex/Windows10Debloater.git" $windebloater_root + Set-ExecutionPolicy Unrestricted -Force + "$windebloater_root\Windows10SysPrepDebloater.ps1 -SysPrep -Debloat -Privacy" + exit $LASTEXITCODE +} +catch { + Write-Error 'git did not install correctly' + exit 3 +} From c105b654d34f5e6521527b5654ceb8ac3eac2519 Mon Sep 17 00:00:00 2001 From: Michael Valdron Date: Fri, 1 Jul 2022 23:14:59 -0400 Subject: [PATCH 09/17] using temp directory instead of base file directory Signed-off-by: Michael Valdron --- installers/win_setup.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/installers/win_setup.ps1 b/installers/win_setup.ps1 index b8f23b3..f13f712 100644 --- a/installers/win_setup.ps1 +++ b/installers/win_setup.ps1 @@ -1,7 +1,7 @@ #!/usr/bin/env pwsh +# Variables $currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()) -$base_dir = (Get-Item $MyInvocation.MyCommand.Path).Directory.FullName # Check if running as an administrator if (!$currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { @@ -18,7 +18,7 @@ catch { # If not, install winget then git Write-Output 'winget is not installed, attempting install..' $winget_version = (Invoke-WebRequest "https://api.github.com/repos/microsoft/winget-cli/releases/latest" | ConvertFrom-Json)[0].tag_name - $winget_package = "$base_dir/winget.msixbundle" + $winget_package = "${env:TEMP}/winget.msixbundle" Invoke-WebRequest -Uri "https://github.com/microsoft/winget-cli/releases/download/$winget_version/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" ` -OutFile $winget_package Add-AppxPackage -Path $winget_package -Confirm @@ -34,7 +34,7 @@ catch { # Using git, download and install the Windows 10 Debloater scripts to debloat Windows try { - $windebloater_root = "$base_dir/windows10debloater" + $windebloater_root = "${env:TEMP}/windows10debloater" git clone "https://github.com/Sycnex/Windows10Debloater.git" $windebloater_root Set-ExecutionPolicy Unrestricted -Force "$windebloater_root\Windows10SysPrepDebloater.ps1 -SysPrep -Debloat -Privacy" From 6f335d8a8cb3d34ce3b40ad13dfb82d7f652d0c6 Mon Sep 17 00:00:00 2001 From: Michael Valdron Date: Fri, 1 Jul 2022 23:15:45 -0400 Subject: [PATCH 10/17] Windows surfshark app installer script added. Signed-off-by: Michael Valdron --- installers/packages/surfshark/win_install.ps1 | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 installers/packages/surfshark/win_install.ps1 diff --git a/installers/packages/surfshark/win_install.ps1 b/installers/packages/surfshark/win_install.ps1 new file mode 100644 index 0000000..0ed5eb6 --- /dev/null +++ b/installers/packages/surfshark/win_install.ps1 @@ -0,0 +1,20 @@ +#!/usr/bin/env pwsh + +# Variables +$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()) +$exe_path = "${env:TEMP}/surfshark.exe" + +# Check if running as an administrator +if (!$currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { + Write-Error 'Please run as administrator' + exit 1 +} + +# Download Surfshark +Invoke-WebRequest -Uri "https://downloads.surfshark.com/windows/latest/SurfsharkSetup.exe" ` + -OutFile $exe_path + +# Install Surfshark +$exe_path + +exit $LASTEXITCODE From fc215393879dc112271e9deb1c698e8125d44913 Mon Sep 17 00:00:00 2001 From: Michael Valdron Date: Fri, 1 Jul 2022 23:16:11 -0400 Subject: [PATCH 11/17] Windows xournalpp app installer script added. Signed-off-by: Michael Valdron --- installers/packages/xournalpp/win_install.ps1 | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 installers/packages/xournalpp/win_install.ps1 diff --git a/installers/packages/xournalpp/win_install.ps1 b/installers/packages/xournalpp/win_install.ps1 new file mode 100644 index 0000000..528c42f --- /dev/null +++ b/installers/packages/xournalpp/win_install.ps1 @@ -0,0 +1,26 @@ +#!/usr/bin/env pwsh + +# Variables +$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()) +$tag = (Invoke-WebRequest "https://api.github.com/repos/xournalpp/xournalpp/releases/latest" | ConvertFrom-Json)[0].tag_name +$version = $version.substring(1) +$unzip_path = "${env:TEMP}/xournalpp" +$zip_path = "$unzip_path.zip" + +# Check if running as an administrator +if (!$currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { + Write-Error 'Please run as administrator' + exit 1 +} + +# Download Xournalpp +Invoke-WebRequest -Uri "https://github.com/xournalpp/xournalpp/releases/download/$tag/xournalpp-$version-windows.zip" ` + -OutFile $zip_path + +# Extract Installer +Expand-Archive $zip_path -DestinationPath $unzip_path + +# Install Xournalpp +"$unzip_path/xournalpp-$version-windows.exe" + +exit $LASTEXITCODE From 4172d29695fa7f14eec5532d881b845827acb111 Mon Sep 17 00:00:00 2001 From: Michael Valdron Date: Fri, 1 Jul 2022 23:16:44 -0400 Subject: [PATCH 12/17] Windows installer script source added. Signed-off-by: Michael Valdron --- installers/win_install_packages.ps1 | 43 ++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/installers/win_install_packages.ps1 b/installers/win_install_packages.ps1 index 871c1df..1afd666 100644 --- a/installers/win_install_packages.ps1 +++ b/installers/win_install_packages.ps1 @@ -1,5 +1,6 @@ #!/usr/bin/env pwsh +# Variables $currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()) $base_dir = (Get-Item $MyInvocation.MyCommand.Path).Directory.FullName @@ -9,5 +10,45 @@ if (!$currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Adminis exit 1 } -powershell.exe -executionpolicy bypass ($base_dir + "/win_setup.ps1") +# Run base setup +powershell.exe -executionpolicy bypass "$base_dir/win_setup.ps1" +if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE +} + +# Update packages +winget upgrade -h --all + +# Install packages +winget install -h 7zip.7zip Waterfox.Waterfox Microsoft.VisualStudioCode Microsoft.VisualStudio.2022.Community ` + Microsoft.WindowsTerminal WinSCP.WinSCP GIMP.GIMP Adobe.Acrobat.Reader.64-bit TheDocumentFoundation.LibreOffice.LTS ` + KDE.Kdenlive OBSProject.OBSStudio calibre.calibre KeePassXCTeam.KeePassXC VideoLAN.VLC DelugeTeam.Deluge Cyanfish.NAPS2 ` + HandBrake.HandBrake Telegram.TelegramDesktop GuinpinSoft.MakeMKV SlackTechnologies.Slack Postman.Postman Microsoft.Skype ` + AnyDeskSoftwareGmbH.AnyDesk Foundry376.Mailspring Zotero.Zotero Balena.Etcher Duplicati.Duplicati OpenVPNTechnologies.OpenVPN +if ($LASTEXITCODE -ne 0) { + Write-Error 'Failed to install winget packages.' + exit $LASTEXITCODE +} + +# Install WSL +wsl --install -d openSUSE-42 +if ($LASTEXITCODE -ne 0) { + Write-Error 'Failed to install WSL.' + exit $LASTEXITCODE +} + +# Install Xournalpp +powershell.exe -executionpolicy bypass "$base_dir/packages/xournalpp/win_install.ps1" +if ($LASTEXITCODE -ne 0) { + Write-Error 'Xournalpp failed to install.' + exit $LASTEXITCODE +} + +# Install Surfshark +powershell.exe -executionpolicy bypass "$base_dir/packages/surfshark/win_install.ps1" +if ($LASTEXITCODE -ne 0) { + Write-Error 'Surfshark failed to install.' + exit $LASTEXITCODE +} +# TODO: Add WSL install packages script. From 6f0d24254f489fbc1c32b4b48300b4f7f80d64a4 Mon Sep 17 00:00:00 2001 From: Michael Valdron Date: Sat, 2 Jul 2022 00:04:02 -0400 Subject: [PATCH 13/17] Gpg4win package added to Windows installer script. Signed-off-by: Michael Valdron --- installers/win_install_packages.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/installers/win_install_packages.ps1 b/installers/win_install_packages.ps1 index 1afd666..844fa74 100644 --- a/installers/win_install_packages.ps1 +++ b/installers/win_install_packages.ps1 @@ -24,7 +24,8 @@ winget install -h 7zip.7zip Waterfox.Waterfox Microsoft.VisualStudioCode Microso Microsoft.WindowsTerminal WinSCP.WinSCP GIMP.GIMP Adobe.Acrobat.Reader.64-bit TheDocumentFoundation.LibreOffice.LTS ` KDE.Kdenlive OBSProject.OBSStudio calibre.calibre KeePassXCTeam.KeePassXC VideoLAN.VLC DelugeTeam.Deluge Cyanfish.NAPS2 ` HandBrake.HandBrake Telegram.TelegramDesktop GuinpinSoft.MakeMKV SlackTechnologies.Slack Postman.Postman Microsoft.Skype ` - AnyDeskSoftwareGmbH.AnyDesk Foundry376.Mailspring Zotero.Zotero Balena.Etcher Duplicati.Duplicati OpenVPNTechnologies.OpenVPN + AnyDeskSoftwareGmbH.AnyDesk Foundry376.Mailspring Zotero.Zotero Balena.Etcher Duplicati.Duplicati OpenVPNTechnologies.OpenVPN ` + GnuPG.Gpg4win if ($LASTEXITCODE -ne 0) { Write-Error 'Failed to install winget packages.' exit $LASTEXITCODE From 1a68305a410e6f4d8e550676d0d3df51256f81c2 Mon Sep 17 00:00:00 2001 From: Michael Valdron Date: Sat, 2 Jul 2022 00:04:40 -0400 Subject: [PATCH 14/17] Well of Souls Windows install script added. Signed-off-by: Michael Valdron --- installers/packages/wos/win_install.ps1 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 installers/packages/wos/win_install.ps1 diff --git a/installers/packages/wos/win_install.ps1 b/installers/packages/wos/win_install.ps1 new file mode 100644 index 0000000..c06b7a3 --- /dev/null +++ b/installers/packages/wos/win_install.ps1 @@ -0,0 +1,20 @@ +#!/usr/bin/env pwsh + +# Variables +$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()) +$exe_path = "${env:TEMP}/wos.exe" + +# Check if running as an administrator +if (!$currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { + Write-Error 'Please run as administrator' + exit 1 +} + +# Download Well Of Souls +Invoke-WebRequest -Uri "http://www.synthetic-reality.us/WellOfSouls.exe" ` + -OutFile $exe_path + +# Install Well Of Souls +$exe_path + +exit $LASTEXITCODE From c412d11d49a5f39f9730e29fc5d9984d19f15c5e Mon Sep 17 00:00:00 2001 From: Michael Valdron Date: Sat, 2 Jul 2022 00:05:03 -0400 Subject: [PATCH 15/17] GameRanger Windows install script added. Signed-off-by: Michael Valdron --- .../packages/gameranger/win_install.ps1 | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 installers/packages/gameranger/win_install.ps1 diff --git a/installers/packages/gameranger/win_install.ps1 b/installers/packages/gameranger/win_install.ps1 new file mode 100644 index 0000000..9f3817c --- /dev/null +++ b/installers/packages/gameranger/win_install.ps1 @@ -0,0 +1,20 @@ +#!/usr/bin/env pwsh + +# Variables +$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()) +$exe_path = "${env:TEMP}/gameranger.exe" + +# Check if running as an administrator +if (!$currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { + Write-Error 'Please run as administrator' + exit 1 +} + +# Download GameRanger +Invoke-WebRequest -Uri "http://www.gameranger.com/download/GameRangerSetup.exe" ` + -OutFile $exe_path + +# Install GameRanger +$exe_path + +exit $LASTEXITCODE From b766514b3fbacee3a5bb5e41391d35041e0b66e6 Mon Sep 17 00:00:00 2001 From: Michael Valdron Date: Sat, 2 Jul 2022 00:06:02 -0400 Subject: [PATCH 16/17] Windows gaming installer script added with testing CI workflow. Signed-off-by: Michael Valdron --- .github/workflows/test-installers.yml | 8 ++++ installers/wingaming_install_packages.ps1 | 50 +++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 installers/wingaming_install_packages.ps1 diff --git a/.github/workflows/test-installers.yml b/.github/workflows/test-installers.yml index bc5f06a..ae5ad71 100644 --- a/.github/workflows/test-installers.yml +++ b/.github/workflows/test-installers.yml @@ -80,3 +80,11 @@ jobs: - uses: actions/checkout@v3 - name: Test Windows Install run: powershell.exe -executionpolicy bypass test/windows/test.ps1 installers/win_install_packages.ps1 + + windowsgaming: + runs-on: windows-2022 + + steps: + - uses: actions/checkout@v3 + - name: Test Windows Gaming Install + run: powershell.exe -executionpolicy bypass test/windows/test.ps1 installers/wingaming_install_packages.ps1 diff --git a/installers/wingaming_install_packages.ps1 b/installers/wingaming_install_packages.ps1 new file mode 100644 index 0000000..cbf0e4a --- /dev/null +++ b/installers/wingaming_install_packages.ps1 @@ -0,0 +1,50 @@ +#!/usr/bin/env pwsh + +# Variables +$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()) +$base_dir = (Get-Item $MyInvocation.MyCommand.Path).Directory.FullName + +# Check if running as an administrator +if (!$currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { + Write-Error 'Please run as administrator' + exit 1 +} + +# Run base setup +powershell.exe -executionpolicy bypass "$base_dir/win_setup.ps1" +if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE +} + +# Update packages +winget upgrade -h --all + +# Install packages +winget install -h Waterfox.Waterfox Microsoft.WindowsTerminal OBSProject.OBSStudio ` + Discord.Discord Valve.Steam ElectronicArts.EADesktop DolphinEmulator.Dolphin ` + Mupen64.Mupen64 DOSBox.DOSBox Duplicati.Duplicati +if ($LASTEXITCODE -ne 0) { + Write-Error 'Failed to install winget packages.' + exit $LASTEXITCODE +} + +# Install Surfshark +powershell.exe -executionpolicy bypass "$base_dir/packages/surfshark/win_install.ps1" +if ($LASTEXITCODE -ne 0) { + Write-Error 'Surfshark failed to install.' + exit $LASTEXITCODE +} + +# Install GameRanger +powershell.exe -executionpolicy bypass "$base_dir/packages/gameranger/win_install.ps1" +if ($LASTEXITCODE -ne 0) { + Write-Error 'GameRanger failed to install.' + exit $LASTEXITCODE +} + +# Install Well Of Souls +powershell.exe -executionpolicy bypass "$base_dir/packages/wos/win_install.ps1" +if ($LASTEXITCODE -ne 0) { + Write-Error 'Well Of Souls failed to install.' + exit $LASTEXITCODE +} From 7d21f3be0c986d3a4c4a0937547498123299ac7b Mon Sep 17 00:00:00 2001 From: Michael Valdron Date: Thu, 21 Jul 2022 19:55:16 -0400 Subject: [PATCH 17/17] winget cmds fixed with --source flag Signed-off-by: Michael Valdron --- installers/win_install_packages.ps1 | 2 +- installers/win_setup.ps1 | 4 ++-- installers/wingaming_install_packages.ps1 | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/installers/win_install_packages.ps1 b/installers/win_install_packages.ps1 index 844fa74..a1c258d 100644 --- a/installers/win_install_packages.ps1 +++ b/installers/win_install_packages.ps1 @@ -25,7 +25,7 @@ winget install -h 7zip.7zip Waterfox.Waterfox Microsoft.VisualStudioCode Microso KDE.Kdenlive OBSProject.OBSStudio calibre.calibre KeePassXCTeam.KeePassXC VideoLAN.VLC DelugeTeam.Deluge Cyanfish.NAPS2 ` HandBrake.HandBrake Telegram.TelegramDesktop GuinpinSoft.MakeMKV SlackTechnologies.Slack Postman.Postman Microsoft.Skype ` AnyDeskSoftwareGmbH.AnyDesk Foundry376.Mailspring Zotero.Zotero Balena.Etcher Duplicati.Duplicati OpenVPNTechnologies.OpenVPN ` - GnuPG.Gpg4win + GnuPG.Gpg4win --source winget if ($LASTEXITCODE -ne 0) { Write-Error 'Failed to install winget packages.' exit $LASTEXITCODE diff --git a/installers/win_setup.ps1 b/installers/win_setup.ps1 index f13f712..be40940 100644 --- a/installers/win_setup.ps1 +++ b/installers/win_setup.ps1 @@ -12,7 +12,7 @@ if (!$currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Adminis # Check if winget is installed try { # Install git if winget is installed - winget install git + winget install Git.Git --source winget } catch { # If not, install winget then git @@ -24,7 +24,7 @@ catch { Add-AppxPackage -Path $winget_package -Confirm try { - winget install git + winget install Git.Git --source } catch { Write-Error 'winget did not install correctly' diff --git a/installers/wingaming_install_packages.ps1 b/installers/wingaming_install_packages.ps1 index cbf0e4a..926c3d9 100644 --- a/installers/wingaming_install_packages.ps1 +++ b/installers/wingaming_install_packages.ps1 @@ -22,7 +22,7 @@ winget upgrade -h --all # Install packages winget install -h Waterfox.Waterfox Microsoft.WindowsTerminal OBSProject.OBSStudio ` Discord.Discord Valve.Steam ElectronicArts.EADesktop DolphinEmulator.Dolphin ` - Mupen64.Mupen64 DOSBox.DOSBox Duplicati.Duplicati + Mupen64.Mupen64 DOSBox.DOSBox Duplicati.Duplicati --source winget if ($LASTEXITCODE -ne 0) { Write-Error 'Failed to install winget packages.' exit $LASTEXITCODE