develooper Front page | perl.tcltk | Postings from August 2019

Using PAR/pp with Tcl::Tk

August 14, 2019 02:23
Using PAR/pp with Tcl::Tk
Message ID:

Hello everybody,
I wanted to share with you, how I could use pp with Tcl::Tk. This topic was discussed here some years ago (see, but the proposed solutions didn't work for me.

The problem is, that one has to change the shell environment variabe $ENV{TCL_Library}. But this is not simple, because the child process (the perl program) cannot change the environment variables of the parent process.

My solution was the following BEGIN block:

	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";

To pack the perl script I use this command:

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 ./

Important is to rename the directory C:/Tcl to "./". Especially you must have the point before the "/". I don't know why ;-) but it works ...

Perhaps this is helpful for someone...

Best wishes,
Max Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About