Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

par::packer with Tkx and Strawberry perl

by periferral (Novice)
on Aug 11, 2011 at 18:37 UTC ( #919928=perlquestion: print w/replies, xml ) Need Help??
periferral has asked for the wisdom of the Perl Monks concerning the following question:

I'm using Strawberry perl to build a standalone app with Tkx as the front-end.

I'm running the following command on windows pp --gui --icon res\rvbd.ico -o riverbench.exe benchtool.pl

When I was using Tk, everything was fine. With Tkx and the above command, I get the error.

'The program can't start because tcl85.dll is missing from your computer. Try reinstalling the program to fix this problem.'

If I include tcl85.dll, pp -l tcl85.dll --icon res\rvbd.ico -o riverbench.exe benchtool.pl I get the error message

C:\Users\ashetty\Desktop>riverbench.exe Can't find a usable init.tcl in the following directories: C:/Users/ashetty/AppData/Local/Temp/par-ashetty/lib/tcl8.5 C:/User +s/ashetty/ AppData/Local/Temp/par-ashetty/lib/tcl8.5 C:/Users/ashetty/AppData/Loc +al/Temp/li b/tcl8.5 C:/Users/ashetty/AppData/Local/Temp/par-ashetty/library C:/Us +ers/ashett y/AppData/Local/Temp/library C:/Users/ashetty/AppData/Local/Temp/tcl8. +5.10/libra ry C:/Users/ashetty/AppData/Local/tcl8.5.10/library This probably means that Tcl wasn't installed properly. BEGIN failed--compilation aborted at Tkx.pm line 225. Compilation failed in require at script/benchtool.pl line 39. BEGIN failed--compilation aborted at script/benchtool.pl line 39.
I found this link for a fix with ActiveState Perl
http://stackoverflow.com/questions/1285087/trying-to-create-a-standalone-app-from-a-perl-script-that-uses-tkx-tcl-tk

However, with Strawberry perl there is no tkkit.dll while there is a tcl.dll

When I use ActiveState perl and compile with pp, everything works fine. However, even after specifying --gui option, the console window stays.

I'd love to hear if anyone has got this working successfully. Thanks

Replies are listed 'Best First'.
Re: par::packer with Tkx and Strawberry perl
by Anonymous Monk on Jun 02, 2018 at 18:33 UTC

    Hello, All,

    I know, this is an old discussion. But I struggled the last days with the same problem and think that I have found a clean solution.

    Tcl doesn't find init.tcl, because the shell environment variable $ENV{TCL_Library} points to the wrong place, I think. Altering the environment variables of a parent process is not easy, but I think the following solution is the best and cleanest solution, if you don't want to use a tkkit.

    You only have to add the following begin block to you Tcl::Tk or Tkx perl script:

    BEGIN { if ($ENV{PAR_TEMP} && $ENV{TCL_Library} ne "$ENV{PAR_TEMP}/inc/lib +/tcl8.6") { print "Starting a Tcl::Tk PAR-exe file\n"; print "We need to set shell environment variables first \n"; + $ENV{TCL_Library} = "$ENV{PAR_TEMP}/inc/lib/tcl8.6"; # I don't know whether this is really necessary? $ENV{TK_Library} = "$ENV{PAR_TEMP}/inc/lib/tcl8.6"; system($0); exit(); } }

    I hope, this will help someone.. It is really cool to distribute the perl/Tcl::Tk scripts with pp...

    Best wishes,

    Max

      PS.: the perl script in the example above is packed as follows: pp -l "C:/Tcl/bin/tcl86.dll" -l "c:/Tcl/bin/tk86.dll" -l "c:/Tcl/bin/zlib1.dll" -a "C:/Tcl;./" -o tktest.exe ./tktest.pl. Important is the period before "/". I don't know, why...

Re: par::packer with Tkx and Strawberry perl
by Anonymous Monk on Aug 12, 2011 at 00:52 UTC

    Can't find a usable init.tcl in the following directories:

    You see , Tkx, Tcl, relies on more files than one single dll, files like

    C:\Tcl/lib/tcl8.5/init.tcl C:\Tcl/lib/teapot/package/tcl/lib/BWidget1.8/init.tcl ....
    So you would have to pack all 37Mb of C:\Tcl... it even relies on some registry entries

    Maybe ActiveStates PerlApp has support for Tkx out of the box

Re: par::packer with Tkx and Strawberry perl
by Anonymous Monk on Aug 12, 2011 at 03:21 UTC

    However, with Strawberry perl there is no tkkit.dll while there is a tcl.dll

    ActiveState provides Tcl::tkkit with their distributions, it is not on CPAN or PPM

      Tkkit appears to be ActiveStates custom build (or equivalent) of tclkit/starkit, which for some reason is not released with their ActiveTcl

      So, to get a tkkit with strawberryperl, you'd have to build a tclkit

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://919928]
Approved by marto
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2018-06-18 10:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (109 votes). Check out past polls.

    Notices?