Here's my sub on creating self-extracting EXE's which may come in useful. Note that this works on both Windows and Unix/Linux, even though it's always creating a Windows-based self-extracting EXE. (I know - I developed it on Linux, and just ran tests on Windows to make sure it still worked.)
use File::Copy; use IO::File; sub _create_sfx { my $self = shift; my $zip = shift; my $exe = shift; my $fh = IO::File->new($exe, "w"); binmode($fh); # stupid Windows copy(File::Spec->catfile(LocationOfUnzipsfxExe(), 'unzipsfx.exe'), $fh); copy($zip, $fh); unlink($zip); $fh->close(); system(qw(zip -A), $exe); }
As you can see, I open my output filehandle, set it to binary mode, and use File::Copy::copy to copy each filename (the unzipsfx.exe file and the zip file) into my still-open file handle. Once closed, then I tell zip to fix the sfx executable (offsets and stuff), and we're done. Funny thing is that "zip -A" run on Linux ... works to create the Windows self-extractor. :-)
In reply to Re: How to concatenate binary files
by Tanktalus
in thread How to concatenate binary files
by AnotherMonkWannabe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |