PDA

Click to See Complete Forum and Search --> : Changing Icon


Shell
Nov 17th, 2002, 02:34 PM
Ok, i'm making a setup program creater and I want to change the icon of a compiled exe. Anyone knows how to do this? (if it's even possible) :D

Thanks in advance,

-Shell-

The Hobo
Nov 17th, 2002, 02:42 PM
Why would a setup program need to change the icon of a compiled exe? :confused:

Shell
Nov 17th, 2002, 02:44 PM
I made an engine (a separate exe) which is the actual setup program, i executes a text file. I want the user to be able to change this program's icon.

-Shell-

The Hobo
Nov 17th, 2002, 02:46 PM
A text file isn't a program. You could change the icon associated with a text file, if that's what you mean.

Shell
Nov 17th, 2002, 02:47 PM
Nono! I have the engine (an exe), and it contains a text file.

-Shell-

The Hobo
Nov 17th, 2002, 02:53 PM
And you want the user to be able to change the icon of your "engine?" Or the text file? How does your engine contain a text file?

It's a setup program, right? So does it create a text file? and you want to change the icon FOR that text file?

I'm so confused. :confused:

Shell
Nov 17th, 2002, 02:56 PM
lol, ok, I'll try to explain ;)

I have made a setup creater and a setup engine. The creater is used to generate a script file which the setup engine can run.
So you can use the engine to execute a script file, the script file contains all needed info about how the setup should go.

When the script file is made, i make a copy of the engine exe and put the text file into the exe. What I want to do is to change the icon of this exe.

-Shell-

cyborg
Nov 17th, 2002, 03:13 PM
i know one really hard, and stupid way :)

extract the icon, and open it in a hex editor, copy all text into clipboard.

open the exe in a hex editor, search for the copied text...

open a new icon and copy all text from it...

paste it into the exe instead of the previous text...


that's the only way i know of... :p

Shell
Nov 17th, 2002, 03:15 PM
That was what I was thinking :)
I hoped someone would have some code to do it ;)
Thanks though.

-Shell-

cyborg
Nov 17th, 2002, 03:17 PM
that could be done using code.....but i think there is a better way...

Shell
Nov 17th, 2002, 03:18 PM
How?! Tell me!? please! :)

-Shell-

cyborg
Nov 17th, 2002, 03:19 PM
well... i dont know a better way, but i hope there is :p

Shell
Nov 17th, 2002, 03:20 PM
lol, i hope someone tells me that way ;)

-Shell-

cyborg
Nov 17th, 2002, 03:24 PM
maybe you could do like this:

Open PrevIcon For Binary As #1
'get the text from it
Close #1

Open NewIcon For Binary As #1
'get the text from it
Close #1


Open Exe For Binary As #1
'do search for PrevIcons text and paste text from NewIcon...
'save
Close #1

Shell
Nov 17th, 2002, 03:26 PM
Yea, but then the source icon must be the same size as the current one. ack! this is hard :(

-Shell-

cyborg
Nov 17th, 2002, 03:28 PM
yep...hehe...

Shell
Nov 18th, 2002, 06:36 AM
I've done some searching and I found a program called recource hacker, with it I can change the icon of a program, now all I need to know is how to do it with code :)

-Shell-