Hello wise monks,

I created some par packed executables with the command line tool "pp" as follows in a MSWin32 environment:

pp -a "additional_stuff" -o hello_world.exe hello_world.pl

Now I noticed that inside the "hello_world.exe" there are a lot of files which I want to get rid of.

That's why I wrote the following script:

#!/usr/bin/perl use strict; use warnings; use Archive::Zip qw( :ERROR_CODES ); my $zip_name = 'hello_world.exe'; my $zip = Archive::Zip->new( $zip_name ); die "ERROR: Could not open \"$zip_name\"!!!" unless defined $zip; my @metadata_file_members = $zip->membersMatching( '\.metadata' ); $zip->removeMember($_) for ( @metadata_file_members ); $zip->overwrite();

The updated "hello_world.exe" now does NOT contain the .metadata files I wanted to get rid of. So this works fine. But now I have the problem that I have a normal zip file and not a self extracting file as before.

I looked into the examples of Archive::Zip and found "selfex.pl". Here I got the idea of how it could be done. But to be honest I have no plan how to create the par packed executable as it was before.

I've seen in the "script/main.pl" file within the par packed executable that this code could be the right place to look. But as said before I don't know how to create exactly such a self extracting executable as it was before.

Main question: How can I remove some files from a par packed executable?

Thank you a lot for you help.

Greetings,

Dirk


In reply to Update par packer executable by Dirk80

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.