http://qs321.pair.com?node_id=1170574


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

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". ;-)

Replies are listed 'Best First'.
Re^2: How do I replace the camel icon on Windows exe built with pp?
by swl (Parson) on Sep 02, 2016 at 02:33 UTC

    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.