Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

shortcut....


2 replies to this topic

Charly

Charly
  • Members
  • 1 posts

Posted 13 September 2002 - 10:56

hello

i will create a dynamic shortcut (folder). user must change it i a dialog.
the system variable SHELL_OBJECT_FOLDER dosn´t works ny using in the Display Name! i have also try to  change the table "Directory" at RunTime with no success !

How can i do it ?

BRY

BRY
  • Members
  • 44 posts

Posted 09 October 2002 - 10:57

Hi Charly,

I sapent a lot of time trying to figure out how to do this, and eventually I managed!

Try creating a folder in the "Directory" table, with the following properties (without the quotes):
Directory: "STARTMENUFOLDER"
Directory_Parent: "ProgramMenuFolder"
DefaultDir: "."
ISDescription: "The Shortcut Folder"
ISAttributes: "0"

When you display your dialog asking the user where they want their shortcuts to go ("MyFolder"), then create a bit of script for the following:

INT iBufSize;
STRING szFullPath, szStartMenuFolder, szUserInput;
MsiGetProperty(hMSI, "STARTMENUFOLDER", szStartMenuFolder, iBufSize);
szFullPath = szStartMenuFolder^szUserInput;
MsiSetProperty(hMSI, "STARTMENUFOLDER", szFullPath);

This code is taking the default location of STARTMENUFOLDER (which is the Start\Programs folder), and adding on whatever the user has specified (Start\Programs\MyFolder)

When creating your shortcut, make its location to be STARTMENUFOLDER and then it should be created in the correct place.

Hope this helps.
If not, mail me direct, and I'll see if I've missed anything - it definitely works for me.
Bryan Dickson
[br]Senior Software Engineer
[br]Fugro-UDI Limited

doudou

doudou
  • Members
  • 2 posts

Posted 05 November 2002 - 05:25

Great BRY!
I figured out the same way to do this. We were happy if it'd not be a hook:
all shortcuts created this way and their shell folder ARE NOT DELETED on uninstall, if ALLUSERS was set to 2 (i.e. an admin had been installing it for "All users of this computer")