diff --git a/.github/workflows/compile.yaml b/.github/workflows/compile.yaml index e740f325..d835423b 100644 --- a/.github/workflows/compile.yaml +++ b/.github/workflows/compile.yaml @@ -1,10 +1,11 @@ name: Compile on: - push: - branches: + push: + branches: - main - test* + workflow_dispatch: # Manual trigger added jobs: build-runspace: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 186ca4d1..fc3e679b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -5,6 +5,7 @@ on: workflows: ["Compile"] #Ensure Compile winget.ps1 is done types: - completed + workflow_dispatch: # Manual trigger added jobs: build-runspace: diff --git a/Compile.ps1 b/Compile.ps1 index cef517c0..80ca0729 100644 --- a/Compile.ps1 +++ b/Compile.ps1 @@ -1,5 +1,6 @@ param ( - [switch]$Debug + [switch]$Debug, + [switch]$Run ) $OFS = "`r`n" $scriptname = "winutil.ps1" @@ -100,3 +101,7 @@ else { Set-Content -Path $scriptname -Value ($script_content -join "`r`n") -Encoding ascii Write-Progress -Activity "Compiling" -Completed + +if ($run){ + Start-Process -FilePath "powershell" -ArgumentList ".\$scriptname" +} \ No newline at end of file diff --git a/config/applications.json b/config/applications.json index e8375bbb..a0c20a67 100644 --- a/config/applications.json +++ b/config/applications.json @@ -975,14 +975,6 @@ "link": "https://www.oracle.com/java/", "winget": "EclipseAdoptium.Temurin.18.JRE" }, - "WPFInstalljava20": { - "category": "Development", - "choco": "na", - "content": "Azul Zulu JDK 20", - "description": "Azul Zulu JDK 20 is a distribution of the OpenJDK with long-term support, performance enhancements, and security updates.", - "link": "https://www.azul.com/downloads/zulu-community/", - "winget": "Azul.Zulu.20.JDK" - }, "WPFInstalljava21": { "category": "Development", "choco": "na", @@ -1663,6 +1655,14 @@ "link": "https://www.plex.tv/your-media/", "winget": "Plex.PlexMediaServer" }, + "WPFInstallplexdesktop": { + "category": "Multimedia Tools", + "choco": "plex", + "content": "Plex Desktop", + "description": "Plex Desktop for Windows is the front end for Plex Media Server.", + "link": "https://www.plex.tv", + "winget": "Plex.Plex" + }, "WPFInstallPortmaster": { "category": "Pro Tools", "choco": "portmaster", @@ -1831,6 +1831,14 @@ "link": "https://www.revouninstaller.com/", "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": { "category": "Communications", "choco": "na", @@ -2503,6 +2511,14 @@ "link": "https://toys.wisecleaner.com/", "winget": "WiseCleaner.WiseToys" }, + "WPFInstallTeraCopy": { + "category": "Utilities", + "choco": "TeraCopy", + "content": "TeraCopy", + "description": "Copy your files faster and more securely", + "link": "https://codesector.com/teracopy", + "winget": "CodeSector.TeraCopy" + }, "WPFInstallwizfile": { "category": "Utilities", "choco": "na", @@ -2727,6 +2743,14 @@ "link": "https://github.com/AutoDarkMode/Windows-Auto-Night-Mode", "winget": "Armin2208.WindowsAutoNightMode" }, + "WPFInstallAmbieWhiteNoise": { + "category": "Utilities", + "choco": "na", + "content": "Ambie White Noise", + "description": "Ambie is the ultimate app to help you focus, study, or relax. We use white noise and nature sounds combined with an innovative focus timer to keep you concentrated on doing your best work.", + "link": "https://ambieapp.com/", + "winget": "9P07XNM5CHP0" + }, "WPFInstallmagicwormhole": { "category": "Utilities", "choco": "magic-wormhole", @@ -2735,6 +2759,14 @@ "link": "https://github.com/magic-wormhole/magic-wormhole", "winget": "magic-wormhole.magic-wormhole" }, + "WPFInstallcroc": { + "category": "Utilities", + "choco": "croc", + "content": "croc", + "description": "Easily and securely send things from one computer to another.", + "link": "https://github.com/schollz/croc", + "winget": "schollz.croc" + }, "WPFInstallqgis": { "category": "Multimedia Tools", "choco": "qgis", @@ -2786,11 +2818,19 @@ "WPFInstallForceAutoHDR": { "category": "Utilities", "choco": "na", - "content": "GUI That Forces Auto HDR In Unsupported Games", + "content": "ForceAutoHDR", "description": "ForceAutoHDR simplifies the process of adding games to the AutoHDR list in the Windows Registry", "link": "https://github.com/7gxycn08/ForceAutoHDR", "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": { "category": "Multimedia Tools", "choco": "na", diff --git a/config/tweaks.json b/config/tweaks.json index 9a2122ae..08c4c966 100644 --- a/config/tweaks.json +++ b/config/tweaks.json @@ -1223,11 +1223,6 @@ "StartupType": "Automatic", "OriginalType": "Automatic" }, - { - "Name": "WwanSvc", - "StartupType": "Manual", - "OriginalType": "Manual" - }, { "Name": "XblAuthManager", "StartupType": "Manual", diff --git a/functions/private/Show-CustomDialog.ps1 b/functions/private/Show-CustomDialog.ps1 index e102c43e..505c7a8d 100644 --- a/functions/private/Show-CustomDialog.ps1 +++ b/functions/private/Show-CustomDialog.ps1 @@ -178,17 +178,67 @@ $cttLogoPath = @" $winutilTextBlock.Foreground = $foregroundColor $winutilTextBlock.Margin = New-Object Windows.Thickness(10, 5, 10, 5) # Add margins around the text block $stackPanel.Children.Add($winutilTextBlock) - # Add TextBlock for information with text wrapping and margins $messageTextBlock = New-Object Windows.Controls.TextBlock - $messageTextBlock.Text = $Message $messageTextBlock.TextWrapping = [Windows.TextWrapping]::Wrap # Enable text wrapping $messageTextBlock.HorizontalAlignment = [Windows.HorizontalAlignment]::Left $messageTextBlock.VerticalAlignment = [Windows.VerticalAlignment]::Top $messageTextBlock.Margin = New-Object Windows.Thickness(10) # Add margins around the text block + + # Define the Regex to find hyperlinks formatted as HTML tags + $regex = [regex]::new('([^<]+)') + $lastPos = 0 + + # Iterate through each match and add regular text and hyperlinks + foreach ($match in $regex.Matches($Message)) { + # Add the text before the hyperlink, if any + $textBefore = $Message.Substring($lastPos, $match.Index - $lastPos) + if ($textBefore.Length -gt 0) { + $messageTextBlock.Inlines.Add((New-Object Windows.Documents.Run($textBefore))) + } + + # Create and add the hyperlink + $hyperlink = New-Object Windows.Documents.Hyperlink + $hyperlink.NavigateUri = New-Object System.Uri($match.Groups[1].Value) + $hyperlink.Inlines.Add($match.Groups[2].Value) + $hyperlink.TextDecorations = [Windows.TextDecorations]::None # Remove underline + $hyperlink.Foreground = $foregroundColor + $hyperlink.Add_Click({ + param($sender, $args) + Start-Process $sender.NavigateUri.AbsoluteUri + }) + $hyperlink.Add_MouseEnter({ + param($sender, $args) + $sender.Foreground = [Windows.Media.Brushes]::LightGray + }) + $hyperlink.Add_MouseLeave({ + param($sender, $args) + $sender.Foreground = $foregroundColor + }) + + $messageTextBlock.Inlines.Add($hyperlink) + + # Update the last position + $lastPos = $match.Index + $match.Length + } + + # Add any remaining text after the last hyperlink + if ($lastPos -lt $Message.Length) { + $textAfter = $Message.Substring($lastPos) + $messageTextBlock.Inlines.Add((New-Object Windows.Documents.Run($textAfter))) + } + + # If no matches, add the entire message as a run + if ($regex.Matches($Message).Count -eq 0) { + $messageTextBlock.Inlines.Add((New-Object Windows.Documents.Run($Message))) + } + + + # Add the TextBlock to the Grid $grid.Children.Add($messageTextBlock) [Windows.Controls.Grid]::SetRow($messageTextBlock, 1) # Set the row to the second row (0-based index) + # Add OK button $okButton = New-Object Windows.Controls.Button $okButton.Content = "OK" diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 23978ab7..572ecee4 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -133,9 +133,17 @@ $sync.keys | ForEach-Object { # Load computer information in the background Invoke-WPFRunspace -ScriptBlock { - $sync.ConfigLoaded = $False - $sync.ComputerInfo = Get-ComputerInfo - $sync.ConfigLoaded = $True + try{ + $oldProgressPreference = $ProgressPreference + $ProgressPreference = "SilentlyContinue" + $sync.ConfigLoaded = $False + $sync.ComputerInfo = Get-ComputerInfo + $sync.ConfigLoaded = $True + } + finally{ + $ProgressPreference = "Continue" + } + } | Out-Null #=========================================================================== @@ -145,9 +153,6 @@ Invoke-WPFRunspace -ScriptBlock { # Print the logo Invoke-WPFFormVariables -# Install Winget if not already present -Install-WinUtilWinget - # Set the titlebar $sync["Form"].title = $sync["Form"].title + " " + $sync.version # Set the commands that will run when the form is closed @@ -467,14 +472,13 @@ $sync["AboutMenuItem"].Add_Click({ # Handle Export menu item click Write-Debug "About clicked" $sync["SettingsPopup"].IsOpen = $false - # Example usage $authorInfo = @" -Author : @christitustech -Runspace : @DeveloperDurp -GUI : @KonTy -MicroWin : @KonTy -GitHub : https://github.com/ChrisTitusTech/winutil -Version : $($sync.version) +Author : @christitustech +Runspace : @DeveloperDurp +GUI : @KonTy +MicroWin : @KonTy +GitHub : ChrisTitusTech/winutil +Version : $($sync.version) "@ Show-CustomDialog -Message $authorInfo -Width 400 }) diff --git a/winutil.ps1 b/winutil.ps1 index 3c80f14d..12392957 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -8,7 +8,7 @@ Author : Chris Titus @christitustech Runspace Author: @DeveloperDurp GitHub : https://github.com/ChrisTitusTech - Version : 24.06.18 + Version : 24.06.25 #> param ( [switch]$Debug, @@ -45,7 +45,7 @@ Add-Type -AssemblyName System.Windows.Forms # Variable to sync between runspaces $sync = [Hashtable]::Synchronized(@{}) $sync.PSScriptRoot = $PSScriptRoot -$sync.version = "24.06.18" +$sync.version = "24.06.25" $sync.configs = @{} $sync.ProcessRunning = $false @@ -2810,17 +2810,67 @@ $cttLogoPath = @" $winutilTextBlock.Foreground = $foregroundColor $winutilTextBlock.Margin = New-Object Windows.Thickness(10, 5, 10, 5) # Add margins around the text block $stackPanel.Children.Add($winutilTextBlock) - # Add TextBlock for information with text wrapping and margins $messageTextBlock = New-Object Windows.Controls.TextBlock - $messageTextBlock.Text = $Message $messageTextBlock.TextWrapping = [Windows.TextWrapping]::Wrap # Enable text wrapping $messageTextBlock.HorizontalAlignment = [Windows.HorizontalAlignment]::Left $messageTextBlock.VerticalAlignment = [Windows.VerticalAlignment]::Top $messageTextBlock.Margin = New-Object Windows.Thickness(10) # Add margins around the text block + + # Define the Regex to find hyperlinks formatted as HTML tags + $regex = [regex]::new('([^<]+)') + $lastPos = 0 + + # Iterate through each match and add regular text and hyperlinks + foreach ($match in $regex.Matches($Message)) { + # Add the text before the hyperlink, if any + $textBefore = $Message.Substring($lastPos, $match.Index - $lastPos) + if ($textBefore.Length -gt 0) { + $messageTextBlock.Inlines.Add((New-Object Windows.Documents.Run($textBefore))) + } + + # Create and add the hyperlink + $hyperlink = New-Object Windows.Documents.Hyperlink + $hyperlink.NavigateUri = New-Object System.Uri($match.Groups[1].Value) + $hyperlink.Inlines.Add($match.Groups[2].Value) + $hyperlink.TextDecorations = [Windows.TextDecorations]::None # Remove underline + $hyperlink.Foreground = $foregroundColor + $hyperlink.Add_Click({ + param($sender, $args) + Start-Process $sender.NavigateUri.AbsoluteUri + }) + $hyperlink.Add_MouseEnter({ + param($sender, $args) + $sender.Foreground = [Windows.Media.Brushes]::LightGray + }) + $hyperlink.Add_MouseLeave({ + param($sender, $args) + $sender.Foreground = $foregroundColor + }) + + $messageTextBlock.Inlines.Add($hyperlink) + + # Update the last position + $lastPos = $match.Index + $match.Length + } + + # Add any remaining text after the last hyperlink + if ($lastPos -lt $Message.Length) { + $textAfter = $Message.Substring($lastPos) + $messageTextBlock.Inlines.Add((New-Object Windows.Documents.Run($textAfter))) + } + + # If no matches, add the entire message as a run + if ($regex.Matches($Message).Count -eq 0) { + $messageTextBlock.Inlines.Add((New-Object Windows.Documents.Run($Message))) + } + + + # Add the TextBlock to the Grid $grid.Children.Add($messageTextBlock) [Windows.Controls.Grid]::SetRow($messageTextBlock, 1) # Set the row to the second row (0-based index) + # Add OK button $okButton = New-Object Windows.Controls.Button $okButton.Content = "OK" @@ -6315,14 +6365,6 @@ $sync.configs.applications = '{ "link": "https://www.oracle.com/java/", "winget": "EclipseAdoptium.Temurin.18.JRE" }, - "WPFInstalljava20": { - "category": "Development", - "choco": "na", - "content": "Azul Zulu JDK 20", - "description": "Azul Zulu JDK 20 is a distribution of the OpenJDK with long-term support, performance enhancements, and security updates.", - "link": "https://www.azul.com/downloads/zulu-community/", - "winget": "Azul.Zulu.20.JDK" - }, "WPFInstalljava21": { "category": "Development", "choco": "na", @@ -7003,6 +7045,14 @@ $sync.configs.applications = '{ "link": "https://www.plex.tv/your-media/", "winget": "Plex.PlexMediaServer" }, + "WPFInstallplexdesktop": { + "category": "Multimedia Tools", + "choco": "plex", + "content": "Plex Desktop", + "description": "Plex Desktop for Windows is the front end for Plex Media Server.", + "link": "https://www.plex.tv", + "winget": "Plex.Plex" + }, "WPFInstallPortmaster": { "category": "Pro Tools", "choco": "portmaster", @@ -7171,6 +7221,14 @@ $sync.configs.applications = '{ "link": "https://www.revouninstaller.com/", "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": { "category": "Communications", "choco": "na", @@ -7843,6 +7901,14 @@ $sync.configs.applications = '{ "link": "https://toys.wisecleaner.com/", "winget": "WiseCleaner.WiseToys" }, + "WPFInstallTeraCopy": { + "category": "Utilities", + "choco": "TeraCopy", + "content": "TeraCopy", + "description": "Copy your files faster and more securely", + "link": "https://codesector.com/teracopy", + "winget": "CodeSector.TeraCopy" + }, "WPFInstallwizfile": { "category": "Utilities", "choco": "na", @@ -8067,6 +8133,14 @@ $sync.configs.applications = '{ "link": "https://github.com/AutoDarkMode/Windows-Auto-Night-Mode", "winget": "Armin2208.WindowsAutoNightMode" }, + "WPFInstallAmbieWhiteNoise": { + "category": "Utilities", + "choco": "na", + "content": "Ambie White Noise", + "description": "Ambie is the ultimate app to help you focus, study, or relax. We use white noise and nature sounds combined with an innovative focus timer to keep you concentrated on doing your best work.", + "link": "https://ambieapp.com/", + "winget": "9P07XNM5CHP0" + }, "WPFInstallmagicwormhole": { "category": "Utilities", "choco": "magic-wormhole", @@ -8075,6 +8149,14 @@ $sync.configs.applications = '{ "link": "https://github.com/magic-wormhole/magic-wormhole", "winget": "magic-wormhole.magic-wormhole" }, + "WPFInstallcroc": { + "category": "Utilities", + "choco": "croc", + "content": "croc", + "description": "Easily and securely send things from one computer to another.", + "link": "https://github.com/schollz/croc", + "winget": "schollz.croc" + }, "WPFInstallqgis": { "category": "Multimedia Tools", "choco": "qgis", @@ -8126,11 +8208,19 @@ $sync.configs.applications = '{ "WPFInstallForceAutoHDR": { "category": "Utilities", "choco": "na", - "content": "GUI That Forces Auto HDR In Unsupported Games", + "content": "ForceAutoHDR", "description": "ForceAutoHDR simplifies the process of adding games to the AutoHDR list in the Windows Registry", "link": "https://github.com/7gxycn08/ForceAutoHDR", "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": { "category": "Multimedia Tools", "choco": "na", @@ -9779,11 +9869,6 @@ $sync.configs.tweaks = '{ "StartupType": "Automatic", "OriginalType": "Automatic" }, - { - "Name": "WwanSvc", - "StartupType": "Manual", - "OriginalType": "Manual" - }, { "Name": "XblAuthManager", "StartupType": "Manual", @@ -13515,9 +13600,6 @@ $inputXML = ' - - - @@ -13544,17 +13626,17 @@ $inputXML = ' - - - - - + + + + + @@ -13756,11 +13838,6 @@ $inputXML = ' - - - - - @@ -13770,6 +13847,11 @@ $inputXML = ' + + + + + @@ -13943,6 +14025,9 @@ $inputXML = ' + + + @@ -13978,11 +14063,6 @@ $inputXML = ' - - - - - + + + @@ -14046,6 +14131,9 @@ $inputXML = ' + + + @@ -14094,6 +14182,9 @@ $inputXML = ' + + + @@ -14148,7 +14239,7 @@ $inputXML = ' - + @@ -14184,6 +14275,9 @@ $inputXML = ' + + + @@ -14192,15 +14286,15 @@ $inputXML = ' + + + - - - @@ -14339,6 +14433,9 @@ $inputXML = ' + + + @@ -14387,6 +14484,9 @@ $inputXML = ' + + + @@ -14957,9 +15057,17 @@ $sync.keys | ForEach-Object { # Load computer information in the background Invoke-WPFRunspace -ScriptBlock { - $sync.ConfigLoaded = $False - $sync.ComputerInfo = Get-ComputerInfo - $sync.ConfigLoaded = $True + try{ + $oldProgressPreference = $ProgressPreference + $ProgressPreference = "SilentlyContinue" + $sync.ConfigLoaded = $False + $sync.ComputerInfo = Get-ComputerInfo + $sync.ConfigLoaded = $True + } + finally{ + $ProgressPreference = "Continue" + } + } | Out-Null #=========================================================================== @@ -14969,9 +15077,6 @@ Invoke-WPFRunspace -ScriptBlock { # Print the logo Invoke-WPFFormVariables -# Install Winget if not already present -Install-WinUtilWinget - # Set the titlebar $sync["Form"].title = $sync["Form"].title + " " + $sync.version # Set the commands that will run when the form is closed @@ -15291,14 +15396,13 @@ $sync["AboutMenuItem"].Add_Click({ # Handle Export menu item click Write-Debug "About clicked" $sync["SettingsPopup"].IsOpen = $false - # Example usage $authorInfo = @" -Author : @christitustech -Runspace : @DeveloperDurp -GUI : @KonTy -MicroWin : @KonTy -GitHub : https://github.com/ChrisTitusTech/winutil -Version : $($sync.version) +Author : @christitustech +Runspace : @DeveloperDurp +GUI : @KonTy +MicroWin : @KonTy +GitHub : ChrisTitusTech/winutil +Version : $($sync.version) "@ Show-CustomDialog -Message $authorInfo -Width 400 })