1

I'm trying to add a file source using the project. But my project name has . in it:

<Component Guid="*">
  <File Source="$(var.Company.Product.Service.TargetPath" KeyPath="yes" />
</Component>

I get this error when trying to build:

Error 1 Ill-formed preprocessor variable '$((var.Company.Product.Service.TargetPath)'. Variables must have a prefix (like 'var.', 'env.', or 'sys.') and a name at least 1 character long. If the literal string '$((var.Company.Product.Service.TargetPath)' is desired, use '$$((var.Company.Product.Service.TargetPath)'.

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
Wil
  • 13
  • 3

1 Answers1

2

You probably just lack end parenthesis:

<File Source="$(var.Company.Product.Service.TargetPath)" KeyPath="yes" />

See here for Wix tips and tricks: WiX tricks and tips

Community
  • 1
  • 1
Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
  • Doh! Nice catch. However, I get a new error: Error 1 Undefined preprocessor variable '$(var.Company.Product.Service.TargetPath)'. – Wil Aug 29 '14 at 15:41
  • Check the [**tips and tricks link**](http://stackoverflow.com/questions/471424/wix-tricks-and-tips/577793#577793). And [**this well known Wix tutorial**](http://wix.tramontana.co.hu/tutorial). And [**this nice CodeProject quick-start, hands-on tutorial**](http://www.codeproject.com/Tips/105638/A-quick-introduction-Create-an-MSI-installer-with). – Stein Åsmul Aug 29 '14 at 15:43
  • Thanks! I'm not sure exactly what I messed up. But I copied the ProjectName from the wixproj file and it worked. – Wil Aug 29 '14 at 15:53
  • You must use `` somewhere to resolve the variable at compile time. [**See this answer**](http://stackoverflow.com/a/578340/129130). – Stein Åsmul Aug 29 '14 at 15:58