开发者

What is the best way to refer to 'external' files that need to be bundled in a Visual Studio (2008) solution for debugging and deployment?

I am trying to build a Windows service that launches a webserver (Nginx) before login on a Windows computer. This needs to be bundled with the install.

I can find out where the working directory of the windows service is by outputting to a the log the working directory (in this case C:\WINDOWS\System32) and copy over Nginx directory into that folder but this is not great for when it comes to bundling the application into a setup.exe file which may be installed in any arbitrary location - plus it clutters the Syste开发者_运维问答m32 folder

What is the best way to refer to a set 'external' files both during debugging (i.e. within the solution folder hierarchy) and so that the paths will still work after deployment?


What I normally do is make sure they are in the same folder as the executable. When debugging, you can force this by setting the Copy to output directory flag in the properties pane for the files you require. When installing, simply make sure that all files are installed in the same folder. The installer should be able to take care of this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜