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)
Please log in to answer
Posted by:
MSIPackager
19 years ago
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
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:
packit
19 years ago
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.
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
19 years ago
Posted by:
turbokitty
18 years ago
Posted by:
bheers
18 years ago
Posted by:
jonasm
18 years ago
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
---------------------
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.
so that the conversation will remain readable.