--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
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
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