in reply to Win32::Exe - Resource section creation fails

Because the icon creation failed I was trying to do this manually with the Win32::Exe

I think PAR::Packer uses Win32::Exe to handle the icon creation in the first place - so if it failed the first time, it's not surprising that it failed again when you repeated the process.

What version of Windows are you running ? There's a report on the PAR mailing list of a failure (involving icon creation) on Windows 7 that I can't reproduce on Windows Vista.

The script you posted, works fine for me if I specify 'console' instead of 'gui' ... actually, it may well be working fine for 'gui', too, but I haven't verified that.

Cheers,
Rob
  • Comment on Re: Win32::Exe - Resource section creation fails

Replies are listed 'Best First'.
Re^2: Win32::Exe - Resource section creation fails
by Dirk80 (Pilgrim) on Sep 23, 2010 at 11:38 UTC

    I use Microsoft Windows XP Professional Version 2002 Service Pack 3.

    I think in my case it does not matter if it is gui or console because the creation of a resource section already seems to fail.

    This code

    use strict; use warnings; use Win32::Exe; my $exe = Win32::Exe->new('test.exe'); $exe = $exe->create_resource_section if !$exe->has_resource_section;

    produces this error:

    No resource section found in file test.exe at C:/Perl/site/lib/Win32/E +xe.pm line 348.

    Cheers,

    Dirk

      Now I executed the test of Par::Packer

      Here you can see the result:

      C:\Temp\PAR-Packer-1.006>dmake test C:\Perl\bin\perl.exe -e "chmod(oct('0600'), '..\blib\lib\PAR\StrippedP +ARL\Static.pm');" C:\Perl\bin\perl.exe encode_append.pl static.exe ..\blib\lib\PAR\Strip +pedPARL\Static.pm C:\Perl\bin\perl.exe -e "chmod(oct('0444'), '..\blib\lib\PAR\StrippedP +ARL\Static.pm');" C:\Perl\bin\perl.exe -e "chmod(oct('0600'), '..\blib\lib\PAR\StrippedP +ARL\Dynamic.pm');" C:\Perl\bin\perl.exe encode_append.pl par.exe ..\blib\lib\PAR\Stripped +PARL\Dynamic.pm C:\Perl\bin\perl.exe -e "chmod(oct('0444'), '..\blib\lib\PAR\StrippedP +ARL\Dynamic.pm');" C:\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, ' +inc', 'blib\lib', 'blib\arch')" t/00-pod.t t/10-pa rl-generation.t t/20-pp.t t/30-current_exec.t t/40-packer_cd_option.t t/00-pod.t ............... skipped: Set environment variable PERL_TEST +_POD=1 to test POD t/10-parl-generation.t ... ok t/20-pp.t ................ 31/34 No resource section found in file par +lW2ct.exe at C:/Perl/site/lib/Win32/Exe.pm line 34 8. No resource section found in file parlW2ct.exe at C:/Perl/site/lib/Win +32/Exe.pm line 348. Can't call method "remove" on an undefined value at C:/Perl/site/lib/W +in32/Exe.pm line 473. # Failed test 'pp_gui_tests # amsg572: sub pp_gui_tests cannot system pp --gui --icon hi.ico -o he +llo.exe hello.pl:No such file or directory: # ' t/20-pp.t ................ 32/34 # at automated_pp_test.pl line 8445 +. t/20-pp.t ................ 34/34 # Looks like you failed 1 test of 34. t/20-pp.t ................ Dubious, test returned 1 (wstat 256, 0x100) Failed 1/34 subtests t/30-current_exec.t ...... # Please wait t/30-current_exec.t ...... ok t/40-packer_cd_option.t .. ok Test Summary Report ------------------- t/20-pp.t (Wstat: 256 Tests: 34 Failed: 1) Failed test: 32 Non-zero exit status: 1 Files=5, Tests=71, 487 wallclock secs ( 0.05 usr + 0.03 sys = 0.08 C +PU) Result: FAIL Failed 1/5 test programs. 1/71 subtests failed. dmake.exe: Error code 255, while making 'test_dynamic'

      But the problem seems to be in Win32::Exe and NOT in Par::Packer.

        But the problem seems to be in Win32::Exe and NOT in Par::Packer

        What version of Win32::Exe ? (I'm using 0.14, which seems to be fine.)

        Btw, that's the same test failure as was reported on the PAR mailing list ... dunno what's going on ...

        Cheers,
        Rob