Inno Setup: How to get the current user directory when starting the installer as administrator?

I need to write an ini file to the current user directory in Windows 7 (C: \ Users \ CurUser). CurUser is not an administrator. My installer requires administrator rights. Therefore, my setup looks like this:

[Setup]
PrivilegesRequired=admin

When I run the installer, it asks the administrator for login. From now on, all user constants, userappdata, etc. is C: \ Users \ AdminUser ... So I need to find CurUser when starting the installation as AdminUser.

Code examples are welcome. Thank.

+5
source share
3 answers

. , , ini , .

+3

/, , , . , " " .

, , , .

+2

In my case, I just switched to {commonappdata}instead {appdata}, since my data was the same for all users.

0
source

All Articles