Compare commits

..

2 Commits

Author SHA1 Message Date
c942287172 Compile Winutil 2024-06-20 18:30:22 +00:00
7c58eb0e78 Add 'JoyToKey' and 'Wise Program Uninstaller' Apps into 'applications.json' File (#2069)
* Add 'Wise Program Uninstaller' App into 'applications.json' File

* Add 'JoyToKey' App into 'applications.json' File
2024-06-20 13:29:50 -05:00
3 changed files with 410 additions and 404 deletions

View File

@ -9,22 +9,6 @@ $sync = [Hashtable]::Synchronized(@{})
$sync.PSScriptRoot = $PSScriptRoot $sync.PSScriptRoot = $PSScriptRoot
$sync.configs = @{} $sync.configs = @{}
function Update-Progress {
param (
[Parameter(Mandatory, position=0)]
[string]$StatusMessage,
[Parameter(Mandatory, position=1)]
[ValidateRange(0,100)]
[int]$Percent,
[Parameter(position=2)]
[string]$Activity = "Compiling"
)
Write-Progress -Activity $Activity -Status $StatusMessage -PercentComplete $Percent
}
$header = @" $header = @"
################################################################################################################ ################################################################################################################
### ### ### ###
@ -33,22 +17,20 @@ $header = @"
################################################################################################################ ################################################################################################################
"@ "@
# Create the script in memory. # Create the script in memory.
Update-Progress "Pre-req: Allocating Memory" 0
$script_content = [System.Collections.Generic.List[string]]::new() $script_content = [System.Collections.Generic.List[string]]::new()
Update-Progress "Adding: Header" 5 Write-Progress -Activity "Compiling" -Status "Adding: Header" -PercentComplete 5
$script_content.Add($header) $script_content.Add($header)
Update-Progress "Adding: Version" 10 Write-Progress -Activity "Compiling" -Status "Adding: Version" -PercentComplete 10
$script_content.Add($(Get-Content .\scripts\start.ps1).replace('#{replaceme}',"$(Get-Date -Format yy.MM.dd)")) $script_content.Add($(Get-Content .\scripts\start.ps1).replace('#{replaceme}',"$(Get-Date -Format yy.MM.dd)"))
Update-Progress "Adding: Functions" 20 Write-Progress -Activity "Compiling" -Status "Adding: Functions" -PercentComplete 20
Get-ChildItem .\functions -Recurse -File | ForEach-Object { Get-ChildItem .\functions -Recurse -File | ForEach-Object {
$script_content.Add($(Get-Content $psitem.FullName)) $script_content.Add($(Get-Content $psitem.FullName))
} }
Update-Progress "Adding: Config *.json" 40 Write-Progress -Activity "Compiling" -Status "Adding: Config *.json" -PercentComplete 40
Get-ChildItem .\config | Where-Object {$psitem.extension -eq ".json"} | ForEach-Object { Get-ChildItem .\config | Where-Object {$psitem.extension -eq ".json"} | ForEach-Object {
$json = (Get-Content $psitem.FullName).replace("'","''") $json = (Get-Content $psitem.FullName).replace("'","''")
@ -61,11 +43,10 @@ Get-ChildItem .\config | Where-Object {$psitem.extension -eq ".json"} | ForEach-
$_.Replace('=}','').Replace('@{','').Replace(' ','') $_.Replace('=}','').Replace('@{','').Replace(' ','')
} }
# Note:
# Avoid using HTML Entity Codes, for example '”' (stands for "Right Double Quotation Mark"),
# Use **HTML decimal/hex codes instead**, as using HTML Entity Codes will result in XML parse Error when running the compiled script.
for ($i = 0; $i -lt $firstLevelJsonList.Count; $i += 1) { for ($i = 0; $i -lt $firstLevelJsonList.Count; $i += 1) {
$firstLevelName = $firstLevelJsonList[$i] $firstLevelName = $firstLevelJsonList[$i]
# Note: Avoid using HTML Entity Codes (for example '”' (stands for "Right Double Quotation Mark")), and use HTML decimal/hex codes instead.
# as using HTML Entity Codes will result in XML parse Error when running the compiled script.
if ($jsonAsObject.$firstLevelName.content -ne $null) { if ($jsonAsObject.$firstLevelName.content -ne $null) {
$jsonAsObject.$firstLevelName.content = $jsonAsObject.$firstLevelName.content.replace('&','&#38;').replace('“','&#8220;').replace('”','&#8221;').replace("'",'&#39;').replace('<','&#60;').replace('>','&#62;') $jsonAsObject.$firstLevelName.content = $jsonAsObject.$firstLevelName.content.replace('&','&#38;').replace('“','&#8220;').replace('”','&#8221;').replace("'",'&#39;').replace('<','&#60;').replace('>','&#62;')
$jsonAsObject.$firstLevelName.content = $jsonAsObject.$firstLevelName.content.replace('&#39;&#39;',"&#39;") # resolves the Double Apostrophe caused by the first replace function in the main loop $jsonAsObject.$firstLevelName.content = $jsonAsObject.$firstLevelName.content.replace('&#39;&#39;',"&#39;") # resolves the Double Apostrophe caused by the first replace function in the main loop
@ -75,27 +56,14 @@ Get-ChildItem .\config | Where-Object {$psitem.extension -eq ".json"} | ForEach-
$jsonAsObject.$firstLevelName.description = $jsonAsObject.$firstLevelName.description.replace('&#39;&#39;',"&#39;") # resolves the Double Apostrophe caused by the first replace function in the main loop $jsonAsObject.$firstLevelName.description = $jsonAsObject.$firstLevelName.description.replace('&#39;&#39;',"&#39;") # resolves the Double Apostrophe caused by the first replace function in the main loop
} }
} }
# The replace at the end is required, as without it the output of converto-json will be somewhat weird for Multiline String
# Add 'WPFInstall' as a prefix to every entry-name in 'applications.json' file # Most Notably is the scripts in json files, making it harder for users who want to review these scripts that are found in the final compiled script
if ($psitem.Name -eq "applications.json") {
for ($i = 0; $i -lt $firstLevelJsonList.Count; $i += 1) {
$appEntryName = $firstLevelJsonList[$i]
$appEntryContent = $jsonAsObject.$appEntryName
# Remove the entire app entry, so we could add it later with a different name
$jsonAsObject.PSObject.Properties.Remove($appEntryName)
# Add the app entry, but with a different name (WPFInstall + The App Entry Name)
$jsonAsObject | Add-Member -MemberType NoteProperty -Name "WPFInstall$appEntryName" -Value $appEntryContent
}
}
# The replace at the end is required, as without it the output of 'converto-json' will be somewhat weird for Multiline Strings
# Most Notably is the scripts in some json files, making it harder for users who want to review these scripts, which're found in the compiled script
$json = ($jsonAsObject | convertto-json -Depth 3).replace('\r\n',"`r`n") $json = ($jsonAsObject | convertto-json -Depth 3).replace('\r\n',"`r`n")
$sync.configs.$($psitem.BaseName) = $json | convertfrom-json $sync.configs.$($psitem.BaseName) = $json | convertfrom-json
$script_content.Add($(Write-output "`$sync.configs.$($psitem.BaseName) = '$json' `| convertfrom-json" )) $script_content.Add($(Write-output "`$sync.configs.$($psitem.BaseName) = '$json' `| convertfrom-json" ))
} }
Update-Progress "Adding: Config *.cfg" 45 Write-Progress -Activity "Compiling" -Status "Adding: Config *.cfg" -PercentComplete 45
Get-ChildItem .\config | Where-Object {$PSItem.Extension -eq ".cfg"} | ForEach-Object { Get-ChildItem .\config | Where-Object {$PSItem.Extension -eq ".cfg"} | ForEach-Object {
$script_content.Add($(Write-output "`$sync.configs.$($psitem.BaseName) = '$(Get-Content $PSItem.FullName)'")) $script_content.Add($(Write-output "`$sync.configs.$($psitem.BaseName) = '$(Get-Content $PSItem.FullName)'"))
} }
@ -108,13 +76,13 @@ $xaml = (Get-Content .\xaml\inputXML.xaml).replace("'","''")
# Dot-source the Get-TabXaml function # Dot-source the Get-TabXaml function
. .\functions\private\Get-TabXaml.ps1 . .\functions\private\Get-TabXaml.ps1
Update-Progress "Building: Xaml " 75 Write-Progress -Activity "Compiling" -Status "Building: Xaml " -PercentComplete 75
$appXamlContent = Get-TabXaml "applications" 5 $appXamlContent = Get-TabXaml "applications" 5
$tweaksXamlContent = Get-TabXaml "tweaks" $tweaksXamlContent = Get-TabXaml "tweaks"
$featuresXamlContent = Get-TabXaml "feature" $featuresXamlContent = Get-TabXaml "feature"
Update-Progress "Adding: Xaml " 90 Write-Progress -Activity "Compiling" -Status "Adding: Xaml " -PercentComplete 90
# Replace the placeholder in $inputXML with the content of inputApp.xaml # Replace the placeholder in $inputXML with the content of inputApp.xaml
$xaml = $xaml -replace "{{InstallPanel_applications}}", $appXamlContent $xaml = $xaml -replace "{{InstallPanel_applications}}", $appXamlContent
$xaml = $xaml -replace "{{InstallPanel_tweaks}}", $tweaksXamlContent $xaml = $xaml -replace "{{InstallPanel_tweaks}}", $tweaksXamlContent
@ -125,17 +93,17 @@ $script_content.Add($(Write-output "`$inputXML = '$xaml'"))
$script_content.Add($(Get-Content .\scripts\main.ps1)) $script_content.Add($(Get-Content .\scripts\main.ps1))
if ($Debug){ if ($Debug){
Update-Progress "Writing debug files" 95 Write-Progress -Activity "Compiling" -Status "Writing debug files" -PercentComplete 95
$appXamlContent | Out-File -FilePath ".\xaml\inputApp.xaml" -Encoding ascii $appXamlContent | Out-File -FilePath ".\xaml\inputApp.xaml" -Encoding ascii
$tweaksXamlContent | Out-File -FilePath ".\xaml\inputTweaks.xaml" -Encoding ascii $tweaksXamlContent | Out-File -FilePath ".\xaml\inputTweaks.xaml" -Encoding ascii
$featuresXamlContent | Out-File -FilePath ".\xaml\inputFeatures.xaml" -Encoding ascii $featuresXamlContent | Out-File -FilePath ".\xaml\inputFeatures.xaml" -Encoding ascii
} }
else { else {
Update-Progress "Removing temporary files" 99 Write-Progress -Activity "Compiling" -Status "Removing temporary files" -PercentComplete 99
Remove-Item ".\xaml\inputApp.xaml" -ErrorAction SilentlyContinue Remove-Item ".\xaml\inputApp.xaml" -ErrorAction SilentlyContinue
Remove-Item ".\xaml\inputTweaks.xaml" -ErrorAction SilentlyContinue Remove-Item ".\xaml\inputTweaks.xaml" -ErrorAction SilentlyContinue
Remove-Item ".\xaml\inputFeatures.xaml" -ErrorAction SilentlyContinue Remove-Item ".\xaml\inputFeatures.xaml" -ErrorAction SilentlyContinue
} }
Set-Content -Path $scriptname -Value ($script_content -join "`r`n") -Encoding ascii Set-Content -Path $scriptname -Value ($script_content -join "`r`n") -Encoding ascii
Update-Progress "Finished" 100 Write-Progress -Activity "Compiling" -Completed

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@
Author : Chris Titus @christitustech Author : Chris Titus @christitustech
Runspace Author: @DeveloperDurp Runspace Author: @DeveloperDurp
GitHub : https://github.com/ChrisTitusTech GitHub : https://github.com/ChrisTitusTech
Version : 24.06.18 Version : 24.06.20
#> #>
param ( param (
[switch]$Debug, [switch]$Debug,
@ -45,7 +45,7 @@ Add-Type -AssemblyName System.Windows.Forms
# Variable to sync between runspaces # Variable to sync between runspaces
$sync = [Hashtable]::Synchronized(@{}) $sync = [Hashtable]::Synchronized(@{})
$sync.PSScriptRoot = $PSScriptRoot $sync.PSScriptRoot = $PSScriptRoot
$sync.version = "24.06.18" $sync.version = "24.06.20"
$sync.configs = @{} $sync.configs = @{}
$sync.ProcessRunning = $false $sync.ProcessRunning = $false
@ -7171,6 +7171,14 @@ $sync.configs.applications = '{
"link": "https://www.revouninstaller.com/", "link": "https://www.revouninstaller.com/",
"winget": "RevoUninstaller.RevoUninstaller" "winget": "RevoUninstaller.RevoUninstaller"
}, },
"WPFInstallWiseProgramUninstaller": {
"category": "Utilities",
"choco": "na",
"content": "Wise Program Uninstaller (WiseCleaner)",
"description": "Wise Program Uninstaller is the perfect solution for uninstalling Windows programs, allowing you to uninstall applications quickly and completely using its simple and user-friendly interface.",
"link": "https://www.wisecleaner.com/wise-program-uninstaller.html",
"winget": "WiseCleaner.WiseProgramUninstaller"
},
"WPFInstallrevolt": { "WPFInstallrevolt": {
"category": "Communications", "category": "Communications",
"choco": "na", "choco": "na",
@ -8131,6 +8139,14 @@ $sync.configs.applications = '{
"link": "https://github.com/7gxycn08/ForceAutoHDR", "link": "https://github.com/7gxycn08/ForceAutoHDR",
"winget": "ForceAutoHDR.7gxycn08" "winget": "ForceAutoHDR.7gxycn08"
}, },
"WPFInstallJoyToKey": {
"category": "Utilities",
"choco": "joytokey",
"content": "JoyToKey",
"description": "enables PC game controllers to emulate the keyboard and mouse input",
"link": "https://joytokey.net/en/",
"winget": "JTKsoftware.JoyToKey"
},
"WPFInstallnditools": { "WPFInstallnditools": {
"category": "Multimedia Tools", "category": "Multimedia Tools",
"choco": "na", "choco": "na",
@ -14184,20 +14200,23 @@ $inputXML = '<Window x:Class="WinUtility.MainWindow"
<CheckBox Name="WPFInstalljdownloader" Content="JDownloader" ToolTip="JDownloader is a feature-rich download manager with support for various file hosting services." Margin="0,0,2,0"/><TextBlock Name="WPFInstalljdownloaderLink" Style="{StaticResource HoverTextBlockStyle}" Text="(?)" ToolTip="http://jdownloader.org/" /> <CheckBox Name="WPFInstalljdownloader" Content="JDownloader" ToolTip="JDownloader is a feature-rich download manager with support for various file hosting services." Margin="0,0,2,0"/><TextBlock Name="WPFInstalljdownloaderLink" Style="{StaticResource HoverTextBlockStyle}" Text="(?)" ToolTip="http://jdownloader.org/" />
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<CheckBox Name="WPFInstallJoyToKey" Content="JoyToKey" ToolTip="enables PC game controllers to emulate the keyboard and mouse input" Margin="0,0,2,0"/><TextBlock Name="WPFInstallJoyToKeyLink" Style="{StaticResource HoverTextBlockStyle}" Text="(?)" ToolTip="https://joytokey.net/en/" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<CheckBox Name="WPFInstalljpegview" Content="JPEG View" ToolTip="JPEGView is a lean, fast and highly configurable viewer/editor for JPEG, BMP, PNG, WEBP, TGA, GIF, JXL, HEIC, HEIF, AVIF and TIFF images with a minimal GUI" Margin="0,0,2,0"/><TextBlock Name="WPFInstalljpegviewLink" Style="{StaticResource HoverTextBlockStyle}" Text="(?)" ToolTip="https://github.com/sylikc/jpegview" /> <CheckBox Name="WPFInstalljpegview" Content="JPEG View" ToolTip="JPEGView is a lean, fast and highly configurable viewer/editor for JPEG, BMP, PNG, WEBP, TGA, GIF, JXL, HEIC, HEIF, AVIF and TIFF images with a minimal GUI" Margin="0,0,2,0"/><TextBlock Name="WPFInstalljpegviewLink" Style="{StaticResource HoverTextBlockStyle}" Text="(?)" ToolTip="https://github.com/sylikc/jpegview" />
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<CheckBox Name="WPFInstallkdeconnect" Content="KDE Connect" ToolTip="KDE Connect allows seamless integration between your KDE desktop and mobile devices." Margin="0,0,2,0"/><TextBlock Name="WPFInstallkdeconnectLink" Style="{StaticResource HoverTextBlockStyle}" Text="(?)" ToolTip="https://community.kde.org/KDEConnect" /> <CheckBox Name="WPFInstallkdeconnect" Content="KDE Connect" ToolTip="KDE Connect allows seamless integration between your KDE desktop and mobile devices." Margin="0,0,2,0"/><TextBlock Name="WPFInstallkdeconnectLink" Style="{StaticResource HoverTextBlockStyle}" Text="(?)" ToolTip="https://community.kde.org/KDEConnect" />
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal">
<CheckBox Name="WPFInstallkeepass" Content="KeePassXC" ToolTip="KeePassXC is a cross-platform, open-source password manager with strong encryption features." Margin="0,0,2,0"/><TextBlock Name="WPFInstallkeepassLink" Style="{StaticResource HoverTextBlockStyle}" Text="(?)" ToolTip="https://keepassxc.org/" />
</StackPanel>
</StackPanel> </StackPanel>
</Border> </Border>
<Border Grid.Row="1" Grid.Column="4"> <Border Grid.Row="1" Grid.Column="4">
<StackPanel Background="{MainBackgroundColor}" SnapsToDevicePixels="True"> <StackPanel Background="{MainBackgroundColor}" SnapsToDevicePixels="True">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<CheckBox Name="WPFInstallkeepass" Content="KeePassXC" ToolTip="KeePassXC is a cross-platform, open-source password manager with strong encryption features." Margin="0,0,2,0"/><TextBlock Name="WPFInstallkeepassLink" Style="{StaticResource HoverTextBlockStyle}" Text="(?)" ToolTip="https://keepassxc.org/" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<CheckBox Name="WPFInstalllinkshellextension" Content="Link Shell extension" ToolTip="Link Shell Extension (LSE) provides for the creation of Hardlinks, Junctions, Volume Mountpoints, Symbolic Links, a folder cloning process that utilises Hardlinks or Symbolic Links and a copy process taking care of Junctions, Symbolic Links, and Hardlinks. LSE, as its name implies is implemented as a Shell extension and is accessed from Windows Explorer, or similar file/folder managers." Margin="0,0,2,0"/><TextBlock Name="WPFInstalllinkshellextensionLink" Style="{StaticResource HoverTextBlockStyle}" Text="(?)" ToolTip="https://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html" /> <CheckBox Name="WPFInstalllinkshellextension" Content="Link Shell extension" ToolTip="Link Shell Extension (LSE) provides for the creation of Hardlinks, Junctions, Volume Mountpoints, Symbolic Links, a folder cloning process that utilises Hardlinks or Symbolic Links and a copy process taking care of Junctions, Symbolic Links, and Hardlinks. LSE, as its name implies is implemented as a Shell extension and is accessed from Windows Explorer, or similar file/folder managers." Margin="0,0,2,0"/><TextBlock Name="WPFInstalllinkshellextensionLink" Style="{StaticResource HoverTextBlockStyle}" Text="(?)" ToolTip="https://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html" />
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
@ -14387,6 +14406,9 @@ $inputXML = '<Window x:Class="WinUtility.MainWindow"
<CheckBox Name="WPFInstallwinrar" Content="WinRAR" ToolTip="WinRAR is a powerful archive manager that allows you to create, manage, and extract compressed files." Margin="0,0,2,0"/><TextBlock Name="WPFInstallwinrarLink" Style="{StaticResource HoverTextBlockStyle}" Text="(?)" ToolTip="https://www.win-rar.com/" /> <CheckBox Name="WPFInstallwinrar" Content="WinRAR" ToolTip="WinRAR is a powerful archive manager that allows you to create, manage, and extract compressed files." Margin="0,0,2,0"/><TextBlock Name="WPFInstallwinrarLink" Style="{StaticResource HoverTextBlockStyle}" Text="(?)" ToolTip="https://www.win-rar.com/" />
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<CheckBox Name="WPFInstallWiseProgramUninstaller" Content="Wise Program Uninstaller (WiseCleaner)" ToolTip="Wise Program Uninstaller is the perfect solution for uninstalling Windows programs, allowing you to uninstall applications quickly and completely using its simple and user-friendly interface." Margin="0,0,2,0"/><TextBlock Name="WPFInstallWiseProgramUninstallerLink" Style="{StaticResource HoverTextBlockStyle}" Text="(?)" ToolTip="https://www.wisecleaner.com/wise-program-uninstaller.html" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<CheckBox Name="WPFInstallwisetoys" Content="WiseToys" ToolTip="WiseToys is a set of utilities and tools designed to enhance and optimize your Windows experience." Margin="0,0,2,0"/><TextBlock Name="WPFInstallwisetoysLink" Style="{StaticResource HoverTextBlockStyle}" Text="(?)" ToolTip="https://toys.wisecleaner.com/" /> <CheckBox Name="WPFInstallwisetoys" Content="WiseToys" ToolTip="WiseToys is a set of utilities and tools designed to enhance and optimize your Windows experience." Margin="0,0,2,0"/><TextBlock Name="WPFInstallwisetoysLink" Style="{StaticResource HoverTextBlockStyle}" Text="(?)" ToolTip="https://toys.wisecleaner.com/" />
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">