Get folder Location in Vista

Got a problem you cannot solve? Try here.
Post Reply
seanmckenna
Posts: 46
Joined: Tue Aug 22, 2006 9:16 am
Location: NorthEast, USA
Contact:

Get folder Location in Vista

Post by seanmckenna »

I am trying to get the 'Local User Data' folder in XP and in visa, and I can't find out how to do this. This is the folder I'm interested in:

XP: "C:\\Documents and Settings\\<username>\\Local Settings\\Application Data"
Vista: "C:\\Users\\<username>\\AppData\\Local"

I have tried all the options for Get Folder Location, but none of them will give me this path. In .net, I can get this folder with the following code:

System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData);

Thank you.
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

I think you can obtain this path from either the registry, or using Get Folder Location and then the Extract Path command. Let me know if none of these cover your situation!
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
seanmckenna
Posts: 46
Joined: Tue Aug 22, 2006 9:16 am
Location: NorthEast, USA
Contact:

Post by seanmckenna »

Thanks, but I can't find anything that will work with Get Folder Location. When I use Application Data Directory, I get the folder "C:\\Program Data" in vista, which is not what I want.

Isn't there some way to get the user's folder? Thanks.
H4nd0
Posts: 92
Joined: Thu Nov 09, 2006 8:16 am
Location: Sydney, AU
Contact:

Post by H4nd0 »

It shouldn't matter. Vista sets up Junction points for backwards compatibility. Do a dir /a:h in C:\\ and in your user directory and you will see them.
ktroost
Posts: 3
Joined: Thu Sep 13, 2007 9:05 am

Post by ktroost »

I also need to get the folder location:
C:\\Documents and Settings\\<username>\\Local Settings\\Application Data
or "C:\\Users\\<username>\\AppData\\Local" when using Vista

When uninstalling, my application leaves some files that were created after the install in a subfolder of the above folder.

Is it possible to retrieve this location? I have tried all options using Get Folder Location command. Please help...

Edit: I found out that %localappdata% holds the right folder location for Vista can you make an addition to the Get Folder Location command for this?
SimonL
Posts: 3
Joined: Wed Feb 06, 2008 9:43 pm

Local Appdata in XP and Vista

Post by SimonL »

I can get the Local Data directory in Vista by parsing the Appdata location and pruning the Roaming string, that doesn't work for XP though.

I'd also like the %localappdata% location added to the GetFolder command.
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Re: Get folder Location in Vista

Post by MichaelNesmith »

This behavior has been updated in InstallAware 9 R2 as follows: the Get Folder Location command now has a new parameter to directly obtain this folder path on all operating systems directly.

Please help yourself to a release candidate of InstallAware 9 R2 to ensure it works to your satisfaction:
www.installaware.com/forum/viewtopic.ph ... 3&start=30
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Post Reply