/build/static/layout/Breadcrumb_cap_w.png

Shortcut Description

I have added a shortcut to Program Menu Folder. It gets created properly. Now I would like to show installation path as a tool-tip of this shortcut when user moves mouse pointer over it. I tried setting Description column in Shortcut table to TARGETDIR, [TARGETDIR], INSTALLDIR etc. but it is not showing the installed path.

Help needed!!!

0 Comments   [ + ] Show comments

Answers (17)

Posted by: anonymous_9363 14 years ago
Red Belt
2
I don't normally recommend such things but this has gone on long enough. Desperate times call for desperate measures.

There are a gazillion scripts around for creating shortcuts. Use one of those in a Custom Action, suitably adapted to get the INSTALLDIR property(using the 'Session.Property'....er....property) to populate the Description field.
Posted by: package_aligator 14 years ago
Orange Belt
2
Milindsm,
Just add the following VBScript custom action before CreateShortcuts CA and just enter your desired description data on the "<------desired data" line.


Dim msinstaller
Dim database
const msiViewDelete = 6
const msiViewModifyInsertTemporary = 7

Set msinstaller = Session.Installer
Set database = Session.Database

Set view = database.OpenView("select * from `Shortcut` WHERE `Shortcut`='psexec.exe'")
View.Execute
Set record = View.Fetch
view.Modify msiViewDelete, record
Shortcut = record.StringData(1)
Directory = record.StringData(2)
Name = record.StringData(3)
Component = record.StringData(4)
Target = record.StringData(5)
Arguments = record.StringData(6)
Description = record.StringData(7)
HotKey = record.StringData(8)
Icon = record.StringData(9)
IconIndex = record.StringData(10)
ShowCmd = record.StringData(11)
WkDir = record.StringData(12)
View.Close

set view = database.OpenView("select * from `Shortcut`")
view.Execute
Set Record_new = msinstaller.CreateRecord(12)
Record_new.StringData(1) = Shortcut
Record_new.StringData(2) = Directory
Record_new.StringData(3) = Name
Record_new.StringData(4) = Component
Record_new.StringData(5) = Target
Record_new.StringData(6) = Arguments
Record_new.StringData(7) = session.property("INSTALLDIR") ' <------desired data
Record_new.StringData(8) = HotKey
Record_new.StringData(9) = Icon
Record_new.StringData(10) = IconIndex
Record_new.StringData(11) = ShowCmd
Record_new.StringData(12) = WkDir
view.Modify msiViewModifyInsertTemporary, Record_new
view.Close

set database = Nothing


Cheers
Posted by: Hussi 14 years ago
Purple Belt
0
Milind its possible for non advertised shortcut .you can write property INSTALLDIR in Target column of shortcut table
Posted by: milindsm 14 years ago
Blue Belt
0
And how to you make it non-advertised?
Posted by: milindsm 14 years ago
Blue Belt
0
BTW, Are you sure its Target column. I think its Description column
Posted by: Hussi 14 years ago
Purple Belt
0
Description column is unable to resolve the property [INSTALLDIR].
Posted by: milindsm 14 years ago
Blue Belt
0
I tried adding INSTALLDIR & [INSTALLDIR] to Target column and it didn't even create Program Menu entry
Posted by: Rheuvel 14 years ago
Brown Belt
0
For a non-advertised shortcut, the installer evaluates this field as a Formatted string. The field should contain a property identifier enclosed by square brackets ([ ]), that is expanded into the file or a folder pointed to by the shortcut.

Source: http://msdn.microsoft.com/en-us/library/aa371847(VS.85).aspx


And make sure non-advertised shortcuts are really what you want. Think of user settings which might not be repaired because your MSI could simply miss a trigger for that to happen.
Posted by: mayur_mak 14 years ago
Senior Purple Belt
0
Hello milindsm,

If you are having a non-advertised shortcut then you can define a Property such as SHORTCUT in the Property table and its value such as c:\program files\... i.e your INSTALLDIR which you want to display via tool-tip and place this property as [SHORTCUT] in the target column of shortcut table.
Posted by: MSI* 14 years ago
Senior Yellow Belt
0
I dont think that you can provide such variables in description column. This field only accepts strings and does not resolves variables into values. You will have to give it as string only..properties will not resolve.

Rgds,MSI*
Posted by: mayur_mak 14 years ago
Senior Purple Belt
0
Hello MSI*,

I got it what u said is correct.The target field will set the path.
Posted by: milindsm 14 years ago
Blue Belt
0
I dont think that you can provide such variables in description column. This field only accepts strings and does not resolves variables into values. You will have to give it as string only..properties will not resolve.

Then how should I handle this case if I want to copy installation path (specified by the user at run time) in description column?

EDIT: I tried adding [INSTALLDIR] value in Target column, it didn't even create the shortcut.
Posted by: package_aligator 14 years ago
Orange Belt
0
Forgot to mention: in the script above I modify a shortcut named "psexec.exe", in your case just modify the corresponding field with your shortcut name.
Posted by: milindsm 14 years ago
Blue Belt
0
Hey Thanks a lot...!!!! It worked ...!!! :)
Posted by: milindsm 14 years ago
Blue Belt
0
Sorry guys.... starting it again... It'd worked long back... I don't remember the CA type... I tried 6, 1030 (1024+6), 3078 (3072+6) .... still no results...!!!
Posted by: milindsm 14 years ago
Blue Belt
0
Experts...!!!
Posted by: pjgeutjens 14 years ago
Red Belt
0
Milind,

the CA type depends on too many variables for us to just tell you what it is. Have a look here for a complete list of options (script type and location, execution option, return code processing) and break out your calculator...

PJ
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ