PDA

View Full Version : Dynamic Desktop Icons



MicheleB
02-23-2006, 06:23 PM
What is the best way to dynamicallt install desktop icons?

I have a variety of applications that may or may not be installed depending on the user's custom setup. I have a dialog box with radio buttons to get the user input (Yes/No). I want to be able to only setup the desktop icons for the applications that the user has chosen to install.

Thanks!
Michele

Zangow
02-24-2006, 10:27 AM
If you have the radio boxes, you find find out which options they want and within some sort of "if" statement, create the icons with AddFolderIcon().
For example, if they want application X, you could do:

AddFolderIcon(FOLDER_DESKTOP, // constant variable for install shield
IconName, // the name to appear under the icon
FullPathToApplication, // full path like "C:\program files\...\x.exe"
WorkingDirectory, // where files for x exist or put "" (null string) to make
// the directory containing the program file the working directory
PathToIcon, // full path for the icon picture
0, // icon ordinal - 0 displays the first icon in the executable
"", // Any shortcuts for it - "" for none
REPLACE ); // flag - can be REPLACE, RUN_MAXIMIZED, RUN_MINIMIZED
// and/or NULL - use | to separate multiple options

As far as checking the radioboxes, I'd verify them when the Next button is hit. Hopefully that helps a little, if not, I may have misunderstood the question.

Aflaat
02-27-2006, 10:16 AM
You can also create components for each shortcut and put a condition on each component which is equal to the radio button.