This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- How do I find all users' documents folders from an installscript project?
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jun 18, 2009
08:00 AM
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.
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.
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jun 18, 2009
11:30 AM
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.