How can I force my MSI pacakge to install a shortcut pointing to a file on my network even if the drive that the shortcut is pointing to is not mapped? I use AdminStudio 5 and deploy my apps via SMS. Thanks for the help!
0 Comments   [ + ] Show Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.


Create vbscript/s (running the network exe/s) set your shortcuts pointing to the script/s - you can only advertise a shortcut to a file if it is part if your MSI..

This should do it:


Option Explicit
Dim objShell : Set objShell = Wscript.CreateObject("Wscript.Shell")
objShell.Run "s:\apps1\app1.exe" , 0, True


Don't forget to quote your quotes if the network path has spaces e.g. objShell.Run """s:\apps store1\app1.exe""" , 0, True

Hope it helps,
Answered 10/06/2005 by: MSIPackager
Third Degree Black Belt

Please log in to comment
What kind of file? Exe?
May be "Run from Network" will cut it?
Answered 10/06/2005 by: revizor
Third Degree Blue Belt

Please log in to comment
Thank you MSIPackager, I will give the script a try.

Yes it is an .EXE file. Why does that matter?

What do you mean by "Run from network" will cut it???

Even though I packaged the shortcut within my MSI it will not actually get installed unless the file is available via the exact path that I packaged it with. Meaning the exact drive letter mapping to the exact share that the driver letter was mapped to during repackaging process.
Answered 10/06/2005 by: packit
Senior Yellow Belt

Please log in to comment
One way, maybe not "by the book" tho, is to make the shortcut when you have the drive mapped. Then copy the lnk-file and add it to your packages as a file instead of a shortcut.

Answered 10/06/2005 by: jonasm
Blue Belt

Please log in to comment
Jonas is right, and you don't have to map a drive first.
Just put the UNC path and name of the file in the shortcut target. Then put the .lnk file in your project.
Answered 10/11/2005 by: turbokitty
Sixth Degree Black Belt

Please log in to comment
You can also advertise these shortcut to shortcuts. One thing you have to make sure is that they are .lnk file, sometimes drag and drop copies the .exe from the network location into the project.
Answered 10/12/2005 by: bheers
Second Degree Blue Belt

Please log in to comment
If you prefer VBS, you can use this script as a CustomAction to make the shortcut:


Set WshShell = CreateObject("WScript.Shell")
Set objFso = CreateObject("Scripting.FileSystemObject")
on error resume next
strStartTopPath = WshShell.SpecialFolders("AllUsersPrograms")

' Create Startmenu folder
fname=strStartTopPath & "\ProgramName"
Set objShortcutLnk = WshShell.CreateShortcut(fname & "\Program.lnk")

' Create Icon
objShortcutLnk.TargetPath = "P:\Program\Program.exe"
objShortcutLnk.WorkingDirectory = "P:\Program"
objShortcutLnk.WindowStyle = 1 ' 1=Normalt, 3 = Max, 7 = Mini
objShortcutLnk.IconLocation = "P:\Program\Program.EXE, 0"


I have noticed that if you have spaces in the link, this VBS will act strange if you don't have the specified driveletter mapped. A solution is to make a substitute for the network drive to for example c:\: subst p: c:\

Remember that if you using this script, the shortcut will NOT be removed on uninstall!

Answered 10/12/2005 by: jonasm
Blue Belt

Please log in to comment
Answer this question or Comment on this question for clarity