From: Pat Thoyts on
Patrick <patrick.dunnigan(a)activecompliance.com> writes:

>I have been trying to get my custom icon into my starpack on and off
>for some time without success. I finally realized what the issue is.
>
>On the tclkit download page http://code.google.com/p/tclkit/wiki/TclkitDownloads
>there are two windows versions of tclkit. One with tk and one without.
>My application is a windows service and command line executable so
>there is no need for the tk. I do however wish (no pun intended) to
>change the icon of the app.
>
>The non-tk tclkit does not have the hdr/tclkit.ico in it's metakit
>virtual file system (I doubt I am expressing that properly but you get
>the idea). It certainly should. in the sdx code (wrap.tcl) the logic
>skips the custom icon if hdr/tclkit.ico does not exist in the -runtime
>executable. I figured this out by unwrapping sdx.kit, removing some
>catches and rewrapping.
>
>I would like to use tclkitsh-8.5.7-win32.upx.exe but would also like
>to be able replace the icon. Is there anyway we can get this tclkit
>version updated with the tclkit.ico file?


I think in this instance the simplest thing will be to replace it
using visual studio. Split the tclkit, unpack the upx executable,
change the resource and put it back together.

copy tclkitsh-8.5.7-win32.upx.exe custom.exe
sdx mksplit custom.exe
upx -d custom.head
<modify the resources in custom.head>
upx --best custom.head
copy /b custom.head + custom.tail custom.exe

In your error message, I assume your virtual file system is called
hdr. If you copy a tclkit.ico into the hdr directory it should use
it. Both tclkitsh and tclkit use the same icon file and the
replacement code should work on both in the same way. You just have to
put a modified .ico file in the right place. You should begin by
taking a copy of the tclkit.ico file from the source tree (or by
extracting it from the resources of the shipping executable).

--
Pat Thoyts http://www.patthoyts.tk/
To reply, rot13 the return address or read the X-Address header.
PGP fingerprint 2C 6E 98 07 2C 59 C8 97 10 CE 11 E6 04 E0 B9 DD
From: Pat Thoyts on
Patrick <patrick.dunnigan(a)activecompliance.com> writes:

>What I see happening next is that the icon replacement logic then
>looks for the tclkit.ico file in the <appname>.vfs directory. If it
>finds it AND there was a tclkit.ico file in the hdr virtual file
>system in the tclkitsh-8.5.7-win32.upx.exe executable it will create
>an array of the images in the icon files with the element name being
>the resolution. It then spins through the images in the new icon file
>and if there is a corresponding image (same resolution) in the array
>it will search the executable header for the original image and
>replace it with the new image.
>
>So there needs to be both a file in the virtual file system hdr called
>tclkit.ico and the actual icon in the executable header AND they must
>be exactly the same or the find and replace does not work.

OK this makes some sense. The kitgen build constructs the tclkit vfs
during the build and the tclkit.ico file is only included with the gui
files. I'll add it to the cli files for the
future. (kitgen/setupvfs.tcl is the script doing this).

>Also I found that in the case of the icon 48x48/256: NOT FOUND, etc.
>errors that we've seen the postings about in the tclkit-8.5.7-
>win32.upx.exe starpacks, the 48X48 images in the icon file in the hdr
>filesystem in that executable do not match exactly the images in the
>icon of the exe itself. They are probably very similar but at least
>off by one bit causing the NOT FOUND errors.

I'll see if I can work out whats wrong here. Actually I want to change
the icon file for something that will work better on Win7 which has a
tendency to use large icons. I've already committed rendered icons for
Tcl and Tk so a SVG based rendered set for tclkit will be an
improvement.
The icon file used in the tclkit resources is the same file that gets
copied to the tclkit vfs (from kitgen/files/tclkit.ico) so they should
be identical.

--
Pat Thoyts http://www.patthoyts.tk/
To reply, rot13 the return address or read the X-Address header.
PGP fingerprint 2C 6E 98 07 2C 59 C8 97 10 CE 11 E6 04 E0 B9 DD
From: Pat Thoyts on
AF <aaronf(a)gmail.com> writes:
>
>I agree with Patrick, theres really no reason the icon shouldnt be
>included in non tk builds. while youre updating to the new icon, would
>you like to update sdx to use the tcllib ico module rather than a
>naive string replace? I have working code...

Send it along then. I was about to dive into the PE header.

--
Pat Thoyts http://www.patthoyts.tk/
To reply, rot13 the return address or read the X-Address header.
PGP fingerprint 2C 6E 98 07 2C 59 C8 97 10 CE 11 E6 04 E0 B9 DD