Community Forums
Results 1 to 2 of 2

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

  1. #1
    Join Date
    Jun 2009

    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.

  2. #2
    MichaelU's Avatar
    MichaelU is offline InstallShield Software Engineer
    Join Date
    Jan 2004
    Schaumburg, IL
    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.
    Michael Urman - Staff Software Engineer - Flexera Software: InstallShield Team

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts