From c6c3f0cd03293aab4d42f030d985a5eb53020070 Mon Sep 17 00:00:00 2001 From: Luke <101687942+shrimp332@users.noreply.github.com> Date: Thu, 22 Feb 2024 12:28:23 +1100 Subject: [PATCH 1/7] changed link to correct project (#1619) --- config/applications.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/applications.json b/config/applications.json index b34961853e..7cd07eb2fe 100755 --- a/config/applications.json +++ b/config/applications.json @@ -1108,7 +1108,7 @@ "choco": "na", "content": "Neofetch", "description": "Neofetch is a command-line utility for displaying system information in a visually appealing way.", - "link": "https://github.com/dylanaraps/neofetch", + "link": "https://github.com/nepnep39/neofetch-win", "winget": "nepnep.neofetch-win" }, "WPFInstallneovim": { From 420f37f205749433292f9157984881d0d3b64ad3 Mon Sep 17 00:00:00 2001 From: ChrisTitusTech Date: Thu, 22 Feb 2024 01:28:48 +0000 Subject: [PATCH 2/7] Compile Winutil --- winutil.ps1 | 2 +- xaml/inputApp.xaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/winutil.ps1 b/winutil.ps1 index 166d481d1e..30d5b78d94 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -6648,7 +6648,7 @@ $sync.configs.applications = '{ "choco": "na", "content": "Neofetch", "description": "Neofetch is a command-line utility for displaying system information in a visually appealing way.", - "link": "https://github.com/dylanaraps/neofetch", + "link": "https://github.com/nepnep39/neofetch-win", "winget": "nepnep.neofetch-win" }, "WPFInstallneovim": { diff --git a/xaml/inputApp.xaml b/xaml/inputApp.xaml index f9c90f16da..fc9c5f1e89 100644 --- a/xaml/inputApp.xaml +++ b/xaml/inputApp.xaml @@ -754,7 +754,7 @@ - + From 4ac5b79fc8f40ba4549105eaadc498fb49fbebf4 Mon Sep 17 00:00:00 2001 From: Ken Hoo <158048821+mrkenhoo@users.noreply.github.com> Date: Thu, 22 Feb 2024 01:32:14 +0000 Subject: [PATCH 3/7] Improve handling of Adobe's CC Cleaner tool (#1635) * Update close-old-issues.yaml * Compile Winutil * Update close-old-issues.yaml * Update close-old-issues.yaml * Update close-old-issues.yaml * Improve handling of Adobe's CC Cleaner tool This PR implements a try-catch-finally struct to do a better handling of Adobe's Creative Cloud Cleaner tool downloading and running of such program. This will allow to see any errors that occurs if the URL changes, the tool fails to run, or anything else. I also have moved the cleaning up process to the finally part of the structure, as it makes the most sense. This tries to fix or sanitize the issue #1563. --------- Co-authored-by: Chris Titus Co-authored-by: ChrisTitusTech Co-authored-by: Chris Titus --- .../Invoke-WPFRunAdobeCCCleanerTool.ps1 | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/functions/public/Invoke-WPFRunAdobeCCCleanerTool.ps1 b/functions/public/Invoke-WPFRunAdobeCCCleanerTool.ps1 index 263abc06ef..84768974c6 100644 --- a/functions/public/Invoke-WPFRunAdobeCCCleanerTool.ps1 +++ b/functions/public/Invoke-WPFRunAdobeCCCleanerTool.ps1 @@ -11,18 +11,22 @@ function Invoke-WPFRunAdobeCCCleanerTool { Write-Host "The Adobe Creative Cloud Cleaner tool is hosted at" Write-Host "$url" - # Don't show the progress because it will slow down the download speed - $ProgressPreference='SilentlyContinue' + try { + # Don't show the progress because it will slow down the download speed + $ProgressPreference='SilentlyContinue' - Invoke-WebRequest -Uri $url -OutFile "$env:TEMP\AdobeCreativeCloudCleanerTool.exe" -UseBasicParsing -ErrorAction SilentlyContinue -Verbose + Invoke-WebRequest -Uri $url -OutFile "$env:TEMP\AdobeCreativeCloudCleanerTool.exe" -UseBasicParsing -ErrorAction SilentlyContinue -Verbose - # Revert back the ProgressPreference variable to the default value since we got the file desired - $ProgressPreference='Continue' + # Revert back the ProgressPreference variable to the default value since we got the file desired + $ProgressPreference='Continue' - Start-Process -FilePath "$env:TEMP\AdobeCreativeCloudCleanerTool.exe" -Wait -ErrorAction SilentlyContinue -Verbose - - if (Test-Path -Path "$env:TEMP\AdobeCreativeCloudCleanerTool.exe") { - Write-Host "Cleaning up..." - Remove-Item -Path "$env:TEMP\AdobeCreativeCloudCleanerTool.exe" -Verbose + Start-Process -FilePath "$env:TEMP\AdobeCreativeCloudCleanerTool.exe" -Wait -ErrorAction SilentlyContinue -Verbose + } catch { + Write-Error $_.Exception.Message + } finally { + if (Test-Path -Path "$env:TEMP\AdobeCreativeCloudCleanerTool.exe") { + Write-Host "Cleaning up..." + Remove-Item -Path "$env:TEMP\AdobeCreativeCloudCleanerTool.exe" -Verbose + } } } From 4de1ac39ef88ac11734ebbb8e56258a80aae77a7 Mon Sep 17 00:00:00 2001 From: ChrisTitusTech Date: Thu, 22 Feb 2024 01:32:49 +0000 Subject: [PATCH 4/7] Compile Winutil --- winutil.ps1 | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/winutil.ps1 b/winutil.ps1 index 30d5b78d94..4fbea76bae 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -3890,19 +3890,23 @@ function Invoke-WPFRunAdobeCCCleanerTool { Write-Host "The Adobe Creative Cloud Cleaner tool is hosted at" Write-Host "$url" - # Don't show the progress because it will slow down the download speed - $ProgressPreference='SilentlyContinue' + try { + # Don't show the progress because it will slow down the download speed + $ProgressPreference='SilentlyContinue' - Invoke-WebRequest -Uri $url -OutFile "$env:TEMP\AdobeCreativeCloudCleanerTool.exe" -UseBasicParsing -ErrorAction SilentlyContinue -Verbose + Invoke-WebRequest -Uri $url -OutFile "$env:TEMP\AdobeCreativeCloudCleanerTool.exe" -UseBasicParsing -ErrorAction SilentlyContinue -Verbose - # Revert back the ProgressPreference variable to the default value since we got the file desired - $ProgressPreference='Continue' + # Revert back the ProgressPreference variable to the default value since we got the file desired + $ProgressPreference='Continue' - Start-Process -FilePath "$env:TEMP\AdobeCreativeCloudCleanerTool.exe" -Wait -ErrorAction SilentlyContinue -Verbose - - if (Test-Path -Path "$env:TEMP\AdobeCreativeCloudCleanerTool.exe") { - Write-Host "Cleaning up..." - Remove-Item -Path "$env:TEMP\AdobeCreativeCloudCleanerTool.exe" -Verbose + Start-Process -FilePath "$env:TEMP\AdobeCreativeCloudCleanerTool.exe" -Wait -ErrorAction SilentlyContinue -Verbose + } catch { + Write-Error $_.Exception.Message + } finally { + if (Test-Path -Path "$env:TEMP\AdobeCreativeCloudCleanerTool.exe") { + Write-Host "Cleaning up..." + Remove-Item -Path "$env:TEMP\AdobeCreativeCloudCleanerTool.exe" -Verbose + } } } function Invoke-WPFRunspace { From 7bfcd7cb25e4ad285932ea20c6c25aa98a59a57b Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Thu, 21 Mar 2024 16:58:40 -0700 Subject: [PATCH 5/7] compile refactor --- Compile.ps1 | 22 +- scripts/main.ps1 | 16 - winutil.ps1 | 2946 +++++++++++++++++++++++++++++++--------------- 3 files changed, 1999 insertions(+), 985 deletions(-) diff --git a/Compile.ps1 b/Compile.ps1 index 4e5cc278aa..68031a443b 100644 --- a/Compile.ps1 +++ b/Compile.ps1 @@ -24,15 +24,14 @@ Get-ChildItem .\functions -Recurse -File | ForEach-Object { Get-Content $psitem.FullName | Out-File ./$scriptname -Append -Encoding ascii } -$xaml = (Get-Content .\xaml\inputXML.xaml).replace("'","''") -Write-output "`$inputXML = '$xaml'" | Out-File ./$scriptname -Append -Encoding ascii - Get-ChildItem .\config | Where-Object {$psitem.extension -eq ".json"} | ForEach-Object { $json = (Get-Content $psitem.FullName).replace("'","''") $sync.configs.$($psitem.BaseName) = $json | convertfrom-json Write-output "`$sync.configs.$($psitem.BaseName) = '$json' `| convertfrom-json" | Out-File ./$scriptname -Append -Encoding ascii } +$xaml = (Get-Content .\xaml\inputXML.xaml).replace("'","''") + # Dot-source the Get-TabXaml function . .\functions\private\Get-TabXaml.ps1 @@ -44,4 +43,21 @@ $tabColumns | Out-File -FilePath ".\xaml\inputTweaks.xaml" -Encoding ascii $tabColumns = Get-TabXaml "feature" $tabColumns | Out-File -FilePath ".\xaml\inputFeatures.xaml" -Encoding ascii +# Assuming inputApp.xaml is in the same directory as main.ps1 +$appXamlPath = Join-Path -Path $PSScriptRoot -ChildPath "xaml/inputApp.xaml" +$tweaksXamlPath = Join-Path -Path $PSScriptRoot -ChildPath "xaml/inputTweaks.xaml" +$featuresXamlPath = Join-Path -Path $PSScriptRoot -ChildPath "xaml/inputFeatures.xaml" + +# Load the XAML content from inputApp.xaml +$appXamlContent = Get-Content -Path $appXamlPath -Raw +$tweaksXamlContent = Get-Content -Path $tweaksXamlPath -Raw +$featuresXamlContent = Get-Content -Path $featuresXamlPath -Raw + +# Replace the placeholder in $inputXML with the content of inputApp.xaml +$xaml = $xaml -replace "{{InstallPanel_applications}}", $appXamlContent +$xaml = $xaml -replace "{{InstallPanel_tweaks}}", $tweaksXamlContent +$xaml = $xaml -replace "{{InstallPanel_features}}", $featuresXamlContent + +Write-output "`$inputXML = '$xaml'" | Out-File ./$scriptname -Append -Encoding ascii + Get-Content .\scripts\main.ps1 | Out-File ./$scriptname -Append -Encoding ascii \ No newline at end of file diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 16151242c4..adaab233a3 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -52,22 +52,6 @@ $sync.runspace.Open() $inputXML = $inputXML -replace 'mc:Ignorable="d"', '' -replace "x:N", 'N' -replace '^ param ( [switch]$Debug, @@ -47,7 +47,7 @@ Add-Type -AssemblyName System.Windows.Forms # Variable to sync between runspaces $sync = [Hashtable]::Synchronized(@{}) $sync.PSScriptRoot = $PSScriptRoot -$sync.version = "24.02.22" +$sync.version = "24.03.21" $sync.configs = @{} $sync.ProcessRunning = $false @@ -4595,953 +4595,6 @@ function Invoke-WPFUpdatessecurity { Write-Host "-- Updates Set to Recommended ---" Write-Host "=================================" } -$inputXML = ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Install - - - - - - - Tweaks - - - - - - - Config - - - - - - - Updates - - - - - - - MicroWin - - - - - - - - - - - - - - - - - - - - Choose Windows SKU - - Choose Windows features you want to remove from the ISO - - - - - - - - - - - + + + + + + Choose Windows SKU + + Choose Windows features you want to remove from the ISO + + + + + + + + + + +