Jun 21, 2013 at 5:04 AM
Edited Jun 21, 2013 at 5:05 AM
Why do you think it is searching for the file in the SQL Server bin folder where sqlcmd.exe resides?
Is your folder structure:
If so, when you use AdditionalFiles to package the file into the MSI, its location will move UP one level from DBScripts. If you want to preserve the same structure with a DBScripts subfolder, then you need to copy the file to the redist (obj\Debug\redist)
folder yourself and remove the file(s) from AdditionalFiles. Then your command line above with ..\DBScripts should point to the correct location after installing the MSI.
<MakeDir Directories="$(RedistDir)\DBScripts" />
<!-- Force MSBuild to expand the item spec into physical file specs -->
<Output TaskParameter="Include" ItemName="SQLFilesSourceGroup" />
<Copy DestinationFolder="$(RedistDir)\DBScripts\%(RecursiveDir)" SourceFiles="@(SQLFilesSourceGroup)"/>