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!!!
Help needed!!!
0 Comments
[ + ] Show comments
Answers (17)
Please log in to answer
Posted by:
anonymous_9363
14 years ago
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.
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
Milindsm,
Just add the following VBScript custom action before CreateShortcuts CA and just enter your desired description data on the "<------desired data" line.
Cheers
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
Posted by:
milindsm
14 years ago
Posted by:
milindsm
14 years ago
Posted by:
Rheuvel
14 years ago
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.
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
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.
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
Posted by:
mayur_mak
14 years ago
Posted by:
milindsm
14 years ago
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
Posted by:
milindsm
14 years ago
Posted by:
pjgeutjens
14 years ago
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
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.
so that the conversation will remain readable.