/build/static/layout/Breadcrumb_cap_w.png

network shortcuts

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

Answers (7)

Posted by: MSIPackager 18 years ago
3rd Degree Black Belt
0
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,
Rob
Posted by: revizor 18 years ago
Third Degree Blue Belt
0
What kind of file? Exe?
May be "Run from Network" will cut it?
Posted by: packit 18 years ago
Senior Yellow Belt
0
Thank you MSIPackager, I will give the script a try.

Revizor,
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.
Posted by: jonasm 18 years ago
Blue Belt
0
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.

/Jonas
Posted by: turbokitty 18 years ago
6th Degree Black Belt
0
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.
Posted by: bheers 18 years ago
Second Degree Blue Belt
0
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.
Posted by: jonasm 18 years ago
Blue Belt
0
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"
objFso.CreateFolder(fname)
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"
objShortcutLnk.Save

------------------------

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!

/Jonas
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