Sign in to follow this  
Followers 0
MilesAhead

Set start menu group folder to custom icon

6 posts in this topic

I'm trying to find out how to programmatically set a start menu group folder to a custom icon when I install my program. I haven't been able to find any api call or script snippet in any programming language so far that shows how to connect a custom icon to the folder. I'm talking about the group folder in the start menu for the current user with an icon that will be copied into the install folder for the program.

Share this post


Link to post
Share on other sites



I'm trying to find out how to programmatically set a start menu group folder to a custom icon when I install my program. I haven't been able to find any api call or script snippet in any programming language so far that shows how to connect a custom icon to the folder. I'm talking about the group folder in the start menu for the current user with an icon that will be copied into the install folder for the program.

You should be able to do it by creating a desktop.ini file inside the folder. Use this format for the file.

[.ShellClassInfo]

IconFile=myicon.ico

ConfirmFileOp=0


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

You should be able to do it by creating a desktop.ini file inside the folder. Use this format for the file.

Seems to have no effect even on a desktop folder.

I'm thinking it's not easy because the tools that work with Inno Setup have the {group}\ prefix hard-wired so you can't put an icon for {group} itself.

Strange.

Share this post


Link to post
Share on other sites

You pointed me in the right direction. Thanks. This desktop.ini seems to do it

[.ShellClassInfo]

IconResource=icon.ico,0

Now I should just have to add it as a file in Inno Setup

Share this post


Link to post
Share on other sites

Seems to have no effect even on a desktop folder.

I'm thinking it's not easy because the tools that work with Inno Setup have the {group}\ prefix hard-wired so you can't put an icon for {group} itself.

Strange.

You have to set the file attribs for desktop.ini to +SRH. I'm not even positive that Windows will allow it in a start menu folder but I think it will because you can change it by right clicking the foler and choosing Properties >> ustomize tab >> Change Icon. As a matter of fact you can probably use that method and then copy the file that's created into your source folder. Just make sure that you don't allow Inno to change the attributes. Also remember that you can't place a file into the {group} folder until after the folder has been created. You might have to do it as a post install operation.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

You have to set the file attribs for desktop.ini to +SRH. I'm not even positive that Windows will allow it in a start menu folder but I think it will because you can change it by right clicking the foler and choosing Properties >> ustomize tab >> Change Icon. As a matter of fact you can probably use that method and then copy the file that's created into your source folder. Just make sure that you don't allow Inno to change the attributes. Also remember that you can't place a file into the {group} folder until after the folder has been created. You might have to do it as a post install operation.

The funny thing is, the lame way I did it worked in Vista 32 bit. The other way with setting the folder as system and all that didn't work in Vista64. So I reverted back. It's just too much hassle to get an icon that won't show up until after a logoff anyway.

Inno does the secondary folders for you. Guess I'll just go with it the way I had it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0