Large App icon?

A

Alex Clark

Hi All,

Been playing around testing my app on Vista and I cannot seem to get it to
display a large icon. On the Vista desktop, if I right click and select
View->Large Icons, my app stays at 64x64 with a square around it, while
others (like MS Word) ramp right up to 128x128.

I've added a 128x128 icon into my application icon, and i've even added a
256x256 icon in as well (read somewhere that Vista ignores the 128px and
scales down the 256px icon instead), but it didn't work either way. Both
are currently high color, but it failed when they were set to true color as
well.

Does anyone know how to get a large icon to work?

TIA,
Alex
 
Z

Zhi-xin Ye

Dear Alex,

Thanks for using Newsgroup service!

Based on my understanding, you have created an .ico file with 256x256
and128x128 size images in it, and assign this .ico file to your
application, then put this application on the desktop of a Vista machine
and change the desktop view to Large Icons, but the icon of your
application won't be rendered as 128x128 size as you want.

As far as I know, an .ico file with a 256x256 size PNG image in it will be
displayed correctly on Vista desktop.

You can open your apllication execution file in the Visual Studio via
"File->Open->File...", and check whether the 256x256 size image in the
application icon file is of PNG type.

I use the following steps on my Windows Vista Enterprise(32bit) machine,
the icon of the application displays as 128x128 size as expected.

1. Open an .icon file creation tool (Microangelo Studio or similar);
2. Create an new image with 256x256 size, 32bit ARGB color depth, and PNG
compression;
3. Create an new image with 128x128 size, 32bit ARGB color depth, and PNG
compression;
4. Create an new image with 48 x 48 size, 32bit ARGB color depth, and
none compression;
5 .Create an new image with 32 x 32 size, 32bit ARGB color depth, and
none compression;
6. Create an new image with 16x 16 size, 32bit ARGB color depth, and
none compression;
7. Draw something on the images;
8. Save the .ico file;
9. Create a test Windows Forms application on Visual Studio Team System
2008;
10. Right click on project node in the Solution Explorer and select the
"Properties" item;
11. On the "Icon and manifest" section of the "Application" project
properties page, select the icon file created in the previous steps;
12. Build the application, and copy the execution file to the desktop.
13. Right click on the desktop and select "View->Large Icons".

Please try these steps and let me know the result.

Sincerely,
Zhi-Xin Ye
Microsoft Managed Newsgroup Support Team

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
A

Alex Clark

Hi Zhin-xin,

Thanks, doing this seemed to solve the problem. I was initially thrown off
by the fact that, although this *does* work on the Vista desktop for a .exe,
it doesn't seem to work for a .ico? Not a problem to me, but slightly odd
behaviour!

The other gotcha was that Vista appears to ignore 128x128 icons and instead
use the 256x256 icon scaled down 50%. It was a learning experience,
certainly!

Kind Regards,
Alex
 
Z

Zhi-xin Ye

Dear Alex,

Thanks for your feedback.

As I test, when change the desktop view to "Large Icons", if the icon file
does not have any previous versions, it will displayed as 128x128 size if
it contains a 256x256 PNG image.

However, if there're previous versions of this icon file exist, Vista will
use the image of the previous version.

For example, test with the following steps you will see this behaviour:

1. Create a new icon file with only 32x32 image and 16x16 image in it;
2. Save the icon file with a name which never be used before(e.g.
"icon112233");
4. Close the icon file;
3. Copy the icon file to Vista desktop;
4. Reopen the icon file and add a 256x256 PNG image into it;
5. Save the icon file;
6. Go to desktop and delete the previous icon "icon112233.ico";
7. Copy the icon file to desktop again;
8. Change the desktop view to "Large Icons";

We will see the icon file displays the 32x32 size image as the previous
version does instead of the current version's 256x256 size image.

If we change the name of the icon file to a name which never be used
before, for example "icon112234", then we can see the icon file displays as
128x128 size as expected.

For more information about the previous versions of files on Vista, you can
refer to these:

Windows Vista "Time Warp": Understanding Vista's Backup and Restore
Technologies
http://channel9.msdn.com/posts/Charles/Windows-Vista-quotTime-Warpquot-Under
standing-Vistas-Backup-and-Restore-Technologies/

Previous versions of files: frequently asked questions
http://windowshelp.microsoft.com/Windows/en-US/help/afb7ed89-ed63-4e07-a482-
d7004a8f40121033.mspx#EI

For more information about the Icons used on Vista, you can refer to this
document:

Icons
http://msdn.microsoft.com/en-us/library/aa511280.aspx

If you need further help on this problem, please feel free to let me know.

Sincerely,
Zhi-Xin Ye
Microsoft Managed Newsgroup Support Team

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
 
A

Alex Clark

Ahh, that would explain a lot. I think I started with an icon that only
went up to 64x64, and then replaced it with an icon file that went all the
way up to 256x256 and had this exact behaviour. It never ocurred to me that
Vista's versioning of files would be interfering...

I did take manual steps to clear the icon cache, and even rebooted the
system, but it still remained as the old version. Presumably Vista was
maintaining the file versions between sessions (and deleting the icon cache
was a red herring)?

Thanks,
Alex
 
Z

Zhi-xin Ye

Dear Alex,

Thank you for the feedback.

After more research on this issue, I find that this behavior is caused by
the icon caching, instead of file versions, I'm sorry for the confusion.

OS uses icon caching to speed up showing icons for files, so when
displaying icons, the OS tries to use the cached copy of icon instead of
the one embedded in the file. And for Vista, the cached icons are store in
the hidden IconCache.db file, which is located at "C:\Users\(your account
name)\AppData\Local".

So to display the correct icon, we can delete the IconCache.db file to
force the icon files to display new image. There're two ways to do this:

Solution1:

1. Click the Start button;
2. Hold down CTRL+SHIFT keys and right click on empty area in the Start
Menu;
3. Click "Exit Explorer";
4. Hold down CTRL+SHIFT+ESC keys to open the Task Manager;
5. Click File->New Task, and input "cmd.exe", press Enter key;
6. In the command line window, type "cd %userprofile%\AppData\Local", press
Enter key;
7. Type "attrib -h IconCache.db" and press Enter key;
8. Type "del IconCache.db" and presss Enter key;
9. Type "start explorer" and press Enter key;

Solution 2:

1. Open Control Panel;
2. Click "Classic View" link on the left;
3. Double click the "Folder Options";
4. Click the "View" tab;
5. Click the "Show hidden files and folders" option from the list;
6. Open Windows Explorer and go to "C:\Users\(your account
name)\AppData\Local";
7. Delete the hidden IconCache.db file;
8. Reboot;

After the steps in either solutions, the Vista Icon Cache should have been
rebuilt.

I notice that you mentioned you "take manual steps to clear the icon cache"
and even perform a reboot, could you please let me know your steps to
clear the icon cache? Does your steps the same as mine?

I'm looking forward to hearing from you soon.

Sincerely,
Zhi-Xin Ye
Microsoft Managed Newsgroup Support Team

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
 
A

Alex Clark

Hi Zhi-xin,

I took virtually identical steps to your "solution 2", deleting the
IconCache.db file and then rebooting, but it still didn't seem to display
the .ico file properly. It was more of an oddity than anything else, as the
..exe *did* display the correct icon just fine.

Could it be that Vista's treatment of .ico files is different to .exe files
in terms of displaying large icons on the desktop?

Thanks,
Alex
 
Z

Zhi-xin Ye

Dear Alex,

I don't think Vista's treatment of .ico files is different to .exe files in
terms of displaying large icons on the desktop.

As I tested with both solutions I posted in my last reply on many Vista
machines, they all work fine.

Have you tried my solution 1? Maybe keeping the Windows Explorer off while
deleting the IconCache.db file would make some differences.

You can also try my solutions on another Vista machine or another account
to see whether this problem still exist or not.

I'm looking forward to hearing from you soon!

Sincerely,
Zhi-Xin Ye
Microsoft Managed Newsgroup Support Team

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
 
A

Alex Clark

Hi Zhi-xin,

This is the weirdest thing, but it's stopped working altogether now!

I have created my .ico file and I have followed your guidelines. In my .ico
file, I have:

256x256x32bit, PNG
128x128x32bit, PNG
64x64x32bit, no compression
64x64 256 colors, no compression
48x48 256 colors, no compression
32x32 256 colors, no compression
16x16 256 colors, no compression

Now, either as a .ico file or embedded as my application's main icon, I
cannot get it to display as a large icon. This is now happening either on
the Vista desktop or in a folder window!

I feel like maybe I changed something with the .ico file, but I can't think
what?

Does it make a difference that I'm on Vista Ultimate RTM and not SP1?

Kind regards,
Alex
 
A

Alex Clark

Hi Zhi-xin,

I tried your "solution 1" for clearing the icon cache (never knew that
little trick existed for exiting explorer, nice!) and it had the following
results:

1) It *did* work for my .exe - the large icon displayed perfectly straight
afterwards on the desktop and in the folder window

2) It does *not* appear to have worked for the .ico file. Interestingly, I
also have a shortcut to my app on the desktop and that doesn't display the
large icon either, however that was created during a Windows Installer setup
from before I altered the icon in my app, so I'm wondering if the installer
keeps its own copy of the icon somewhere when it creates that shortcut?

Thanks,
Alex
 
A

Alex Clark

Zhi-xin,

I just installed my application via an MSI package in Vista, and I have the
same problem. The shortcut it's placed on the desktop won't scale to large
sizes.

It seems the only way I can have success with large icons on the desktop is
to actually drop the .exe file there myself. .ico files, and shortcuts all
just seem to top out at 64 pixels.

I'd really appreciate some guidance on this. I can send you a sample icon
file if that would help?
 
Z

Zhi-xin Ye

Dear Alex,

I have tested this problem with the following steps and got the same result
as you.

On Vista machine:

1. In Visual Studio, create a new Windows Forms project.
2. Create a setup project to the same solution.
3. In setup project, switch to "File System" view.
4. Add project output to the setup project.
5. Add an icon file to the setup project.
6. Right click the Primary output and add a shortcut for it.
7. Drag the shortcut to "User's desktop" folder.
8. Select the shortcut, and switch to Properties Window.
9. On the "Icon" item, select the icon file added in step#5 for it.
10. Build the solution.
11. In the debug folder of the Setup project, double click the setup.exe
file to install.
12. Switch to desktop, there should be a shortcut newly created for the
this test project.
13. Press Ctrl key and wheel the mouse to make the icons on desktop larger.

The icon for the shortcut does not display images larger than 64x64,
however, the icon does contains a 256x256 PNG image in it.

Let's find what happened to the shortcut icon.

Right click on the desktop shortcut icon and select "Properties", in the
Properties window, we can see the "Target" property and "Change Icon.."
button are disabled.

In order to see the icon path of the shortcut, we can install the
application with DISABLEADVTSHORTCUTS argument set to 1, this can be done
with these steps:

1. Open a command window;
2. Use CD command to switch to the setup package directory.
3. Type the following command:

setup.exe DISABLEADVTSHORTCUTS=1

4. Start installing.

After this kind of installation, we should able to see the Target and icon
path of the desktop shortcut icon, the shortcut icon file path is something
like this:

%AppData%\Microsoft\Installer\{8AC8669A-7C22-4C2B-AE3B-5938A3616D00}>_6F6B44
AD047F2F4C4FB7CC.exe

which the exact path would be something like this:

C:\Users\(Your user
name)\AppData\Roaming\Microsoft\Installer\{8AC8669A-7C22-4C2B-AE3B-5938A3616
D00}>_6F6B44AD047F2F4C4FB7CC.exe

So, yes, your assumption is right, the Installer stores its own copy of
icon at this kind of path.

To change this default behavior, we can use the Orca tool to edit the Icon
table.

Steps for your information:

1. Download the Windows Installer SDK samples, tools, and documentation
from the following Web page:
http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-
A93E-40C0EC4F68E5&displaylang=en
2. Install the Orca editor by double-clicking the Orca.msi file in the
C:\Program Files\Microsoft Platform SDK\Bin folder.
3. Click Start, point to Programs, and then click Orca.
4. Click File->Open menu to open the .msi file you want to edit.
5. Select "Icon" from the Tables on the left panel.
6. On the right panel, double click the cell on the "Data" column.
7. Choose an icon(compatible with Vista) and click OK.
8. Save and close the Orca.

After these steps, uninstall the current application and install the
application again, you should find that the desktop shortcut icon can
display size larger than 64x64 now.

Below are related documents for your information:

[DISABLEADVTSHORTCUTS Property]
http://msdn.microsoft.com/en-us/library/aa368297(VS.85).aspx

[How to use the Orca database editor to edit Windows Installer files]
http://support.microsoft.com/kb/255905

[Specifying Shortcuts]
http://msdn.microsoft.com/en-us/library/aa372018(VS.85).aspx

[Icon Table]
http://msdn.microsoft.com/en-us/library/aa369210(VS.85).aspx

If I can be of further help, please don't hesitate to let me know.

Sincerely,
Zhi-Xin Ye
Microsoft Managed Newsgroup Support Team
=======================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
 
A

Alex Clark

Hi Zhi-xin,

I can confirm that this worked perfectly. Many thanks for your hard work.

Maybe MS would consider altering the Setup projects in VS2008 SP1 to correct
this?

Kind regards,
Alex Clark




Zhi-xin Ye said:
Dear Alex,

I have tested this problem with the following steps and got the same
result
as you.

On Vista machine:

1. In Visual Studio, create a new Windows Forms project.
2. Create a setup project to the same solution.
3. In setup project, switch to "File System" view.
4. Add project output to the setup project.
5. Add an icon file to the setup project.
6. Right click the Primary output and add a shortcut for it.
7. Drag the shortcut to "User's desktop" folder.
8. Select the shortcut, and switch to Properties Window.
9. On the "Icon" item, select the icon file added in step#5 for it.
10. Build the solution.
11. In the debug folder of the Setup project, double click the setup.exe
file to install.
12. Switch to desktop, there should be a shortcut newly created for the
this test project.
13. Press Ctrl key and wheel the mouse to make the icons on desktop
larger.

The icon for the shortcut does not display images larger than 64x64,
however, the icon does contains a 256x256 PNG image in it.

Let's find what happened to the shortcut icon.

Right click on the desktop shortcut icon and select "Properties", in the
Properties window, we can see the "Target" property and "Change Icon.."
button are disabled.

In order to see the icon path of the shortcut, we can install the
application with DISABLEADVTSHORTCUTS argument set to 1, this can be done
with these steps:

1. Open a command window;
2. Use CD command to switch to the setup package directory.
3. Type the following command:

setup.exe DISABLEADVTSHORTCUTS=1

4. Start installing.

After this kind of installation, we should able to see the Target and icon
path of the desktop shortcut icon, the shortcut icon file path is
something
like this:

%AppData%\Microsoft\Installer\{8AC8669A-7C22-4C2B-AE3B-5938A3616D00}>_6F6B44
AD047F2F4C4FB7CC.exe

which the exact path would be something like this:

C:\Users\(Your user
name)\AppData\Roaming\Microsoft\Installer\{8AC8669A-7C22-4C2B-AE3B-5938A3616
D00}>_6F6B44AD047F2F4C4FB7CC.exe

So, yes, your assumption is right, the Installer stores its own copy of
icon at this kind of path.

To change this default behavior, we can use the Orca tool to edit the Icon
table.

Steps for your information:

1. Download the Windows Installer SDK samples, tools, and documentation
from the following Web page:
http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-
A93E-40C0EC4F68E5&displaylang=en
2. Install the Orca editor by double-clicking the Orca.msi file in the
C:\Program Files\Microsoft Platform SDK\Bin folder.
3. Click Start, point to Programs, and then click Orca.
4. Click File->Open menu to open the .msi file you want to edit.
5. Select "Icon" from the Tables on the left panel.
6. On the right panel, double click the cell on the "Data" column.
7. Choose an icon(compatible with Vista) and click OK.
8. Save and close the Orca.

After these steps, uninstall the current application and install the
application again, you should find that the desktop shortcut icon can
display size larger than 64x64 now.

Below are related documents for your information:

[DISABLEADVTSHORTCUTS Property]
http://msdn.microsoft.com/en-us/library/aa368297(VS.85).aspx

[How to use the Orca database editor to edit Windows Installer files]
http://support.microsoft.com/kb/255905

[Specifying Shortcuts]
http://msdn.microsoft.com/en-us/library/aa372018(VS.85).aspx

[Icon Table]
http://msdn.microsoft.com/en-us/library/aa369210(VS.85).aspx

If I can be of further help, please don't hesitate to let me know.

Sincerely,
Zhi-Xin Ye
Microsoft Managed Newsgroup Support Team
=======================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no
rights.
 
Z

Zhi-xin Ye

Dear Alex,

I am not sure whether this will be altered or not in VS2008 SP1, I would
suggest you post this issue to our Connect feedback portal. Our developer
will evaluate it seriously and take them into consideration when designing
furture release of the product.

Here is the link for the Connect feedback portal:

http://connect.microsoft.com/VisualStudio/

Have a nice week!

Sincerely,
Zhi-Xin Ye
Microsoft Managed Newsgroup Support Team

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top