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

Custom icon in starpack

166 views
Skip to first unread message

Kevin Walzer

unread,
Jul 24, 2011, 5:50:56 PM7/24/11
to
I've seen all kinds of suggestions at the wiki for customizing a Windows
icon in a starpack. Is the correct way to do this to put my own
tclkit.ico file in the myapp.vfs file before doing a final update/wrap
of the app via sdx, or is there some other way to do this?

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com

APN

unread,
Jul 25, 2011, 4:19:16 AM7/25/11
to

Try the following :

Download ctcl.exe from sourceforge in the WiTS repository:
http://sourceforge.net/p/windowstoolset/code/ci/8c82476d16f53aef754f7aabab372da61a30ba29/tree/tools/ctcl.exe?format=raw

This is nothing but a tclkit with twapi bound in and has commands to
write version and icon resources.

Step 1: split the starpack using sdx. This is required to separate the
"real" exe from the kit data. This step is vital if the size of the
resource(s) being written might be larger than the original resources.

ctcl sdx.kit mksplit mystarpack.exe

This will create a mystarpack.head and .tail file

Step 2: write your version resource - something like

ctcl write_version_resource mystarpack.head -copyright "My copyright" -
timestamp now -version 1.0.0 -productversion 1.0.0 ProductName "My
Windows App" FileDescription "My starpack" CompanyName "Kevin Walzer"
FileVersion "V1.0.0 Beta" ProductVersion "V1.0.0 Beta"

Step 3: write the icons from an external file. Note that TK is assumed
to be the icon id used in the starpack. Sometimes it is APP. Adjust
accordingly.

ctcl write_icon_resource mystarpack.head myicon.ico -name TK

Step 4: Now put back the starpack data

copy /b mystarpack.head+mystarpack.tail mystarpack.exe

Done.

Advantags over other methods

- works with any exe (not just starpacks) skipping the sdx mksplit
step of course.

- does not depend on the size/colors/depths of the icon resources

- updates all version fields in the exe (I seem to remember some of
the alternatives miss some)

- arbitrary version resource strings can be updated

Caveat - only tested on two exes :-)

/Ashok

Christian Gollwitzer

unread,
Jul 25, 2011, 2:18:56 PM7/25/11
to
Am 24.07.11 23:50, schrieb Kevin Walzer:

> I've seen all kinds of suggestions at the wiki for customizing a Windows
> icon in a starpack. Is the correct way to do this to put my own
> tclkit.ico file in the myapp.vfs file before doing a final update/wrap
> of the app via sdx, or is there some other way to do this?

This is by far the easiest way to do it, but then you can't use all the
features of the icons: On "recent" Windows (Vista & 7), icons can
contain truecolor variants with alpha blending and a max size of up to
256x256. The standard icons are made this way. Just like on Mac OSX, the
OS scales the truecolor icons down to the size of 48x48 and then uses
the small versions. The 256color and 16color versions are seen mainly on
remote desktop. You can use ImageMagick's convert to create such an icon
file from a series of PNGs

convert -adjoin 16x16.png 32x32.png 48x48.png 256x256.png my_icon.ico

IIRC you must include both the truecolor and the 256color versions in
order to see anything on the remote desktop. These icons are not
replaced automatically by SDX, but you must use an external tool like
the one suggested by APN.

Christian

0 new messages