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]==1 && [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.