Variable Install Directory
Hello all,
First off all, disclaimer, I am a packaging noob, just getting my feet wet with this process, so bare with me.
I am trying to package an application with 2 different directories created when installed, the first one is the core install dir, and not an issue. the second directory is where my headache is. It's a network storage folder for all of the user data generated in this application, and the kicker is the target folder name needs to be named after the logged in user, And, these folders are pre-created by a login script unrelated to the MSI I am building.
So, essentially I need the second directory to find the logged in username folder on the network drive and install to it, but it also needs to be universal so it can be deployed en mass.
I tried to be as clear as I could be, if I wasn't I will try to clarify. I am using Adminstudio to create the package, and the application in question is Accumap by IHS.
Thanks for any and all assistance!
Answers (3)
use a SetDirectory custom action, and set the new target to be: \\servername\whatever\[%USERNAME]
I'm assuming you are installing this while the user is logged into the computer. Here is a little VBScript that I have that can get the name of the current logged in user.
strComputer = "."
who = "winmgmts:{impersonationLevel=impersonate}!//"& ComputerName &""
Set Users = GetObject( who ).InstancesOf ("Win32_ComputerSystem")
For each user in Users
Wscript.echo user.username
Next
Hopefully you can use this to dynamically set the install directory.
....you could also use a SetDirectory custom action, and set the new target to be: \\servername\whatever\[%USERNAME]
Comments:
-
That did it, I was a bit of a tool, and did not include the full path. Thanks! - ostentatiousbadger 12 years ago