 |
|
|
 |
|
 |
I have tested your solution and it still works with VS2010 and later versions!
The template to create *.res files still available in VS2010 along with *.rc format!
Thanks for your article!
|
|
|
|
 |
|
 |
Well done. The method maps over to VS2008 pretty easily.
|
|
|
|
 |
|
 |
Hi,
how does it work with Visual Basic 2008 express?
I looked everywhere, but I just can't find Step1 for creating the "Native Resource Template"
Is the express Edition not capable to create Native Resource Templates ?
Thanks a lot!
bye, Joerg.
|
|
|
|
 |
|
 |
I don't think that VB supports it. If you wanted to create a Native Resource Template you'll probably have to do it in the C++ express edition and import it into one of the others.
I doubt it. If it isn't intuitive then we need to fix it. - Chris Maunder
|
|
|
|
 |
|
 |
Very good article and I appreciate your investigation. I started using this in one of my own projects to embed a second icon for my program's Start menu Uninstall item (my program knows how to uninstall itself given a /u parameter.) However, by using a .res file and changing the Properties "Resources" to use a Resource file, you've now overridden the information specified in the AssemblyInfo.cs file. Most of the [assembly: ...] attribute directives are now ignored. This means that attributes such as AssemblyCompany and AssemblyCopyright are no longer visible in the File Properties dialog. Worse, this breaks the upgrade feature of Deployment project .msi setups files since we no longer have a link to AssemblyVersion. By switching the project Properties Resources back to a simple icon, the compiler once again considered the AssemblyInfo attributes and the .msi upgrade started working. So while I'm sure this is useful for many people, many others should be aware of these caveates. Kind Regards P.S. For my multi-icon dilema, I ended up deploying a second icon in the install directory that I could bind to my Uninstall Start menu item. It means there's an extra .ico file out there but OK.
|
|
|
|
 |
|
 |
Hello, Steven.
Your message served as a good warning when I read it a few months ago. With the caveat that I am still fairly new to deployment, I believe this issue can be worked around. In VS2008 (not sure about VS2005) one can add version information to the resource file, just as one can add Icons, Bitmaps, Strings, and other resources.
Right-clicking on the .exe and displaying its properties shows the version information, as defined in the version resource.
Things seem to be going OK with deployment and upgrading. I would welcome any comments or suggestions.
Mike
|
|
|
|
 |
|
 |
There is no resources box on the application tab. And putting it in the resources tab doesn't work.
|
|
|
|
 |
|
 |
This is a fabulous article, but now that I have a .res file with four icons in it, how do I get any of them other than the first to show up in Windows Explorer?
Specifically I've got one big project that I build four different ways with four Configurations. The code is nearly identical for all four builds except where I use #if...#endif to check for one of four conditional compilation symbols assigned to each configuration.
Now instead of changing the Resources / Icon and Manifest / Icon setting between each build, I have just one entry in the Resources / Resource file field, which indicates my Win32Resource I built thanks to your article. However, I want to extract a certain one of the four icons inside it for each of my 4 configurations.
I think this article stopped short of showing how to do that. Thanks!
Jeff Elliott
Pres & Owner, C Guru, Inc.
|
|
|
|
 |
|
 |
From what I remember the first icon in the list will be the one which is displayed in Windows Explorer (i.e. the one with the lowest index). The others should be visible if you're using explorer to create a shortcut to the program then you can specify which icon you want to use in the shortcut properties. Usually gives the file path followed by a , and then the icon index.
J. Elliott wrote: I think this article stopped short of showing how to do that. Thanks!
Would be a good expansion, e.g. different icons for debug builds etc. I'm not sure how this could be accomplished, perhaps by a custom build action or pre/post build tasks.
One method I can think of off the top of my head would be:
- Create a folder with all the resource files with one named for each configuration
- In the pre-build event write a small script which copies
Resources\$(ConfigurationName).res to a default location
- Link the default location as the resource file for the project
I doubt it. If it isn't intuitive then we need to fix it. - Chris Maunder
|
|
|
|
 |
|
 |
Good ideas. I'll try them shortly. (My first post here ever, BTW!)
Jeff Elliott
Pres & Owner, C Guru, Inc.
|
|
|
|
 |
|
 |
Finally an Icon Embedding tutorial that's TO THE POINT!
|
|
|
|
 |
|
 |
Thanks, I prefer short and to the point stuff. My pet hate is screen casts, mainly because I'm a fast reader and can read much faster than most people can speak...
|
|
|
|
 |
|
|
 |
|
 |
So you prefer doing 6 additional steps for every rebuild of the project as opposed to a couple to start with?
I doubt it. If it isn't intuitive then we need to fix it. - Chris Maunder
|
|
|
|
 |
|
 |
In the Resources tab of the Project Properties page, there is no option to import .res files. The only workaround I could find was to use a /win32resource compiler switch. More details in this thread[^].
|
|
|
|
 |
|
 |
Take a look at this[^] screenshot.
Sorry I don't have VS2005 around so can't point it out.
|
|
|
|
 |
|
 |
Is there anyway to embed 32-bit icons?
|
|
|
|
 |
|
 |
I think that that may be a problem with VS2005, if you try and edit 32 bit icons it complains about it. Unfortunately I don't have the time at the moment to investigate.
Do you get an error message or anything in particular?
|
|
|
|
 |
|
 |
Good one and informative too.
|
|
|
|
 |
|
 |
Step 2.2:
There's no "Resources" group box in the properties of VB.NET project (and I've never seen it there before)...
modified on Tuesday, May 5, 2009 4:10 AM
|
|
|
|
 |
|
 |
It's actually a tab along the left side:
Application*
Compile
Debug
References
Resources
Settings
Signing
Security
Publish
|
|
|
|
 |
|
 |
Nice one dude..
Thanks and Regards,
Anand.
|
|
|
|
 |
|
 |
Ah well, C# it is then . I hadn't checked but the win32 resource thing is a feature of the C# compiler. I don't know if there's one for VB.NET. Normally if you were doing this from the command line you'd do
csc.exe /win32res:application.res
|
|
|
|
 |
|
 |
Sorry that wasn't meant to be posted under your message but the one above.
|
|
|
|
 |