Files
code-utils/tools/extract-icon.ps1
2026-08-14 07:52:01 +08:00

7 lines
407 B
PowerShell
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 从 exe 提取关联图标存为 png用于验证 syso 图标是否打包成功
Add-Type -AssemblyName System.Drawing
$exe = 'D:\myCode\code-count\view\bin\code-count.exe'
$icon = [System.Drawing.Icon]::ExtractAssociatedIcon($exe)
$icon.ToBitmap().Save('D:\myCode\code-count\view\tools\exe-icon-check.png', [System.Drawing.Imaging.ImageFormat]::Png)
Write-Output ("exe size: " + (Get-Item $exe).Length)