Showing posts with label shortcut. Show all posts
Showing posts with label shortcut. Show all posts

Monday, March 26, 2012

Creating a SendTo Shortcut through MSI

If you want to create a SendTo shortcut through MSI, then if you just add the shortcut in MSI in SendTo folder, it will not work. Even if you get the shortcut there in every user profile, still it will not work. To make a SendTo shortcut, you need to create it on the fly, which means that shortcut should be created from original exe. To solve this issue for one of my application, WinSCP, I wrote the below VBScript and placed it in %ALLUSERPROFILE%\WinSCP folder. Then I created an Active setup to call this VBScript.


Set Shell = CreateObject("WScript.Shell")
ShortcutPath = Shell.SpecialFolders("SendTo")
Set link = Shell.CreateShortcut(ShortcutPath & "\WinSCP (for upload).lnk")
link.Arguments = "/upload"
link.Description = "WinScp"
link.HotKey = ""
link.IconLocation = "C:\Program Files (x86)\WinSCP\WinSCP.exe,0"
link.TargetPath = "C:\Program Files (x86)\WinSCP\WinSCP.exe"
link.WindowStyle = 3
link.WorkingDirectory = "C:\Program Files (x86)\WinSCP"
link.Save


To delete this SendTo shortcut, I wrote another script and added an active setup registry key through CA during Remove sequence to run this script.


dim filesys
Set filesys = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("WScript.Shell")
sup = oShell.ExpandEnvironmentStrings ("%APPDATA%")
WinSCPlnk= sup & "\Microsoft\Windows\SendTo\WinSCP (for upload).lnk"
If filesys.FileExists(WinSCPlnk) Then
filesys.DeleteFile WinSCPlnk
End If


Also remember to make the above component as permanent, because you do not want to delete this vbs file at uninstall of application.

Tuesday, August 16, 2011

Shortcut creation issue in Installshield/WISE Package Studio


IIS Express 7.5 is a vendor MSI package and the MSI is created by WiX. Though there is no problem as such while

customizing this application, but I found an issue while adding a shortcut to this application.
While creating IIS Express 7.5 package recently, I faced an issue that I was not able to add shortcut in this

application.

This for the matter of fact I realized that the shortcut table did not exist in this application. The error which

I was getting was "Field shortcut of table shortcut: Error retrieving shortcut of table"
To get this error fixed, I added the shortcut table and following entries in _Validation table:



After adding this I added CreateShortcuts Action in InstallExecuteSequence Table at Sequence 4500. This was

because, since there was no shortcut table, the sequence too was missing from MSI. Due to this the shortcut was

not getting created.

Once I did both these things, the application is installed fine with the shorcut.

This can be used with other missing tables as well. We need to add the entries in _Validation table for all the

tables which are missing for its every corresponding column.

Hope this will help you if you face similar issue in future.

Wednesday, August 10, 2011

Issues while launching and closing of App-V shortcuts

While launching your App-V shortcut, if you notice that the buffering launch on bottom right says 100% but the

launch does not disappear as per normal behaviour then you need to do some modification in your osd file.

This possible is a cause if your application is Java related. You need to modify the Subsystem value in your osd

file.
By default the osd file has this:

<subsystem VALUE = "windows"/>

You need to change this value to

<subsystem VALUE = "console"/>

If you face a similar problem while closing the application or your application does not close completely, then

you need to again tweek your osd file.

By default you have following in your OSD file:

<virtualenv TERMINATECHILDREN="FALSE">

You need to change the value as below:

<virtualenv TERMINATECHILDREN="TRUE">

This will terminate the any child application which is associated with this application and will help to shut

your application down.