Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

twapi starpack

49 views
Skip to first unread message

getsh...@gmail.com

unread,
Jun 19, 2009, 11:13:28 AM6/19/09
to
Hi,
I have created a little script to get all the settings of the local
users from a remote machine using twapi. Now I would like to be able
to create a starpack with my script and the twapi extension, using the
documentation in the wiki, but I keep getting the error "can't find
package twapi". I am asking myself if it is possible to include a dll
in a starpack.
Can you please help me ?
Thx

APN

unread,
Jun 19, 2009, 11:47:00 AM6/19/09
to
How exactly are you creating the starpack. Are you shipping only the
twapi dll or the twapi tcl code as well? Do you have a main.tcl in the
starpack to set library paths etc. ? What version of Tcl and what
version of twapi? Some details about how you are building will help.

WiTS (wits.magicsplat.com) is distributed as a starpack including
twapi so that's an existence proof.

/Ashok


On Jun 19, 8:13 pm, "getshor...@gmail.com" <getshor...@gmail.com>
wrote:

Frank

unread,
Jun 19, 2009, 12:19:44 PM6/19/09
to
Thanks for your answer.
I am trying to ship the tcl script and twapi. I have a main.tcl and a
lib folder inside the .vfs folder. Inside the lib folder are an app-
myscript folder and the twapi.dll library. Inside app-myscript there
is a pkgIndex.tcl file and my tcl script.

> > Thx- Nascondi testo citato
>
> - Mostra testo citato -

APN

unread,
Jun 19, 2009, 12:47:02 PM6/19/09
to
Frank,

You still did not answer what version of Tcl or what version of twapi.
I'll assume the latest released versions of each - Tcl 8.5 and Twapi
2.0.12.

If that's the case, download twapi-2.0.12.tm from the twapi
sourceforge site and stick it into the lib directory under your
WHATEVER.vfs.

That's all that should be needed, I believe, for the package require
to work, or at least that is sufficient for wits. If that does not
work, try directly sourcing the tm from your main.tcl.

If you are using some other Tcl and Twapi versions, please specify
which ones.

/Ashok

rocket777

unread,
Jun 19, 2009, 8:08:42 PM6/19/09
to
On Jun 19, 9:19 am, Frank <getshor...@gmail.com> wrote:
> Thanks for your answer.
> I am trying to ship the tcl script and twapi. I have a main.tcl and a
> lib folder inside the .vfs folder. Inside the lib folder are an app-
> myscript folder and the twapi.dll library. Inside app-myscript there
> is a pkgIndex.tcl file and my tcl script.

This does not exactly agree with my setup, which works. I've used
several versions of each with no problems. Currently I'm using tcl/tk
8.6b1 and twapi 2.0b11

In my vfs/lib/ directory there is a DIRECTORY

vfs/lib/twapi-2.0b11

and inside this directory there's a pkgIndex.tcl, a twapi.dll, and
some 30 other .tcl files.

The app-xxx directory with my startup script is also in the lib
directory.


But the twapi.dll does NOT reside directly in the lib directory.


APN

unread,
Jun 19, 2009, 10:39:23 PM6/19/09
to

That's the other (older) way to do it (and the only way for Tcl
versions before 8.5). Loading the tm module from a starkit/starpack is
significantly faster. Windows will open the star* for each file read
from the VFS, and for every open, it will do ACL checks for all parent
directories all the way to the top which adds significant cost to the
startup time if you somewhere under program files. Having a single
file in the starpack reduced startup for wits from 4-5 seconds to
under a second.

/Ashok

Frank

unread,
Jun 20, 2009, 1:04:34 PM6/20/09
to APN
The approach suggested by rocket777 works (thank you), now I have a
stand-alone executable which allows me to list all the local user
accounts, and all their settings, on a remote machine. By the way,
this can be considered an interesting achievement from the windows
administrator's point of view, as neither wmi nor powershell are so
flexible and effective: I can carry my executable on a usb pendrive,
knowing that it will have no other dependencies than the Windows api
(many thanks to Ashok for his wonderful job).
Still, I don't know why the more modern tm module approach is not
working (my distribution is WinTclTk 8.5.6, which includes Twapi
2.0.12), I tried to put the file in the lib directory and even to
source it from main.tcl (source lib/twapi.tm ?), but with no success.
Regards,
Frank

> /Ashok- Nascondi testo citato

0 new messages