Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

exe with wx gui - pp/wxpar issues

by jhoop (Acolyte)
on Apr 07, 2011 at 06:25 UTC ( #897945=perlquestion: print w/ replies, xml ) Need Help??
jhoop has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I've been down every avenue I can find with hopes of figuring this out on my own, but no dice. I've got a program across a few files with a wxperl gui, the husk of which was generated with wxglade. I'm using Strawberry, the app runs fine from Padre, but I need an exe so I can hand this around at work. Using wxpar and pp I've tried and succeeded in generating exe's, but they give a plethora of (the same) errors - copied below. Many thanks for any help, this has been frustrating to say the least ~

C:\Users\me\filepath>wxpar -o test.exe myprog.pl Running Command ..... pp @test.wxparargs -o test.exe myprog.pl ..... C:\Users\me\filepath>test.exe Can't do inplace edit: \$Recycle.Bin is not a regular file at (eval 43 +) line 1. Can't do inplace edit: \boot is not a regular file at (eval 43) line 1 +. Can't do inplace edit: \Documents and Settings is not a regular file a +t (eval 43 ) line 1, <> chunk 1. Can't do inplace edit: \dvmexp is not a regular file at (eval 43) line + 1, <> chu nk 1. Can't do inplace edit: \f34de0ce6549b8b15e7f9503 is not a regular file + at (eval 43) line 1, <> chunk 2. Can't open \hiberfil.sys: Permission denied at (eval 43) line 1, <> ch +unk 2. Can't do inplace edit: \HP is not a regular file at (eval 43) line 1, +<> chunk 2 . Can't do inplace edit: \HPMBackup is not a regular file at (eval 43) l +ine 1, <> chunk 2. Can't do inplace edit: \kworking is not a regular file at (eval 43) li +ne 1, <> c hunk 2. Can't do inplace edit: \MSOCache is not a regular file at (eval 43) li +ne 1, <> c hunk 2. Can't open \pagefile.sys: Permission denied at (eval 43) line 1, <> ch +unk 2. Can't do inplace edit: \PerfLogs is not a regular file at (eval 43) li +ne 1, <> c hunk 2. Can't do inplace edit: \Program Files is not a regular file at (eval 4 +3) line 1, <> chunk 2. Can't do inplace edit: \Program Files (x86) is not a regular file at ( +eval 43) l ine 1, <> chunk 2. Can't do inplace edit: \ProgramData is not a regular file at (eval 43) + line 1, < > chunk 2. Can't do inplace edit: \Python27 is not a regular file at (eval 43) li +ne 1, <> c hunk 2. Can't do inplace edit: \Recovery is not a regular file at (eval 43) li +ne 1, <> c hunk 2. Can't do inplace edit: \RM is not a regular file at (eval 43) line 1, +<> chunk 2 . Can't do inplace edit: \SPLASH.000 is not a regular file at (eval 43) +line 1, <> chunk 2. Can't do inplace edit: \SPLASH.SYS is not a regular file at (eval 43) +line 1, <> chunk 3. Can't do inplace edit: \strawberry is not a regular file at (eval 43) +line 1, <> chunk 3. Can't do inplace edit: \SwSetup is not a regular file at (eval 43) lin +e 1, <> ch unk 3. Can't do inplace edit: \System Volume Information is not a regular fil +e at (eval 43) line 1, <> chunk 3. Can't do inplace edit: \SYSTEM.SAV is not a regular file at (eval 43) +line 1, <> chunk 3. Can't do inplace edit: \temp is not a regular file at (eval 43) line 1 +, <> chunk 3. Can't do inplace edit: \Users is not a regular file at (eval 43) line +1, <> chun k 3. Can't do inplace edit: \Windows is not a regular file at (eval 43) lin +e 1, <> ch unk 4.

Comment on exe with wx gui - pp/wxpar issues
Download Code
Re: exe with wx gui - pp/wxpar issues
by vkon (Deacon) on Apr 07, 2011 at 08:48 UTC
    wow,
    there's something terribly wrong going there - what "inplace edit \windows"?
    :o :o :o

    You're in danger of corrupting your OS.

    what is in the file test.wxparargs BTW?

Re: exe with wx gui - pp/wxpar issues
by marto (Chancellor) on Apr 07, 2011 at 09:03 UTC

    This looks dangerous. Please post the contents of myprog.pl and @test.wxparargs.

      Contents of @test.wxparargs, which I believe was generated during the compile by wx::perl::packager :

      # wxpar Getopt::Argfile for PAR::Packer pp -M attributes.pm -l C:/strawberry/perl/site/lib/Alien/wxWidgets/msw_2_8_10_uni_gcc_3_4/ +lib/libgcc_s_sjlj-1.dll -l C:/strawberry/perl/site/lib/Alien/wxWidgets/msw_2_8_10_uni_gcc_3_4/ +lib/wxmsw28u_adv_gcc_custom.dll -l C:/strawberry/perl/site/lib/Alien/wxWidgets/msw_2_8_10_uni_gcc_3_4/ +lib/wxmsw28u_xrc_gcc_custom.dll -l C:/strawberry/perl/site/lib/Alien/wxWidgets/msw_2_8_10_uni_gcc_3_4/ +lib/wxbase28u_xml_gcc_custom.dll -l C:/strawberry/perl/site/lib/Alien/wxWidgets/msw_2_8_10_uni_gcc_3_4/ +lib/wxmsw28u_media_gcc_custom.dll -l C:/strawberry/perl/site/lib/Alien/wxWidgets/msw_2_8_10_uni_gcc_3_4/ +lib/wxmsw28u_html_gcc_custom.dll -l C:/strawberry/perl/site/lib/Alien/wxWidgets/msw_2_8_10_uni_gcc_3_4/ +lib/wxbase28u_net_gcc_custom.dll -l C:/strawberry/perl/site/lib/Alien/wxWidgets/msw_2_8_10_uni_gcc_3_4/ +lib/wxmsw28u_gl_gcc_custom.dll -l C:/strawberry/perl/site/lib/Alien/wxWidgets/msw_2_8_10_uni_gcc_3_4/ +lib/wxmsw28u_aui_gcc_custom.dll -l C:/strawberry/perl/site/lib/Alien/wxWidgets/msw_2_8_10_uni_gcc_3_4/ +lib/wxmsw28u_stc_gcc_custom.dll -l C:/strawberry/perl/site/lib/Alien/wxWidgets/msw_2_8_10_uni_gcc_3_4/ +lib/wxmsw28u_core_gcc_custom.dll -l C:/strawberry/perl/site/lib/Alien/wxWidgets/msw_2_8_10_uni_gcc_3_4/ +lib/wxmsw28u_richtext_gcc_custom.dll -l C:/strawberry/perl/site/lib/Alien/wxWidgets/msw_2_8_10_uni_gcc_3_4/ +lib/wxbase28u_gcc_custom.dll

      Partial contents of myprog (this goes on to parse text from the files in @files, calling out to subs1.pl and generating RTF reports from template files) I can provide more if needed:

      #!C:\strawberry\perl\bin use Wx::Perl::Packager; use strict; use warnings; require 'subs1.pl'; require 'rtf_report1.pl'; require 'rtf_report2.pl'; package MyDialog; use Wx qw[:everything]; use base qw(Wx::Dialog); use Wx::Perl::BrowseButton qw(:everything); my $project_id = ' '; my $report_type = ' '; my $source_path = ' '; my $destination_path = ' '; sub new { my( $self, $parent, $id, $title, $pos, $size, $style, $name ) = @_ +; $parent = undef unless defined $parent; $id = -1 unless defined $id; $title = "" unless defined $title; $pos = wxDefaultPosition unless defined $pos; $size = wxDefaultSize unless defined $size; $name = "" unless defined $name; $style = wxDEFAULT_DIALOG_STYLE unless defined $style; $self = $self->SUPER::new( $parent, $id, $title, $pos, $size, $sty +le, $name ); $self->{sizer_5_staticbox} = Wx::StaticBox->new($self, -1, "Output + Folder (if different from Source):" ); $self->{sizer_1_staticbox} = Wx::StaticBox->new($self, -1, "" ); $self->{sizer_5_copy_staticbox} = Wx::StaticBox->new($self, -1, "S +ource Folder:" ); $self->{label_2} = Wx::StaticText->new($self, -1, "Project ID:", w +xDefaultPosition, wxDefaultSize, ); $self->{text_ctrl_1} = Wx::TextCtrl->new($self, -1, "", wxDefaultP +osition, wxDefaultSize, ); $self->{browse_source} = Wx::Perl::BrowseButton->new( $self, -1, " +", wxDefaultPosition, wxDefaultSize, wxPL_BROWSE_DIR ); $self->{browse_destination} = Wx::Perl::BrowseButton->new( $self, +-1, "", wxDefaultPosition, wxDefaultSize, wxPL_BROWSE_DIR ); $self->{label_3} = Wx::StaticText->new($self, -1, "Report Type:", + wxDefaultPosition, wxDefaultSize, ); $self->{combo_box_1} = Wx::ComboBox->new($self, -1, "", wxDefaultP +osition, wxDefaultSize, ["report A", "report B", "report C", "report +D", "report E", "report F"], wxCB_DROPDOWN|wxCB_DROPDOWN|wxCB_READONL +Y); $self->{checkbox_1} = Wx::CheckBox->new($self, -1, "QC Doc", wxDef +aultPosition, wxDefaultSize, ); $self->{checkbox_2} = Wx::CheckBox->new($self, -1, "Spreadsheet", +wxDefaultPosition, wxDefaultSize, ); $self->{checkbox_3} = Wx::CheckBox->new($self, -1, "Comparison Cha +rt", wxDefaultPosition, wxDefaultSize, ); $self->{button_1} = Wx::Button->new($self, -1, "Go!"); Wx::Event::EVT_BUTTON( $self, $self->{button_1}, $id = sub { my ( $self, $event ) = @_; $project_id = $self->{text_ctrl_1}->GetValue(); $report_type = $self->{combo_box_1}->GetValue(); $source_path = $self->{browse_source}->GetPath(); $destination_path = $self->{browse_destination}->GetPath() +; $self->Close(1); $self->Destroy; return $project_id; } ); $self->__set_properties(); $self->__do_layout(); return $self; } sub __set_properties { my $self = shift; $self->SetTitle("dialog_1"); $self->{label_2}->SetMinSize(Wx::Size->new(-1, -1)); $self->{text_ctrl_1}->SetMinSize(Wx::Size->new(131, 24)); $self->{browse_source}->SetMinSize(Wx::Size->new(225, -1)); $self->{browse_destination}->SetMinSize(Wx::Size->new(225, -1)); $self->{combo_box_1}->SetMinSize(Wx::Size->new(131, 24)); $self->{combo_box_1}->SetSelection(0); } sub __do_layout { my $self = shift; $self->{sizer_1}= Wx::StaticBoxSizer->new($self->{sizer_1_staticbo +x}, wxVERTICAL); $self->{grid_sizer_1} = Wx::GridSizer->new(3, 1, 3, 6); $self->{sizer_3} = Wx::BoxSizer->new(wxHORIZONTAL); $self->{sizer_5}= Wx::StaticBoxSizer->new($self->{sizer_5_staticbo +x}, wxHORIZONTAL); $self->{sizer_5_copy}= Wx::StaticBoxSizer->new($self->{sizer_5_cop +y_staticbox}, wxHORIZONTAL); $self->{sizer_2} = Wx::BoxSizer->new(wxHORIZONTAL); $self->{sizer_2}->Add($self->{label_2}, 0, wxALL, 3); $self->{sizer_2}->Add($self->{text_ctrl_1}, 1, wxALL, 3); $self->{sizer_1}->Add($self->{sizer_2}, 0, wxEXPAND, 0); $self->{sizer_5_copy}->Add( $self->{browse_source}, 0, wxGROW|wxAL +L, 0 ); $self->{sizer_1}->Add($self->{sizer_5_copy}, 1, wxEXPAND, 0); $self->{sizer_5}->Add($self->{browse_destination}, 0, 0, 0); $self->{sizer_1}->Add($self->{sizer_5}, 1, wxEXPAND, 0); $self->{sizer_3}->Add($self->{label_3}, 0, wxALL, 3); $self->{sizer_3}->Add($self->{combo_box_1}, 1, wxALL, 3); $self->{sizer_1}->Add($self->{sizer_3}, 0, wxEXPAND, 0); $self->{grid_sizer_1}->Add($self->{checkbox_1}, 0, 0, 3); $self->{grid_sizer_1}->Add($self->{checkbox_2}, 0, 0, 3); $self->{grid_sizer_1}->Add($self->{checkbox_3}, 0, 0, 3); $self->{sizer_1}->Add($self->{grid_sizer_1}, 1, wxEXPAND, 0); $self->{sizer_1}->Add($self->{button_1}, 0, wxALL|wxALIGN_CENTER_H +ORIZONTAL, 3); $self->SetSizer($self->{sizer_1}); $self->{sizer_1}->Fit($self); $self->Layout(); } package main; unless(caller){ local *Wx::App::OnInit = sub{1}; my $app = Wx::App->new(); Wx::InitAllImageHandlers(); my $dialog_1 = MyDialog->new(); $app->SetTopWindow($dialog_1); $dialog_1->Show(1); $app->MainLoop(); } $source_path = win_path($source_path); $destination_path = win_path($destination_path); if (!$destination_path) { $destination_path = $source_path; } my @files = <$source_path\\*>; my %seen; my $search = 'while (<>) { study;'; $search .= "++\$seen{\$ARGV} if /\\b_$project_id\\b/;\n"; $search .= "}"; @ARGV = @files; undef $/; eval $search; $/ = "\n";
        problem one, covered in PAR::FAQ
        unless(caller)
        Problem two
        $source_path = win_path($source_path); $destination_path = win_path($destination_path); if (!$destination_path) { $destination_path = $source_path; } my @files = <$source_path\\*>; my %seen; my $search = 'while (<>) { study;'; $search .= "++\$seen{\$ARGV} if /\\b_$project_id\\b/;\n"; $search .= "}"; @ARGV = @files; undef $/; eval $search; $/ = "\n";
        Don't use string eval, especially for something like that. That should be a single function call, see qr, quotemeta, local
Re: exe with wx gui - pp/wxpar issues
by Anonymous Monk on Apr 07, 2011 at 12:58 UTC
    Yeah, to call this wx/par issues is misleading to say the least

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://897945]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2014-08-20 23:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (125 votes), past polls