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

Extract Shortcuts from MSI


8 replies to this topic

Samuel Taylor

Samuel Taylor
  • Full Members
  • 5 posts

Posted 07 March 2008 - 10:35

Good Morning Everyone,

I want to extract shortcuts from a MSI using VBScript. Does anyone have any idea?

Thanks for your time
Sam
EasyAD - Making desktop managing easier - http://lizzardware.net

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 07 March 2008 - 12:44

If I were you, I'd download the SDK. That will install a bunch of scripts that will serve as excellent tutorials for your requirement.

As a pointer, you'd want to alter the query you'll find in at least one of those scripts to query the 'Shortcut' table.
- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.

Samuel Taylor

Samuel Taylor
  • Full Members
  • 5 posts

Posted 07 March 2008 - 13:30

Thanks for the quick reply, what is the SDK called, is it available off microsoft site?

Cheers
Sam
EasyAD - Making desktop managing easier - http://lizzardware.net

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 07 March 2008 - 13:41

Yes, it's a free d/l from MS. It's called 'Windows Installer SDK'. A Google will turn up the URL.
- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.

Samuel Taylor

Samuel Taylor
  • Full Members
  • 5 posts

Posted 10 March 2008 - 22:55

I'm still a bit stuck on this problem, could anyone post any simple example source code.

Thanks for your time.
Sam

Edited by Samuel Taylor, 10 March 2008 - 22:56.

EasyAD - Making desktop managing easier - http://lizzardware.net

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 11 March 2008 - 10:43

I don't have sample code at hand. Did you look at the sample scripts in the SDK? They show how to manipulate the installer database. You'd have to read the contents of the Shortcut table to get the parameters for the shortcuts.
Note that the msi file doesn't "contain" shortcuts (.lnk files) but instead a database with parameters for the shortcuts. At install time the engine creates the shortcuts using these data.
Note also that the shortcut table uses directory references that may not represent real directories unless the package is actually installed.
BTW why do you need to extract shortcuts?

Samuel Taylor

Samuel Taylor
  • Full Members
  • 5 posts

Posted 11 March 2008 - 13:58

QUOTE (Stefan Krueger @ 2008-03-11 10:43)
BTW why do you need to extract shortcuts?

I want to extract the shortcuts, so I can build custom Start menus. I writing an application that will extract the shortcuts, sort the shortcuts in to a group, then once a user login a login script will grab the corrent groups to make a start menu.

Cheers
Sam
EasyAD - Making desktop managing easier - http://lizzardware.net

Samuel Taylor

Samuel Taylor
  • Full Members
  • 5 posts

Posted 12 March 2008 - 23:35

Could packages contain custom directory references? Could I extract the default references?

Cheers
Sam
EasyAD - Making desktop managing easier - http://lizzardware.net

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 13 March 2008 - 13:20

The directory structure is defined in the Directory table.