My setup.exe in e:\setup.exe, I tried this code:
System.AppDomain.CurrentDomain.BaseDirectory;
return c:\Windows\syswow64\
Application.ExecutablePath;
return c:\Windows\syswow64\MsiExec.exe
Application.StartupPath
return c:\Windows\syswow64\
I need something return e:\
using System.IO;
string exeDir = Directory.GetCurrentDirectory();
You can get exe full path by reflection also.
string exeLocation = System.Reflection.Assembly.GetEntryAssembly().Location;
You can this too.
string exeDir = AppDomain.CurrentDomain.BaseDirectory;
string exeLocation = Assembly.GetEntryAssembly().Location;
One more way:
string dir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
To get current working directory use
Directory.GetCurrentDirectory();
which locate under System.IO