Dirk80 has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Update par packer executable
by Anonymous Monk on Feb 28, 2012 at 16:26 UTC | |
by Dirk80 (Pilgrim) on Feb 28, 2012 at 19:23 UTC | |
by CountZero (Bishop) on Feb 28, 2012 at 21:14 UTC | |
by Dirk80 (Pilgrim) on Feb 28, 2012 at 21:55 UTC | |
|
Re: Update par packer executable
by Anonymous Monk on Feb 28, 2012 at 23:12 UTC | |
by Dirk80 (Pilgrim) on Feb 29, 2012 at 08:27 UTC | |
|
Re: Update par packer executable
by CountZero (Bishop) on Feb 28, 2012 at 18:49 UTC | |
by Dirk80 (Pilgrim) on Feb 28, 2012 at 19:28 UTC |