Code above generate next wix markup
//action that resolve value of INSTALLDIR and set it to ARPINSTALLLOCATION
<CustomAction Id="Set_ARPINSTALLLOCATION" Property="ARPINSTALLLOCATION" Value="[INSTALLDIR]" />
//in sequence action Set_ARPINSTALLLOCATION execute before AppSearch only when (NOT Installed)
<InstallExecuteSequence>
<Custom Action="WixSharp_InitRuntime_Action" Before="AppSearch"> (1) </Custom>
<Custom Action="Set_ARPINSTALLLOCATION" After="WixSharp_InitRuntime_Action"> (NOT Installed) </Custom>
</InstallExecuteSequence>
//action that resolve value of INSTALLDIR and set it to ARPINSTALLLOCATION
<CustomAction Id="Set_ARPINSTALLLOCATION" Property="ARPINSTALLLOCATION" Value="[INSTALLDIR]" />
//in sequence action Set_ARPINSTALLLOCATION execute before AppSearch only when (NOT Installed)
<InstallExecuteSequence>
<Custom Action="WixSharp_InitRuntime_Action" Before="AppSearch"> (1) </Custom>
<Custom Action="Set_ARPINSTALLLOCATION" After="WixSharp_InitRuntime_Action"> (NOT Installed) </Custom>
</InstallExecuteSequence>