PDA

View Full Version : Allowing user to choose what shortcuts get installed...



neal007
01-07-2005, 03:26 PM
Using InstallShield 10.5 InstallScript MSI:

---

I'd like to allow my end users to choose if a Desktop shortcut, Quick Launch Bar shortcut, etc. is created or not. Rather then just doing it as it's configured as such easily in the InstallShield property pages, how can I add this (without being an InstallScript expert) so that end-users can choose what occurs in configuring the installation process prior to starting the install?

Muerte
03-31-2005, 05:57 AM
Seems Installshield don't have a straight answer regarding this issue.
You would imagine that it should be so MUCH SIMPLER for the to let a setup engineer ask the user whether some shortcuts should be installed or not.

Even Winamp's Installer (NSIS) can do this without hassle! It seems like such a simple thing, yet so complicated in Installshield. Unless I'm missing something ofcourse. Exactly how easy is it to create desktop shortcut, a quick launch shortcut and also ask the guy installing it whether he wants it or not?
:rolleyes:

RadhaK
03-31-2005, 06:47 AM
Hi,

You can create custom dialog with two options for creating shortcuts and Add a shortcut to the "Quick Launch" toolbar into the Taskbar

You can create shortcut using AddFolderIcon function, AddFolderIcon function inserts or replaces an icon in the program folder specified by szProgramFolder. If that program folder does not exist, AddFolderIcon creates it. szProgramFolder can specify a subfolder in a multi-level cascading menu. If the subfolder does not exist, AddFolderIcon creates the subfolder and, if necessary, its parent folders.

To know more about AddFolderIcon function and example, check the below Installshield Helpnet article

http://helpnet.installshield.com/Robo/BIN/Robo.dll?tpc=/robo/projects/installshield10-5langref/LangrefAddFolderIcon.htm

To Add a shortcut to the "Quick Launch" toolbar into the Taskbar try the following code

szQuickLaunchPath = FOLDER_APPDATA ^ "Microsoft\\Internet Explorer\\Quick Launch";
nReturn = AddFolderIcon(szQuickLaunchPath, szItemName, szCommandLine, szWorkingDir, szIconPath, nIcon, szShortCutKey, nFlag);

Muerte
03-31-2005, 04:15 PM
I'm sorry, I just find it extremely silly that I have to create a custom dialog for this, write the code to do the checking on the checkboxes and write code to create shortcuts. Maybe I'm expecting too much...

Once again I'll compare it to NSIS, "Would you like a desktop shortcut?", where is this shortcut pointing? That's it! No scripts, no custom dialog.
hmmmm.

You're expecting me to create a custom dialog, and actually write script to do this??

Thanks

neal007
03-31-2005, 04:17 PM
On top of that, some proprietary scripting language that is too hard to learn! This means for each and every developer, not only do you have to know your language of preference for development, but you have to learn a language for your freakin installer! Crazy! What I would hope is that InstallShield actually gets the clue some day and uses the CLR (.NET) for creating instalations, then we'd be set!

wyrdfish
04-01-2005, 06:18 AM
Most games i've seen ask if you want to install an icon to the desktop with a simple messagebox.


nReturn=MessageBox("Do you wan to Install a desktop shortcut",MB_ICONHAND|MB_YESNO);
if (nReturnValue=IDYES) then
//install shortcut
szQuickLaunchPath = FOLDER_APPDATA ^ "Microsoft\\Internet Explorer\\Quick Launch";
nReturn = AddFolderIcon(szQuickLaunchPath, szItemName, szCommandLine, szWorkingDir, szIconPath, nIcon, szShortCutKey, nFlag);
endif;

or if you need to be more explicit you can use the AskOptions standard dialogue.

nResult = AskOptions (NONEXCLUSIVE , "What shortcuts do you want?",
"Desktop", bDesktop,
"Quick Link", bQuickLink,
"Start Menu", bStartMenu);