Re: Accessing the tclkit executable in a starpack
Neil <[email protected]> Tue, 19 Jul 2011 20:45:57 -0700 (PDT)
| Newsgroups | gmane.comp.lang.tcl.starkit |
|---|---|
| Message-ID | <[email protected]> |
If I understand you correctly, you can launch both of those using the
starpack.
Make a folder structure (mine has main.tcl in the root, with a /lib
below that).
---- main.tcl ----
package require starkit
if {[llength $::argv]=3D=3D1 && [string length [lindex $::argv 0]] &&
[file exist [lindex $::argv 0]]} {
source [lindex $::argv 0]
exit
}
puts "Running remainder of script"
---- /main.tcl ----
Then put a 'hello world' script in the lib directory (i named it
int.tcl, and made a copy outside the whole thing called ext.tcl).
Pack it all up into an exe. If I run that as follows, I get this:
C:\dev\tcl\template>extlaunch.exe ext.tcl
hello
C:\dev\tcl\template>extlaunch.exe extlaunch.exe/lib/int.tcl
hello
Note, to run the internal file, you use the exe name as the base
directory...
Next, if you want to open a new process from your exe running one of
the scripts, you just change the 'Running remainder of script' line
with:
exec [info nameofexecutable] ext.tcl
or
exec [info nameofexecutable] [file join [info nameofexecutable] lib
int.tcl]
You'd probably be best off using cmdline for the options, and
accepting a -source option, or similar, and obviously you want to
merge this with a proper main.tcl; but essentially, all you do is
source/exec the script *if it's passed*, then exit; or go on with your
app otherwise.
On Jul 18, 12:17=A0pm, Paul <[email protected]> wrote:
> Hi,
>
> I want to distribute a Tcl app as a starpack. The computer that it
> will be used on won't have Tcl installed on it, but of course, Tcl
> will be in the starpack.
>
> What I want to do is, from a tcl script within the starpack, kick off
> another tcl process, using the tcl interpreter contained within the
> starpack.
>
> If I could do something like [open "|internal_tclkit external.tcl" r
> +], that would be great, where internal_tclkit is the tclkit contained
> within the starpack, and external.tcl is a tcl script that resides
> outside the starpack.
>
> Is something like this possible?
>
> Thanks,
>
> Paul.
>
> (Actually, I would prefer to be able to kick off another process using
> the internal tclkit and also an internal tcl script, but I've already
> found out that's not posiible.)
--=20
You received this message because you are subscribed to the "starkit" group=
.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to starkit-unsubscribe@googlegro=
ups.com
For more options, visit this group at http://groups.google.com/group/starki=
t?hl=3Den