Results 1 to 3 of 3

Thread: Inno Setup, {userdocs} and admin/regular user problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2009
    Posts
    2

    Inno Setup, {userdocs} and admin/regular user problem

    Hi!
    Does anyone know a way to access the "My Documents" or "Documents" (depending on the OS) of the user that is logged in, NOT the administrator user who logged in for the installer/uninstaller.
    So my problem is this:
    1) User X who is a regular user starts the uninstall
    2) Some admin user Y gives the rights to that uninstall to start (in Vista)
    3) When accessing {userdocs} it's the docs of user Y, NOT user X!

    This is really ripping me off...
    Thanks in advance!

  2. #2
    Hyperactive Member Quiver318's Avatar
    Join Date
    Sep 2007
    Posts
    260

    Re: Inno Setup, {userdocs} and admin/regular user problem

    I may be wrong, but I doubt you can fix this in Inno Setup since you are basically changing user contexts when you RunAs Administrator.

    Maybe if you use the feature to run programs before and after an Inno installation will help. Just put in a small program that adds the user to the Local Administrator Group, and then removes the user from the group when the installation is over. I think you could do this with VB Script, WMI, or ADSI pretty easily. It would still require authentication from the Admin which would run in the Administrator context, but would leave the installer to run in the current context, if you know what I mean.

    Good luck.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2009
    Posts
    2

    Re: Inno Setup, {userdocs} and admin/regular user problem

    Thanks for the answer!
    I had to come up with something allready because I was in a major hurry, so what we did was to kindly remove the user data for our program from ALL users that have used the program on that computer (of course with a possibility to leave the data there). The files that are removed are not that important, so this is not a problem. And more so, the program installs itself to all users and unistalls from all users so it's quite logical even.

Posting Permissions

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



Click Here to Expand Forum to Full Width