JerryD Posted April 2, 2008 Posted April 2, 2008 When you install a product like MS Office, the installer creates what I'll call "MSI Shortcuts". If you go to the properties of these shortcuts, the Target field is disabled and references only the program's name Product name (like "Microsoft Office 2003 Professional") rather than the actual EXE. The FileGetShortcut doesn't return the information as it does with a regular shortcut. What I'm trying to do is to read the MSI Shortcut and check to see if a shortcuts is still valid. I realize FileGetShortcut does return some kind of information, but does anyone know how to get ALL the pertanent informaion like what the actual target is for this kind of shortcut? Thanks.
LarryDalooza Posted April 2, 2008 Posted April 2, 2008 I'll look a bit... but I think you are referring to "Advertised Shortcuts" ... I think. Lar. AutoIt has helped make me wealthy
LarryDalooza Posted April 2, 2008 Posted April 2, 2008 found this tidbit of code so far ... nothing that gets right to the EXE path... $a = DLLCall("msi.dll","int","MsiGetShortcutTarget","str","C:\Documents and Settings\All Users\Start Menu\Programs\Microsoft Office\Microsoft Office Excel 2003.lnk", _ "str","","str","","str","") MsgBox(4096,"",$a[0] & @LF & _ $a[1] & @LF & _ $a[2] & @LF & _ $a[3] & @LF & _ $a[4]) Lar. AutoIt has helped make me wealthy
LarryDalooza Posted April 2, 2008 Posted April 2, 2008 Maybe you figure out how to apply this... You need to determine if it is an "Advertised" ... perhaps on failure of regular check... you use this.$a = FileGetShortcut("C:\Documents and Settings\All Users\Start Menu\Programs\Microsoft Office\Microsoft Office Excel 2003.lnk") MsgBox(4096,"",$a[0] & @LF & _ $a[1] & @LF & _ $a[2] & @LF & _ $a[3] & @LF & _ $a[4] & @LF & _ $a[5] & @LF & _ $a[6]) $a = DLLCall("msi.dll","int","MsiGetShortcutTarget","str","C:\Documents and Settings\All Users\Start Menu\Programs\Microsoft Office\Microsoft Office Excel 2003.lnk", _ "str","","str","","str","") MsgBox(4096,"",$a[0] & @LF & _ $a[1] & @LF & _ $a[2] & @LF & _ $a[3] & @LF & _ $a[4]) $b = DLLCall("msi.dll","int","MsiGetComponentPath","str",$a[2],"str",$a[4],"str","","dword*",1024) MsgBox(4096,"",$b[0] & @LF & _ $b[1] & @LF & _ $b[2] & @LF & _ $b[3] & @LF & _ $b[4])MsiGetComponentPath()http://msdn2.microsoft.com/en-us/library/a...112(VS.85).aspxMsiGetShortcutTarget()http://msdn2.microsoft.com/en-us/library/a...299(VS.85).aspx AutoIt has helped make me wealthy
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now