diff --git a/Compile.ps1 b/Compile.ps1 index 4e5cc278..68031a44 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/config/applications.json b/config/applications.json index b3496185..7cd07eb2 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": { diff --git a/functions/public/Invoke-WPFRunAdobeCCCleanerTool.ps1 b/functions/public/Invoke-WPFRunAdobeCCCleanerTool.ps1 index 263abc06..84768974 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 + } } } diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 16151242..adaab233 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 +46,7 @@ Add-Type -AssemblyName System.Windows.Forms # Variable to sync between runspaces $sync = [Hashtable]::Synchronized(@{}) $sync.PSScriptRoot = $PSScriptRoot -$sync.version = "24.03.02" +$sync.version = "24.03.21" $sync.configs = @{} $sync.ProcessRunning = $false @@ -3930,19 +3929,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 { @@ -4631,953 +4634,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 + + + + + + + + + + +