I am creating an installer for an SDK, which includes source code to be compiled by the end-user.
I want my Wix installer to put this in the users' home directory by default, but I can't find the right property name to use.
You could also reference the HOMEPATH
environment variable with [%HOMEPATH]
. For more detail about the syntax used for properties, see the Formatted datatype.
I believe you are looking for PersonalFolder
.
There is a full list of special folders here:
http://msdn.microsoft.com/en-us/library/aa370905%28VS.85%29.aspx#system_folder_properties
In case it helps, for WiX v3.11.2.4516 I have used USER_FOLDER
like the example below:
<Directory Id="USER_FOLDER">
...
</Directory>
EDIT
...having calculated this property with
<Property Id="USER_FOLDER" >
<DirectorySearch Id="userProfileSearch" Depth="0" Path="[%USERPROFILE]" />
</Property>
Anyone in the future looking into this, and wondering how to make this [%HOMEPATH] work then hopefully this helps you:
<!-- Declare an action which binds the 'user home' to UserFolder
(You can replace [%HOMEDRIVE][%HOMEPATH] with [%USERPROFILE], read the difference from internet.) -->
<CustomAction
Id='SpecifyUserFolder'
Directory='UserFolder'
Value="[%HOMEDRIVE][%HOMEPATH]" />
<!-- put this before installation process -->
<InstallExecuteSequence>
<Custom Action="SpecifyUserFolder" Before="InstallFiles" />
</InstallExecuteSequence>
<!-- User home then becomes available here, because the ID matches the declared ID in CustomAction above. -->
<Directory Id='UserFolder'>
</Directory>'