Vista introduces a new environment variable called LOCALAPPDATA which doesnt exist on XP so I have to create it in an installer with InstallShield. This has to be a user environment variable as far as I know. Here comes 2 questions;

1. I want this environment variable to be available to all users. But if I put this under (type) system variables, %LOCALAPPDATA% doesnt work. If I put this under (type) user variables then it works. However, it will only create this for the user that installs the application. So how can I make this available to all users? Can IS help with this?

2. Since this environment already exists on Vista, I would like create it on XP only. I dont think IS enables me to put conditions directly environment variables table, right? Maybe I can do this, create an empty component and associate with this environment variable, and put a condition on the component so that it gets installed on XP only and doesnt overwrite the existing variable on Vista. Can anyone think of a better way?

Thanks!
0 Comments   [ + ] Show Comments

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.

Answers

0
So are you trying to create an Environment Variable on all of your XP machines called 'LOCALAPPDATA' so that you can use this variable in your packages to install specific files into this location? Or do you need it there for something else?

If you need it for your packages, I know that within Wise (someone will have to clarify this for me within IS) there is a directory called LocalAppDataFolder that you can use which will direct files to the same location.
Answered 10/20/2008 by: michaelnowell
Second Degree Blue Belt

Please log in to comment
0
ORIGINAL: JoderCoder
1. I want this environment variable to be available to all users. But if I put this under (type) system variables, %LOCALAPPDATA% doesnt work. If I put this under (type) user variables then it works.
That's because System variables are only activated after a reboot, because for some reason MS has omitted to have the WI engine propogate the message that the machine environment has changed.

In any event, why do you need to recreate the variable? It would be neater to create a custom property and use a SetProperty CA with a condition, setting it in XP to use '%USERPROFILE%\Local Settings\Application Data' or to just '%LOCALAPPDATA%' in Vista. Alternatively, find where in the package that variable is used and again substitute the appropriate location via a suitable condition. Either of these routes allow you to keep in step with MS's whims: almost without question, the next Windows release will have additional and/or changed EVs - how will you cope then? Always be defensive and try to think ahead. Sometimes, taking the longer route now will save you time in the future.
Answered 10/21/2008 by: VBScab
Red Belt

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