0

How to set C:\Users\%username% dir? This is folder where "appdata", "my documents" etc are located. i couldn't find this constant in inno setup documentation. Thx in advance.

  • possible duplicate of [Inno Setup User Home Path](http://stackoverflow.com/questions/17656385/inno-setup-user-home-path) – TLama Aug 02 '14 at 17:24

2 Answers2

0

I think you are looking for alias if yes then Just set the below one and it will work for all users.

%HOMEDRIVE%%HOMEPATH%

Or use the below one

%USERPROFILE%
prashant thakre
  • 5,061
  • 3
  • 26
  • 39
-1

You can use any environment variable:

ExpandConstant('{homepath}\YourPath\');
Mansiper
  • 1
  • 2
  • `{homepath}` constant doesn't exist. – TLama Aug 02 '14 at 17:26
  • It exists in Windows 7. I checked it. You can use USERPROFILE or APPDATA\..\..\ – Mansiper Aug 02 '14 at 17:30
  • What you're thinking of is called environment variable. What you're trying to expand is a built-in Inno Setup constant that doesn't exist. – TLama Aug 02 '14 at 17:32
  • I have just compiled my project using FileExists(ExpandConstant('{homepath}\MyFile')). – Mansiper Aug 02 '14 at 17:36
  • It's not about compilation. The code that you've shown in your comment would execute at runtime. For how to expand environment variables see [`Constants`](http://www.jrsoftware.org/ishelp/index.php?topic=consts) topic, specifically *Other Constants* section. – TLama Aug 02 '14 at 17:41