On Fri, Feb 17, 2012 at 15:37, RAPPAZ Francois <[email protected]> wrote:
> $self->{glade_xml_abo}->add_from_file("glade/jrn.glade.bld");
> I would like to include these xml files in the par archive (and later in the
> exe).
> I have tried pp -B -a "glade;script/glade" ... which put the xml files where
> I think they should be,
> but my exe runs only if I copy the glade folder below the exe file.
>
> How/where should I place this glade folder into the exe ?
You must use an absolute pathname to load the glade file. Depending on
the actual
option -a, if the file ends up as foo/bar/quux in the zip, then you'll
find it extracted into
$ENV{PAR_TEMP}/inc/foo/bar/quux
(note the .../inc/...) and that's what you should use for add_from_file().
Sorry, that makes you script "aware" that it's running from a packed executable,
but there's no way around that.
You could also read the contents of foo/bar/quux directly from the zip with
$contents = PAR::read_file("foo/bar/quux");
and then use
$builder->gtk_builder_add_from_string($contents);
but that may get you into trouble with encodings: PAR::read_file definitely
will return "bytes" while gtk_builder_add_from_string probably expects
a Unicode string. You might get lucky if the actual file only contains
characters in the ASCII range, though.
Cheers, Roderich