How do I get the Deployment Path

Topics: Tips and Tricks
Jun 21, 2011 at 4:05 PM


Is there an environment variable that I can use to get the deployment path?

I am trying to execute an SQL script file using sqlcmd.exe, but whatever I do, it exits saying "Invalid filename".

My <Exec/> looks like

<Exec Command="sqlcmd.exe -U $(Username) -P $(Password) -S $(Server) -i Script.sql" />

I have confirmed that the file gets copied to the installation folder, but I presume I need to provide a full path instead of just the file name above.

Thanks,
Jay.

Coordinator
Jun 21, 2011 at 5:02 PM

Try -i ..\Script.sql.  Hopefully you're using an AdditionalFiles ItemGroup to get your script file added to the MSI, in which case it will always be located at ..\ on the server.

Thanks,
Tom

Jun 22, 2011 at 10:23 AM

Spot-on - thanks a lot !!

Jay.