c# how to get the install path of my program?
guys.
In my program, i need to execute a kmlsample.exe in CMD, right now, it stays at my solution folder. i can just dostring command = "\"C:\\Documents and Settings\\Bruce\\My Documents\\Visual Studio 2008\\Projects\\KMeans\\KMeans开发者_Python百科\\kmlsample.exe"
but when i let the user to install my program, how can i know the path of my program got installed,
in order to execute the exe file.thank you
This might be what your looking for.
http://msdn.microsoft.com/en-us/library/system.windows.forms.application.startuppath.aspx
Edit - You need to run this after the install inside your main program right? This won't work if you need to run something during the install.
You can get the executing assembly's location from
System.Reflection.Assembly.GetExecutingAssembly().Location
精彩评论