diff --git a/Compile.ps1 b/Compile.ps1
index 1bb5b03f..68031a44 100644
--- a/Compile.ps1
+++ b/Compile.ps1
@@ -1,6 +1,9 @@
$OFS = "`r`n"
$scriptname = "winutil.ps1"
-
+# Variable to sync between runspaces
+$sync = [Hashtable]::Synchronized(@{})
+$sync.PSScriptRoot = $PSScriptRoot
+$sync.configs = @{}
if (Test-Path -Path "$($scriptname)")
{
@@ -21,15 +24,40 @@ Get-ChildItem .\functions -Recurse -File | ForEach-Object {
Get-Content $psitem.FullName | Out-File ./$scriptname -Append -Encoding ascii
}
-Get-ChildItem .\xaml | ForEach-Object {
- $xaml = (Get-Content $psitem.FullName).replace("'","''")
- Write-output "`$$($psitem.BaseName) = '$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
}
-Get-Content .\scripts\main.ps1 | Out-File ./$scriptname -Append -Encoding ascii
+$xaml = (Get-Content .\xaml\inputXML.xaml).replace("'","''")
+
+# Dot-source the Get-TabXaml function
+. .\functions\private\Get-TabXaml.ps1
+
+## Xaml Manipulation
+$tabColumns = Get-TabXaml "applications" 5
+$tabColumns | Out-File -FilePath ".\xaml\inputApp.xaml" -Encoding ascii
+$tabColumns = Get-TabXaml "tweaks"
+$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/private/Get-TabXaml.ps1 b/functions/private/Get-TabXaml.ps1
new file mode 100644
index 00000000..a420e344
--- /dev/null
+++ b/functions/private/Get-TabXaml.ps1
@@ -0,0 +1,125 @@
+function Get-TabXaml {
+ <#
+ .SYNOPSIS
+ Generates XAML for a tab in the WinUtil GUI
+ This function is used to generate the XAML for the applications tab in the WinUtil GUI
+ It takes the tabname and the number of columns to display the applications in as input and returns the XAML for the tab as output
+ .PARAMETER tabname
+ The name of the tab to generate XAML for
+ .PARAMETER columncount
+ The number of columns to display the applications in
+ .OUTPUTS
+ The XAML for the tab
+ .EXAMPLE
+ Get-TabXaml "applications" 3
+ #>
+
+
+ param( [Parameter(Mandatory=$true)]
+ $tabname,
+ $columncount = 0
+ )
+ $organizedData = @{}
+ # Iterate through JSON data and organize by panel and category
+ foreach ($appName in $sync.configs.$tabname.PSObject.Properties.Name) {
+ $appInfo = $sync.configs.$tabname.$appName
+
+ # Create an object for the application
+ $appObject = [PSCustomObject]@{
+ Name = $appName
+ Category = $appInfo.Category
+ Content = $appInfo.Content
+ Choco = $appInfo.choco
+ Winget = $appInfo.winget
+ Panel = if ($columncount -gt 0 ) { "0" } else {$appInfo.panel}
+ Link = $appInfo.link
+ Description = $appInfo.description
+ # Type is (Checkbox,Toggle,Button,Combobox ) (Default is Checkbox)
+ Type = $appInfo.type
+ ComboItems = $appInfo.ComboItems
+ # Checked is the property to set startup checked status of checkbox (Default is false)
+ Checked = $appInfo.Checked
+ }
+
+ if (-not $organizedData.ContainsKey($appObject.panel)) {
+ $organizedData[$appObject.panel] = @{}
+ }
+
+ if (-not $organizedData[$appObject.panel].ContainsKey($appObject.Category)) {
+ $organizedData[$appObject.panel][$appObject.Category] = @{}
+ }
+
+ # Store application data in a sub-array under the category
+ # Add Order property to keep the original order of tweaks and features
+ $organizedData[$appObject.panel][$appInfo.Category]["$($appInfo.order)$appName"] = $appObject
+ }
+ $panelcount=0
+ $paneltotal = $organizedData.Keys.Count
+ if ($columncount -gt 0) {
+ $appcount = $sync.configs.$tabname.PSObject.Properties.Name.count + $organizedData["0"].Keys.count
+ $maxcount = [Math]::Round( $appcount / $columncount + 0.5)
+ $paneltotal = $columncount
+ }
+ # add ColumnDefinitions to evenly draw colums
+ $blockXml="`n"+("`n"*($paneltotal))+"`n"
+ # Iterate through organizedData by panel, category, and application
+ $count = 0
+ foreach ($panel in ($organizedData.Keys | Sort-Object)) {
+ $blockXml += "`n`n"
+ $panelcount++
+ foreach ($category in ($organizedData[$panel].Keys | Sort-Object)) {
+ $count++
+ if ($columncount -gt 0) {
+ $panelcount2 = [Int](($count)/$maxcount-0.5)
+ if ($panelcount -eq $panelcount2 ) {
+ $blockXml +="`n`n`n"
+ $blockXml += "`n`n"
+ $panelcount++
+ }
+ }
+ $blockXml += "`n"
+ $sortedApps = $organizedData[$panel][$category].Keys | Sort-Object
+ foreach ($appName in $sortedApps) {
+ $count++
+ if ($columncount -gt 0) {
+ $panelcount2 = [Int](($count)/$maxcount-0.5)
+ if ($panelcount -eq $panelcount2 ) {
+ $blockXml +="`n`n`n"
+ $blockXml += "`n`n"
+ $panelcount++
+ }
+ }
+ $appInfo = $organizedData[$panel][$category][$appName]
+ if ("Toggle" -eq $appInfo.Type) {
+ $blockXml += "`n`n"
+ $blockXml += "`n`n"
+ } elseif ("Combobox" -eq $appInfo.Type) {
+ $blockXml += "`n"
+ # If it is a digit, type is button and button length is digits
+ } elseif ($appInfo.Type -match "^[\d\.]+$") {
+ $blockXml += "`n"
+ # else it is a checkbox
+ } else {
+ $checkedStatus = If ($null -eq $appInfo.Checked) {""} Else {"IsChecked=`"$($appInfo.Checked)`" "}
+ if ($null -eq $appInfo.Link)
+ {
+ $blockXml += "`n"
+ }
+ else
+ {
+ $blockXml += "`n`n`n"
+ }
+ }
+ }
+ }
+ $blockXml +="`n`n`n"
+ }
+ return ($blockXml)
+}
diff --git a/functions/public/Invoke-WPFButton.ps1 b/functions/public/Invoke-WPFButton.ps1
index 3bd0428f..7fa8638a 100644
--- a/functions/public/Invoke-WPFButton.ps1
+++ b/functions/public/Invoke-WPFButton.ps1
@@ -47,7 +47,7 @@ function Invoke-WPFButton {
"WPFFixesNetwork" {Invoke-WPFFixesNetwork}
"WPFUpdatesdisable" {Invoke-WPFUpdatesdisable}
"WPFUpdatessecurity" {Invoke-WPFUpdatessecurity}
- "WPFWinUtilShortcut" {Invoke-WPFShortcut -ShortcutToAdd "WinUtil"}
+ "WPFWinUtilShortcut" {Invoke-WPFShortcut -ShortcutToAdd "WinUtil" -RunAsAdmin $true}
"WPFGetInstalled" {Invoke-WPFGetInstalled -CheckBox "winget"}
"WPFGetInstalledTweaks" {Invoke-WPFGetInstalled -CheckBox "tweaks"}
"WPFGetIso" {Invoke-WPFGetIso}
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/functions/public/Invoke-WPFShortcut.ps1 b/functions/public/Invoke-WPFShortcut.ps1
index f195ca9a..4eab2dc6 100644
--- a/functions/public/Invoke-WPFShortcut.ps1
+++ b/functions/public/Invoke-WPFShortcut.ps1
@@ -8,8 +8,14 @@ function Invoke-WPFShortcut {
.PARAMETER ShortcutToAdd
The name of the shortcut to add
+ .PARAMETER RunAsAdmin
+ A boolean value to make 'Run as administrator' property on (true) or off (false), defaults to off
+
#>
- param($ShortcutToAdd)
+ param(
+ $ShortcutToAdd,
+ [bool]$RunAsAdmin = $false
+ )
$iconPath = $null
Switch ($ShortcutToAdd) {
@@ -42,5 +48,12 @@ function Invoke-WPFShortcut {
}
$Shortcut.Save()
- Write-Host "Shortcut for $ShortcutToAdd has been saved to $($FileBrowser.FileName)"
+ if ($RunAsAdmin -eq $true) {
+ $bytes = [System.IO.File]::ReadAllBytes($FileBrowser.FileName)
+ # Set byte value at position 0x15 in hex, or 21 in decimal, from the value 0x00 to 0x20 in hex
+ $bytes[0x15] = $bytes[0x15] -bor 0x20
+ [System.IO.File]::WriteAllBytes($FileBrowser.FileName, $bytes)
+ }
+
+ Write-Host "Shortcut for $ShortcutToAdd has been saved to $($FileBrowser.FileName) with 'Run as administrator' set to $RunAsAdmin"
}
\ No newline at end of file
diff --git a/scripts/main.ps1 b/scripts/main.ps1
index 7549acaf..adaab233 100644
--- a/scripts/main.ps1
+++ b/scripts/main.ps1
@@ -52,123 +52,6 @@ $sync.runspace.Open()
$inputXML = $inputXML -replace 'mc:Ignorable="d"', '' -replace "x:N", 'N' -replace '^`n"+("`n"*($paneltotal))+"`n"
- # Iterate through organizedData by panel, category, and application
- $count = 0
- foreach ($panel in ($organizedData.Keys | Sort-Object)) {
- $blockXml += "`n`n"
- $panelcount++
- foreach ($category in ($organizedData[$panel].Keys | Sort-Object)) {
- $count++
- if ($columncount -gt 0) {
- $panelcount2 = [Int](($count)/$maxcount-0.5)
- if ($panelcount -eq $panelcount2 ) {
- $blockXml +="`n`n`n"
- $blockXml += "`n`n"
- $panelcount++
- }
- }
- $blockXml += "`n"
- $sortedApps = $organizedData[$panel][$category].Keys | Sort-Object
- foreach ($appName in $sortedApps) {
- $count++
- if ($columncount -gt 0) {
- $panelcount2 = [Int](($count)/$maxcount-0.5)
- if ($panelcount -eq $panelcount2 ) {
- $blockXml +="`n`n`n"
- $blockXml += "`n`n"
- $panelcount++
- }
- }
- $appInfo = $organizedData[$panel][$category][$appName]
- if ("Toggle" -eq $appInfo.Type) {
- $blockXml += "`n`n"
- $blockXml += "`n`n"
- } elseif ("Combobox" -eq $appInfo.Type) {
- $blockXml += "`n"
- # If it is a digit, type is button and button length is digits
- } elseif ($appInfo.Type -match "^[\d\.]+$") {
- $blockXml += "`n"
- # else it is a checkbox
- } else {
- $checkedStatus = If ($null -eq $appInfo.Checked) {""} Else {"IsChecked=`"$($appInfo.Checked)`" "}
- if ($null -eq $appInfo.Link)
- {
- $blockXml += "`n"
- }
- else
- {
- $blockXml += "`n`n`n"
- }
- }
- }
- }
- $blockXml +="`n`n`n"
- }
- return ($blockXml)
-}
-
-$tabcolums=Get-TabXaml "applications" 5
-$inputXML = $inputXML -replace "{{InstallPanel_applications}}", ($tabcolums)
-$tabcolums=Get-TabXaml "tweaks"
-$inputXML = $inputXML -replace "{{InstallPanel_tweaks}}", ($tabcolums)
-$tabcolums=Get-TabXaml "feature"
-$inputXML = $inputXML -replace "{{InstallPanel_features}}", ($tabcolums)
-
if ((Get-WinUtilToggleStatus WPFToggleDarkMode) -eq $True) {
$ctttheme = 'Matrix'
}
diff --git a/winutil.ps1 b/winutil.ps1
index 1fba3f53..ee846ab9 100644
--- a/winutil.ps1
+++ b/winutil.ps1
@@ -10,7 +10,6 @@
Author : Chris Titus @christitustech
Runspace Author: @DeveloperDurp
GitHub : https://github.com/ChrisTitusTech
- Version : 24.02.20
#>
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.02.20"
+$sync.version = "24.03.21"
$sync.configs = @{}
$sync.ProcessRunning = $false
@@ -258,6 +257,131 @@ function Get-Oscdimg {
Write-Host "Hashes do not match. File may be corrupted or tampered with."
}
}
+function Get-TabXaml {
+ <#
+ .SYNOPSIS
+ Generates XAML for a tab in the WinUtil GUI
+ This function is used to generate the XAML for the applications tab in the WinUtil GUI
+ It takes the tabname and the number of columns to display the applications in as input and returns the XAML for the tab as output
+ .PARAMETER tabname
+ The name of the tab to generate XAML for
+ .PARAMETER columncount
+ The number of columns to display the applications in
+ .OUTPUTS
+ The XAML for the tab
+ .EXAMPLE
+ Get-TabXaml "applications" 3
+ #>
+
+
+ param( [Parameter(Mandatory=$true)]
+ $tabname,
+ $columncount = 0
+ )
+ $organizedData = @{}
+ # Iterate through JSON data and organize by panel and category
+ foreach ($appName in $sync.configs.$tabname.PSObject.Properties.Name) {
+ $appInfo = $sync.configs.$tabname.$appName
+
+ # Create an object for the application
+ $appObject = [PSCustomObject]@{
+ Name = $appName
+ Category = $appInfo.Category
+ Content = $appInfo.Content
+ Choco = $appInfo.choco
+ Winget = $appInfo.winget
+ Panel = if ($columncount -gt 0 ) { "0" } else {$appInfo.panel}
+ Link = $appInfo.link
+ Description = $appInfo.description
+ # Type is (Checkbox,Toggle,Button,Combobox ) (Default is Checkbox)
+ Type = $appInfo.type
+ ComboItems = $appInfo.ComboItems
+ # Checked is the property to set startup checked status of checkbox (Default is false)
+ Checked = $appInfo.Checked
+ }
+
+ if (-not $organizedData.ContainsKey($appObject.panel)) {
+ $organizedData[$appObject.panel] = @{}
+ }
+
+ if (-not $organizedData[$appObject.panel].ContainsKey($appObject.Category)) {
+ $organizedData[$appObject.panel][$appObject.Category] = @{}
+ }
+
+ # Store application data in a sub-array under the category
+ # Add Order property to keep the original order of tweaks and features
+ $organizedData[$appObject.panel][$appInfo.Category]["$($appInfo.order)$appName"] = $appObject
+ }
+ $panelcount=0
+ $paneltotal = $organizedData.Keys.Count
+ if ($columncount -gt 0) {
+ $appcount = $sync.configs.$tabname.PSObject.Properties.Name.count + $organizedData["0"].Keys.count
+ $maxcount = [Math]::Round( $appcount / $columncount + 0.5)
+ $paneltotal = $columncount
+ }
+ # add ColumnDefinitions to evenly draw colums
+ $blockXml="`n"+("`n"*($paneltotal))+"`n"
+ # Iterate through organizedData by panel, category, and application
+ $count = 0
+ foreach ($panel in ($organizedData.Keys | Sort-Object)) {
+ $blockXml += "`n`n"
+ $panelcount++
+ foreach ($category in ($organizedData[$panel].Keys | Sort-Object)) {
+ $count++
+ if ($columncount -gt 0) {
+ $panelcount2 = [Int](($count)/$maxcount-0.5)
+ if ($panelcount -eq $panelcount2 ) {
+ $blockXml +="`n`n`n"
+ $blockXml += "`n`n"
+ $panelcount++
+ }
+ }
+ $blockXml += "`n"
+ $sortedApps = $organizedData[$panel][$category].Keys | Sort-Object
+ foreach ($appName in $sortedApps) {
+ $count++
+ if ($columncount -gt 0) {
+ $panelcount2 = [Int](($count)/$maxcount-0.5)
+ if ($panelcount -eq $panelcount2 ) {
+ $blockXml +="`n`n`n"
+ $blockXml += "`n`n"
+ $panelcount++
+ }
+ }
+ $appInfo = $organizedData[$panel][$category][$appName]
+ if ("Toggle" -eq $appInfo.Type) {
+ $blockXml += "`n`n"
+ $blockXml += "`n`n"
+ } elseif ("Combobox" -eq $appInfo.Type) {
+ $blockXml += "`n"
+ # If it is a digit, type is button and button length is digits
+ } elseif ($appInfo.Type -match "^[\d\.]+$") {
+ $blockXml += "`n"
+ # else it is a checkbox
+ } else {
+ $checkedStatus = If ($null -eq $appInfo.Checked) {""} Else {"IsChecked=`"$($appInfo.Checked)`" "}
+ if ($null -eq $appInfo.Link)
+ {
+ $blockXml += "`n"
+ }
+ else
+ {
+ $blockXml += "`n`n`n"
+ }
+ }
+ }
+ }
+ $blockXml +="`n`n`n"
+ }
+ return ($blockXml)
+}
Function Get-WinUtilCheckBoxes {
<#
@@ -2414,7 +2538,7 @@ function Invoke-WPFButton {
"WPFFixesNetwork" {Invoke-WPFFixesNetwork}
"WPFUpdatesdisable" {Invoke-WPFUpdatesdisable}
"WPFUpdatessecurity" {Invoke-WPFUpdatessecurity}
- "WPFWinUtilShortcut" {Invoke-WPFShortcut -ShortcutToAdd "WinUtil"}
+ "WPFWinUtilShortcut" {Invoke-WPFShortcut -ShortcutToAdd "WinUtil" -RunAsAdmin $true}
"WPFGetInstalled" {Invoke-WPFGetInstalled -CheckBox "winget"}
"WPFGetInstalledTweaks" {Invoke-WPFGetInstalled -CheckBox "tweaks"}
"WPFGetIso" {Invoke-WPFGetIso}
@@ -3765,19 +3889,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 {
@@ -3839,8 +3967,14 @@ function Invoke-WPFShortcut {
.PARAMETER ShortcutToAdd
The name of the shortcut to add
+ .PARAMETER RunAsAdmin
+ A boolean value to make 'Run as administrator' property on (true) or off (false), defaults to off
+
#>
- param($ShortcutToAdd)
+ param(
+ $ShortcutToAdd,
+ [bool]$RunAsAdmin = $false
+ )
$iconPath = $null
Switch ($ShortcutToAdd) {
@@ -3873,7 +4007,14 @@ function Invoke-WPFShortcut {
}
$Shortcut.Save()
- Write-Host "Shortcut for $ShortcutToAdd has been saved to $($FileBrowser.FileName)"
+ if ($RunAsAdmin -eq $true) {
+ $bytes = [System.IO.File]::ReadAllBytes($FileBrowser.FileName)
+ # Set byte value at position 0x15 in hex, or 21 in decimal, from the value 0x00 to 0x20 in hex
+ $bytes[0x15] = $bytes[0x15] -bor 0x20
+ [System.IO.File]::WriteAllBytes($FileBrowser.FileName, $bytes)
+ }
+
+ Write-Host "Shortcut for $ShortcutToAdd has been saved to $($FileBrowser.FileName) with 'Run as administrator' set to $RunAsAdmin"
}
function Invoke-WPFTab {
@@ -4453,953 +4594,6 @@ function Invoke-WPFUpdatessecurity {
Write-Host "-- Updates Set to Recommended ---"
Write-Host "================================="
}
-$inputXML = '
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Install
-
-
-
-
-
-
- Tweaks
-
-
-
-
-
-
- Config
-
-
-
-
-
-
- Updates
-
-
-
-
-
-
- MicroWin
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{InstallPanel_applications}}
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{InstallPanel_tweaks}}
-
-
-
-
-
-
-
-
-
-
-
- Note: Hover over items to get a better description. Please be careful as many of these tweaks will heavily modify your system.
- Recommended selections are for normal users and if you are unsure do NOT check anything else!
-
-
-
-
-
-
-
-
-
-
- {{InstallPanel_features}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This is the default settings that come with Windows. No modifications are made and will remove any custom windows update settings.Note: If you still encounter update errors, reset all updates in the config tab. That will restore ALL Microsoft Update Services from their servers and reinstall them to default settings.
-
-
-
-
-
- This is my recommended setting I use on all computers. It will delay feature updates by 2 years and will install security updates 4 days after release.Feature Updates: Adds features and often bugs to systems when they are released. You want to delay these as long as possible.Security Updates: Typically these are pressing security flaws that need to be patched quickly. You only want to delay these a couple of days just to see if they are safe and don''t break other systems. You don''t want to go without these for ANY extended periods of time.
-
-
-
-
-
- This completely disables ALL Windows Updates and is NOT RECOMMENDED. However, it can be suitable if you use your system for a select purpose and do not actively browse the internet. Note: Your system will be easier to hack and infect without security updates.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Choose a Windows ISO file that you''ve downloaded
- Check the status in the console
-
-
-
-
-
-
-
-
-
- Choose Windows SKU
-
- Choose Windows features you want to remove from the ISO
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- /\/\ (_) ___ _ __ ___ / / /\ \ \(_) _ __
- / \ | | / __|| ''__| / _ \ \ \/ \/ /| || ''_ \
-/ /\/\ \| || (__ | | | (_) | \ /\ / | || | | |
-\/ \/|_| \___||_| \___/ \/ \/ |_||_| |_|
-
-
-
- MicroWin features:
- - Remove Telemetry and Tracking
- - Add ability to use local accounts
- - Remove Wifi requirement to finish install
- - Ability to remove Edge
- - Ability to remove Defender
- - Remove Teams
- - Apps debloat
-
-
-
- INSTRUCTIONS
- - Download the latest Windows 11 image from Microsoft
- LINK: https://www.microsoft.com/software-download/windows11
- May take several minutes to process the ISO depending on your machine and connection
- - Put it somewhere on the C:\ drive so it is easily accessible
- - Launch WinUtil and MicroWin
- - Click on the "Select Windows ISO" button and wait for WinUtil to process the image
- It will be processed and unpacked which may take some time
- - Once complete, choose which Windows flavor you want to base your image on
- - Choose which features you want to keep
- - Click the "Start Process" button
- The process of creating the Windows image may take some time, please check the console and wait for it to say "Done"
- - Once complete, the target ISO file will be in the directory you have specified
- - Copy this image to your Ventoy USB Stick, boot to this image, gg
-
- If you are injecting drivers ensure you put all your inf, sys, and dll files for each driver into a separate directory
-
-
-Example:
- C:\drivers\
- |-- Driver1\
- | |-- Driver1.inf
- | |-- Driver1.sys
- |-- Driver2\
- | |-- Driver2.inf
- | |-- Driver2.sys
- |-- OtherFiles...
-
-
-
-
-
-
-
-
-'
$sync.configs.applications = '{
"WPFInstall1password": {
"category": "Utilities",
@@ -6510,7 +5704,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": {
@@ -10730,6 +9924,1984 @@ $sync.configs.tweaks = '{
"Type": "300"
}
}' | convertfrom-json
+$inputXML = '
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Install
+
+
+
+
+
+
+ Tweaks
+
+
+
+
+
+
+ Config
+
+
+
+
+
+
+ Updates
+
+
+
+
+
+
+ MicroWin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Note: Hover over items to get a better description. Please be careful as many of these tweaks will heavily modify your system.
+ Recommended selections are for normal users and if you are unsure do NOT check anything else!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This is the default settings that come with Windows. No modifications are made and will remove any custom windows update settings.Note: If you still encounter update errors, reset all updates in the config tab. That will restore ALL Microsoft Update Services from their servers and reinstall them to default settings.
+
+
+
+
+
+ This is my recommended setting I use on all computers. It will delay feature updates by 2 years and will install security updates 4 days after release.Feature Updates: Adds features and often bugs to systems when they are released. You want to delay these as long as possible.Security Updates: Typically these are pressing security flaws that need to be patched quickly. You only want to delay these a couple of days just to see if they are safe and don''t break other systems. You don''t want to go without these for ANY extended periods of time.
+
+
+
+
+
+ This completely disables ALL Windows Updates and is NOT RECOMMENDED. However, it can be suitable if you use your system for a select purpose and do not actively browse the internet. Note: Your system will be easier to hack and infect without security updates.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Choose a Windows ISO file that you''ve downloaded
+ Check the status in the console
+
+
+
+
+
+
+
+
+
+ Choose Windows SKU
+
+ Choose Windows features you want to remove from the ISO
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /\/\ (_) ___ _ __ ___ / / /\ \ \(_) _ __
+ / \ | | / __|| ''__| / _ \ \ \/ \/ /| || ''_ \
+/ /\/\ \| || (__ | | | (_) | \ /\ / | || | | |
+\/ \/|_| \___||_| \___/ \/ \/ |_||_| |_|
+
+
+
+ MicroWin features:
+ - Remove Telemetry and Tracking
+ - Add ability to use local accounts
+ - Remove Wifi requirement to finish install
+ - Ability to remove Edge
+ - Ability to remove Defender
+ - Remove Teams
+ - Apps debloat
+
+
+
+ INSTRUCTIONS
+ - Download the latest Windows 11 image from Microsoft
+ LINK: https://www.microsoft.com/software-download/windows11
+ May take several minutes to process the ISO depending on your machine and connection
+ - Put it somewhere on the C:\ drive so it is easily accessible
+ - Launch WinUtil and MicroWin
+ - Click on the "Select Windows ISO" button and wait for WinUtil to process the image
+ It will be processed and unpacked which may take some time
+ - Once complete, choose which Windows flavor you want to base your image on
+ - Choose which features you want to keep
+ - Click the "Start Process" button
+ The process of creating the Windows image may take some time, please check the console and wait for it to say "Done"
+ - Once complete, the target ISO file will be in the directory you have specified
+ - Copy this image to your Ventoy USB Stick, boot to this image, gg
+
+ If you are injecting drivers ensure you put all your inf, sys, and dll files for each driver into a separate directory
+
+
+Example:
+ C:\drivers\
+ |-- Driver1\
+ | |-- Driver1.inf
+ | |-- Driver1.sys
+ |-- Driver2\
+ | |-- Driver2.inf
+ | |-- Driver2.sys
+ |-- OtherFiles...
+
+
+
+
+
+
+
+
+'
# SPDX-License-Identifier: MIT
# Set the maximum number of threads for the RunspacePool to the number of threads on the machine
$maxthreads = [int]$env:NUMBER_OF_PROCESSORS
@@ -10784,123 +11956,6 @@ $sync.runspace.Open()
$inputXML = $inputXML -replace 'mc:Ignorable="d"', '' -replace "x:N", 'N' -replace '^`n"+("`n"*($paneltotal))+"`n"
- # Iterate through organizedData by panel, category, and application
- $count = 0
- foreach ($panel in ($organizedData.Keys | Sort-Object)) {
- $blockXml += "`n`n"
- $panelcount++
- foreach ($category in ($organizedData[$panel].Keys | Sort-Object)) {
- $count++
- if ($columncount -gt 0) {
- $panelcount2 = [Int](($count)/$maxcount-0.5)
- if ($panelcount -eq $panelcount2 ) {
- $blockXml +="`n`n`n"
- $blockXml += "`n`n"
- $panelcount++
- }
- }
- $blockXml += "`n"
- $sortedApps = $organizedData[$panel][$category].Keys | Sort-Object
- foreach ($appName in $sortedApps) {
- $count++
- if ($columncount -gt 0) {
- $panelcount2 = [Int](($count)/$maxcount-0.5)
- if ($panelcount -eq $panelcount2 ) {
- $blockXml +="`n`n`n"
- $blockXml += "`n`n"
- $panelcount++
- }
- }
- $appInfo = $organizedData[$panel][$category][$appName]
- if ("Toggle" -eq $appInfo.Type) {
- $blockXml += "`n`n"
- $blockXml += "`n`n"
- } elseif ("Combobox" -eq $appInfo.Type) {
- $blockXml += "`n"
- # If it is a digit, type is button and button length is digits
- } elseif ($appInfo.Type -match "^[\d\.]+$") {
- $blockXml += "`n"
- # else it is a checkbox
- } else {
- $checkedStatus = If ($null -eq $appInfo.Checked) {""} Else {"IsChecked=`"$($appInfo.Checked)`" "}
- if ($null -eq $appInfo.Link)
- {
- $blockXml += "`n"
- }
- else
- {
- $blockXml += "`n`n`n"
- }
- }
- }
- }
- $blockXml +="`n`n`n"
- }
- return ($blockXml)
-}
-
-$tabcolums=Get-TabXaml "applications" 5
-$inputXML = $inputXML -replace "{{InstallPanel_applications}}", ($tabcolums)
-$tabcolums=Get-TabXaml "tweaks"
-$inputXML = $inputXML -replace "{{InstallPanel_tweaks}}", ($tabcolums)
-$tabcolums=Get-TabXaml "feature"
-$inputXML = $inputXML -replace "{{InstallPanel_features}}", ($tabcolums)
-
if ((Get-WinUtilToggleStatus WPFToggleDarkMode) -eq $True) {
$ctttheme = 'Matrix'
}
diff --git a/xaml/inputApp.xaml b/xaml/inputApp.xaml
new file mode 100644
index 00000000..fc9c5f1e
--- /dev/null
+++ b/xaml/inputApp.xaml
@@ -0,0 +1,894 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/xaml/inputFeatures.xaml b/xaml/inputFeatures.xaml
new file mode 100644
index 00000000..c57704c6
--- /dev/null
+++ b/xaml/inputFeatures.xaml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/xaml/inputTweaks.xaml b/xaml/inputTweaks.xaml
new file mode 100644
index 00000000..5b8bbe0a
--- /dev/null
+++ b/xaml/inputTweaks.xaml
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+