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?