I'm trying to fix an issue for a client. They have the below build error:
The 'WixShellExecTarget' Property contains '[INSTALLFOLDER]' in its value which is an illegal reference to another property. If this value is a string literal, not a property reference, please ignore this warning. To set a property with the value of another property, use a CustomAction with Property and Value attributes.
Here's what I think is the relevant snippet:
<!-- Open destination folder after install -->
<Property Id="WixShellExecTarget" Value="[INSTALLFOLDER]" />
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
<DirectoryRef Id="INSTALLFOLDER">
<Component Id="EULA" Guid="{32e8fdf3-8a40-471c-8ff6-1ac27e0fae7c}">
<File Id="eulaRTF" Name="EULA.rtf" DiskId="1" Source="$(sys.SOURCEFILEDIR)\EULA\EULA.rtf" Vital="yes" KeyPath="yes" />
</Component>
</DirectoryRef>
I'm unfamiliar with wix files and how they work. It sounds like I have to change the 2nd line to a CustomAction, but I'm not sure how to do that. Any tips?
You cannot initialize a Property
with the value of a Property
. That would be cool, but it wouldn't work in this case anyway because INSTALLFOLDER
would be initialized to blank.
You'll need to use SetProperty
to set the value after calculating the directory tree via CostFinalize
. Something like:
<SetProperty Id="WixShellExecTarget" Value="[INSTALLFOLDER]"
After="CostFinalize" />
You'd benefit by getting a working understanding of properties and the timelines they can happen on. Episode 32 of the Deployment Dojo jumps into the deep end a bit but watching that then going back to catch up on a bit of the setup (no pun intended) would provide you a lot more context.