From 3d7b2322488ae16cb3bf9fe55df309e2736ea295 Mon Sep 17 00:00:00 2001 From: ChrisTitusTech Date: Fri, 28 Jun 2024 14:41:30 +0000 Subject: [PATCH] Compile Winutil --- winutil.ps1 | 91 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 60 insertions(+), 31 deletions(-) diff --git a/winutil.ps1 b/winutil.ps1 index 337b8c08..15122b4a 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -6576,6 +6576,14 @@ $sync.configs.applications = '{ "link": "https://www.msi.com/Landing/afterburner", "winget": "Guru3D.Afterburner" }, + "WPFInstallmullvadvpn": { + "category": "Pro Tools", + "choco": "mullvad-app", + "content": "Mullvad VPN", + "description": "This is the VPN client software for the Mullvad VPN service.", + "link": "https://github.com/mullvad/mullvadvpn-app", + "winget": "MullvadVPN.MullvadVPN" + }, "WPFInstallBorderlessGaming": { "category": "Utilities", "choco": "na", @@ -12624,15 +12632,15 @@ $inputXML = ' + + + - - - @@ -12839,17 +12847,17 @@ $inputXML = ' - - - - - + + + + + @@ -13062,11 +13070,6 @@ $inputXML = ' - - - - - @@ -13076,10 +13079,18 @@ $inputXML = ' + + + + + + + + @@ -13281,11 +13292,6 @@ $inputXML = ' - - - - - @@ -13295,6 +13301,11 @@ $inputXML = ' + + + + + @@ -14207,19 +14218,37 @@ Add-Type @" } } - # need to experiemnt more - # setting icon for the windows is still not working - # $pngUrl = "https://christitus.com/images/logo-full.png" - # $pngPath = "$env:TEMP\cttlogo.png" - # $iconPath = "$env:TEMP\cttlogo.ico" - # # Download the PNG file - # Invoke-WebRequest -Uri $pngUrl -OutFile $pngPath - # if (Test-Path -Path $pngPath) { - # ConvertTo-Icon -bitmapPath $pngPath -iconPath $iconPath - # } - # $icon = [System.Drawing.Icon]::ExtractAssociatedIcon($iconPath) - # Write-Host $icon.Handle - # [Window]::SendMessage($windowHandle, 0x80, [IntPtr]::Zero, $icon.Handle) + + # Using a TaskbarItem Overlay until someone figures out how to replace the icon correctly + + # URL of the image + $imageUrl = "https://christitus.com/images/logo-full.png" + + # Download the image + $imagePath = "$env:TEMP\logo-full.png" + Invoke-WebRequest -Uri $imageUrl -OutFile $imagePath + + # Read the image file as a byte array + $imageBytes = [System.IO.File]::ReadAllBytes($imagePath) + + # Convert the byte array to a Base64 string + $base64String = [System.Convert]::ToBase64String($imageBytes) + + # Create a streaming image by streaming the base64 string to a bitmap streamsource + $bitmap = New-Object System.Windows.Media.Imaging.BitmapImage + $bitmap.BeginInit() + $bitmap.StreamSource = [System.IO.MemoryStream][System.Convert]::FromBase64String($base64String) + $bitmap.EndInit() + $bitmap.Freeze() + + # Ensure TaskbarItemInfo is created if not already + if (-not $sync["Form"].TaskbarItemInfo) { + $sync["Form"].TaskbarItemInfo = New-Object System.Windows.Shell.TaskbarItemInfo + } + + # Set the overlay icon for the taskbar + $sync["Form"].TaskbarItemInfo.Overlay = $bitmap + $rect = New-Object RECT [Window]::GetWindowRect($windowHandle, [ref]$rect)