This Blog is for all people working or related to the MSI and App-V.
There are lots of issues we face in everyday work regarding the technology. The sole purpose of my blog is to help others with whatever I learn. All you people out there, please help by commenting, voting, propagating and sharing my blog with your friends and colleagues but with due credit and acknowledgement to the material posted here with my name and blog url as I still do hold the copyright of the posts here.
Thursday, April 19, 2012
VBScript to determine Root Drive
As per best practices we should not hard code the Root Drive in our package. If your package goes to multiple machines having different Root Drives, then you can use this simple VBScript in your package as Custom Action and it will set the Root Drive automatically for that machine.
This script picks up the Root Drive from where Program Files folder is installed.
Set oshell=CreateObject("Wscript.shell") prog=oshell.ExpandEnvironmentStrings("%ProgramFiles%") vletter=Split(prog,":") dletter=vletter(0)
& ":\" session.property("ROOTDRIVE")=dletter