cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
pfw___
Level 2

How do I find all users' documents folders from an installscript project?

I have an installscript project which needs to install a number of files in the user's Documents area (e.g. "My Documents" on XP). If the all users option is selected during the upgrade then it needs to do this for all users.

I can't see any easy way of targetting these folders. I was hoping there would be some predefined target directory I could use for the files in the installshield project, but there doesn't seem to be a way of doing this, so I'm trying to script it. Effectively what I need to do is:


get a list of all users
for each user
- get My Documents folder for user
- copy some files to My Documents folder


At the moment my script makes assumptions about each documents folder being under the same root dir (e.g. "C:\documents and settings\username"). But I don't believe this is portable, and it won't work if the user has moved their documents directory somewhere else.

Browsing the forums it looks like I can call SHGetFolderPath(..., CSIDL_PERSONAL,...), however this will only get the My Documents folder for the current user, not any user.

What I need is something like getMyDocumentsFolder(userName). Does anything like this exist? Or is there any easier way - how is this problem usually tackled in IS2009?


Many thanks

-- Paul.
Labels (1)
0 Kudos
(1) Reply
MichaelU
Level 12 Flexeran
Level 12 Flexeran

Between roaming profiles and other problems, this isn't technically possible. You should probably install these files as templates to a shared theoretically read-only location, and have the application copy them to the per-user location when it runs.
0 Kudos