public string getpath()
            {
                string str = Assembly.GetExecutingAssembly().GetName().CodeBase;
                if (str.ToLower().IndexOf("file:///") >= 0)
                {
                    str = str.Substring(8, str.Length - 8);
                }
                string path = System.IO.Path.GetDirectoryName(str);
                return path;
 
            }
这个就是你安装程序安装的路径