Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

How do I replace the camel icon on Windows exe built with pp?

by perltux (Monk)
on Aug 27, 2016 at 09:52 UTC ( #1170572=perlquestion: print w/replies, xml ) Need Help??
perltux has asked for the wisdom of the Perl Monks concerning the following question:

I use 'pp' to build self-contained exe files of my graphical (Tk) Perl applications for MS Windows. The icons in the task bar and in the top left corner of the application window show up correctly when setting them with $mw->iconimage($icon), but on the desktop and in the windows file browser I still get the default camel icon.

In the past 'pp' supported the '--icon' switch which allowed to specify a custom icon, but recent versions of 'pp' no longer support that switch.

So how do I replace this camel icon with my own custom icon with recent versions of 'pp'?
  • Comment on How do I replace the camel icon on Windows exe built with pp?

Replies are listed 'Best First'.
Re: How do I replace the camel icon on Windows exe built with pp?
by afoken (Abbot) on Aug 27, 2016 at 10:17 UTC

    From memory: Windows uses the first icon found in the executable. Replacing it changes the executable's icon.

    One of my old Windows tools has the following lines of code to change the final executable's icon:

    my $icon='/path/to/an/icon.ico'; my $out='/path/to/program.exe'; my $exe=Win32::Exe->new($out) or die "$out: $!"; $exe->update(icon => $icon);

    Win32::Exe should be on CPAN.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

      Adding the icon using Win32::Exe results in a slew of warnings when the PAR executable is first run, at least for recent versions of PAR::Packer.

      If you need to use different icons then maybe you could get the approach at http://www.zewaren.net/site/?q=node/116 to work.

      I could not get that approach to work, albeit I did not try very hard. Instead I hard code the icon when building PAR::Packer by replacing $(PAR_PACKER_SRC)\myldr\winres\pp.ico with my own icon file. It works well enough for my use-case.

Re: How do I replace the camel icon on Windows exe built with pp?
by Anonymous Monk on Aug 27, 2016 at 10:18 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1170572]
Front-paged by Corion
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2018-07-21 11:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (448 votes). Check out past polls.

    Notices?