Reputation: 179
I am creating an exe file with Inno Setup 5 compiler. I want to place the application by default at this location:
C:\users\username\AppData\local\appname
How can I get the user's Windows username?
with some kind of keyword like
C:\users\%AppData%\local\appname
or something that I could add in the script?
Upvotes: 3
Views: 4164
Reputation: 9192
Typically I use the constant {userappdata}
as described in the documentation to represent the %AppData% Windows constant which maps to c:\users\username\AppData\Roaming.
For example:
[Files]
Source: "c:\Build\output\test.dta"; DestDir: "{userappdata}\MyApplicaton\Data"; Flags: ignoreversion
Upvotes: 3
Reputation: 1784
According to InnoSetup docs the {%username|DefaultValue}
can be used to get the username from environment variables. Keep in mind that the username and the name of the user folder can be different (as it is on my machine).
Upvotes: 1