若用语句System.Environment.CurrentDirectory则返回的路径为C:WINDOWSsystem32不能正确指向安装程序所在路径,改用如下代码即可实现。
strings trAssemblyFilePath = Assembly.GetExecutingAssembly().Location;
string strAssemblyDirPath = Path.GetDirectoryName(strAssemblyFilePath);
string strPath = strAssemblyDirPath + \Log;
引用自:http://www.cnblogs.com/xiaofengfeng/archive/2011/10/27/2226325.html