File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+
2+ Add-Type - AssemblyName System.Drawing
3+ $source = " $PSScriptRoot \extension\logo.png"
4+ $dest = " $PSScriptRoot \assets\icon.ico"
5+
6+ if (Test-Path $source ) {
7+ try {
8+ $img = [System.Drawing.Bitmap ]::FromFile($source )
9+ # Create a new bitmap with standard icon size if needed, but let's try direct conversion first
10+ # But for best quality, let's just use GetHicon
11+ $iconHandle = $img.GetHicon ()
12+ $icon = [System.Drawing.Icon ]::FromHandle($iconHandle )
13+
14+ $fs = New-Object System.IO.FileStream($dest , [System.IO.FileMode ]::Create)
15+ $icon.Save ($fs )
16+ $fs.Close ()
17+
18+ $icon.Dispose () # Important to release handle
19+ $img.Dispose ()
20+
21+ Write-Host " Success: Created $dest "
22+ } catch {
23+ Write-Host " Error: $_ "
24+ }
25+ } else {
26+ Write-Host " Source file not found: $source "
27+ }
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ DefaultGroupName={#MyAppName}
2525PrivilegesRequired = admin
2626OutputDir = build
2727OutputBaseFilename = ProXPL_Installer_v{#MyAppVersion}
28- ; SetupIconFile=assets\icon.ico
28+ SetupIconFile = assets\icon.ico
2929SolidCompression = yes
3030WizardStyle = modern
3131WizardImageFile = extension\logo.png
@@ -48,12 +48,14 @@ Source: "bin\*.dll"; DestDir: "{app}\bin"; Flags: ignoreversion
4848Source : " lib\*" ; DestDir : " {app} \lib" ; Flags : ignoreversion recursesubdirs createallsubdirs
4949; Documentation
5050Source : " docs\*" ; DestDir : " {app} \docs" ; Flags : ignoreversion recursesubdirs createallsubdirs
51+ ; Assets
52+ Source : " assets\*" ; DestDir : " {app} \assets" ; Flags : ignoreversion recursesubdirs createallsubdirs
5153; NOTE: Don't use "Flags: ignoreversion" on any shared system files
5254
5355[Icons]
54- Name : " {group} \{#MyAppName}" ; Filename : " {app} \bin\{#MyAppExeName}"
56+ Name : " {group} \{#MyAppName}" ; Filename : " {app} \bin\{#MyAppExeName}" ; IconFilename: " {app} \assets\icon.ico "
5557Name : " {group} \{cm:UninstallProgram,{#MyAppName}}" ; Filename : " {uninstallexe} "
56- Name : " {autodesktop}\{#MyAppName}" ; Filename : " {app} \bin\{#MyAppExeName}" ; Tasks: desktopicon
58+ Name : " {autodesktop}\{#MyAppName}" ; Filename : " {app} \bin\{#MyAppExeName}" ; Tasks: desktopicon ; IconFilename: " {app} \assets\icon.ico "
5759
5860[Registry]
5961Root : HKA; Subkey : " Software\Classes\.prox" ; ValueType : string ; ValueName : " " ; ValueData : " ProXPLSourceFile" ; Flags : uninsdeletevalue
You can’t perform that action at this time.
0 commit comments