The Wix directory (Wix# Dir target path) doesn't allow absolute path. Thus it has to be done by overriding the INSTALLDIR property prior the installation:
However I do see the value in fixing this WiX usability flaw and allowing the direct absolute path. In fact it is exactly in the "Wix# spirit":
Thus I have put it in my pending features list so watch for the future releases.
Project project = new Project("MyProduct", new Dir(@"%ProgramFiles%\My Company\My Product", new File(@"Files\Bin\MyApp.exe"), new Dir(@"Docs\Manual", new File(@"Files\Docs\Manual.txt"))), new SetPropertyAction("INSTALLDIR", @"C:\My Company\My Product")); project.UI = WUI.WixUI_InstallDir; project.GUID = new Guid("6f330b47-2577-43ad-9095-1861ba25889b"); Compiler.PreserveTempFiles = true; Compiler.BuildMsi(project);
... new Project("MyProduct", new Dir(@"C:\My Company\My Product", new File(@"Files\Bin\MyApp.exe"), ...