How to change the icon for the desktop shortcut to a VB6 app installed via an .msi file?

A long time ago, I set up the icon that appears on the user's desktop when the .msi file has compeleted the installation. Now I want to change the icon, and I've forgotten the steps.

From VB6, to change the icon, I've tried Project Properties > Make > Icon. Though it looks right, the desktop icon after installation is the version I'm trying to replace. I've looked through Visual Studio Installer, and I can't see where I can make the required changes.

Help, experts, please.
Gordon_AtherleyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DabasCommented:
Hi Gordon_Atherley:
Try creating a new shortcut to your executable.
Does it have the old icon or the new icon?

Dabas
MattiCommented:
Hi!

Edit that msi whit Orca. Orca is a part of Windows installer SDK download.

Open Icon table there is Binary Data , click on it the prompt will open and you can replace the icon.

then check Shortcut table whit Orca, there shuld not be edit but, on shortcut table there is icon_ ,that's Name from icon table.


Matti
Gordon_AtherleyAuthor Commented:
Dabas

A new shortcut created on the test machine has the old icon.  Same with the exe on the development machine, it's the old icon.

Gordon
Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

DabasCommented:
Gordon_Atherley:
> From VB6, to change the icon, I've tried Project Properties > Make > Icon
The icon you choose there is the icon of the nominated forms.

Just check that the name of the form that appears there, has its icon property set to your new icon


Dabas
Gordon_AtherleyAuthor Commented:
Yes, the icon referenced in the nominated form is the new one. It's visible alongside the Icon dropdown that identifies the nominated form.

Gordon
DabasCommented:
Gordon_Atherley:
Strange.
Can you try to just copy the executable to the other computer (without installing it with the msi), just to check that you have the same problem?

Dabas
Gordon_AtherleyAuthor Commented:
On the dev machine, the copied exe has the old icon. Creating a shortcut produced the old icon.

The exe made on the dev machine has the old exe, too

Gordon_AtherleyAuthor Commented:
Ooops, sorry, the last sentence should have read

The exe made on the dev machine has the old icon, too

DabasCommented:
Beats me.
Last thing I can ask you to try is to check the date of the executable you are looking at.
Just in case you are looking in the wrong folder

Dabas
Gordon_AtherleyAuthor Commented:
I referenced the new icon on a different form, checked that this displays on the form at run time, which it does, and then made a new exe.

The new exe has the old icon, and the date and time stamp identify the exe as the newly created one.

It looks as though the problem is within my app and not the msi process

Beats me, too

DabasCommented:
Gordon_Atherley:
> It looks as though the problem is within my app and not the msi process
Yep.
Where does the old icon come from? Is it still belonging to any form in your application?

Dabas
Gordon_AtherleyAuthor Commented:
I'll check all the instances in the forms and the source(s) of the old icon, and report back
Gordon_AtherleyAuthor Commented:
None of these steps changed the icon from the old to the new:

1. Replacing the old with the new iocns in every form in the app
2. Deleting instead of overwriting the prior exe before making the new one; the old icon continues to be associated wtih the exe in Windows Explorer
3. Renaming what appears to be the source file of the old icon

As well, in the nominated form resorting to the default VB6 icon doesn't result in any change in the icon associated with the exe

I can only conclude that the old icon is somehow hard coded into my app.

Continues to beat me
MattiCommented:
Hi!

>I can only conclude that the old icon is somehow hard coded into my app.

Is there a res-file, that can hold an icon.

Matti
Gordon_AtherleyAuthor Commented:
Matti

Yes, actually there is. It's used for icons for a treeview.
DabasCommented:
Gordon_Atherley,
That is where you have to look for the culprit!


Dabas
Gordon_AtherleyAuthor Commented:
Yes, the old icon is there, as APPICON.

Now the challenge is to replace it.

With VB6's Resource Editor, I can see the old icon. With Visual Studio.NET, I can see an editable image of the old icon. But I can't identify any way of replacing it.

Browsing Experts Exchange leaves me with the impression that the icon is not replaceable. That's hard to believe. More likely, I hope, I'm probably missing something.

Is it in fact replaceable and, if so, how, please?

Gordon
MattiCommented:
Hi!

Use VB Resource Editor
Look for right button popupmenu for "delete"
And toolbar button for "Add Icon"

Matti

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Gordon_AtherleyAuthor Commented:
Matti

I've tried that already. What I got was a new icon in the res file. What I didn't get was a replacement for APPICON, which, seemingly, is the source VB6 uses for the icon for the exe. I'm presuming, of course, that if the exe icon gets changed, the shortcut on the deployed-to machine will also be changed.

If I'm right, I need to be able to replace the APPICON content or reference.

This question is more difficult than I first thought, so I've boosted the points accordingly

Gordon
MattiCommented:
Hi!

Put the icon via Properties dialog "Icon" on a form on that project then:
From VB Project Properties, Make tab, Application and select form which has the icon to be shown. It shuld show preview dialog too.

What size is that icon,  maybe it is making this difficult?

Matti
Gordon_AtherleyAuthor Commented:
Matti

Make tab > Application > icon dropdown references a form with the new icon, which shows properly in the preview. But remaking the exe still shows the old icon.

It's 32 * 32

Gordon
MattiCommented:
Hi!

Everything shuld be ok, sure about the folder of the new exe-file.

Matti
Gordon_AtherleyAuthor Commented:
I'll continue experimenting, and report back

Folder is OK -- I can tell from the date/time of the overwritten exe
Gordon_AtherleyAuthor Commented:
Matti and Dabas

Thanks to your combined input, I finally got the right icon in place.  I found MSDN's 291569 "How To Associate a Custom Icon with a Formless Visual Basic Application" helpful for clues.

You were right, the problem is that VB6 when making the exe looks in any resource file first. In my case, it looks for the default item "APPICON".

First I backed up the res file. Then I opened it in Visual Studio 2003. Having disovered that "APPICON" is a default name not a constant, I deleted it. Then I added a new item in the resource, which recieved the default ID "101".

I loaded the new icon into 101, which I then renamed "APPICON". I then replaced the res file in my app. Now the new icon shows on the made exe file and as the shortcut on the deployed app. All as required. Simple, once you know how.

I'm splitting the points between you because you both pointed me in the right direction.

Thanks and regards

Gordon

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.