For building an installer, I need to know where an application executes from so I can copy files from that directory. For instance, when the files are on a CD (D:\), I need to know to copy from D:\. If the files are on drive E:\ then I need to copy from E:\. I tried using the following code, but I get the temp directory for the application rather than where it originated from:
The returned value of that is "C:\Users\USerName\AppData\Local\Apps\2.0\etc\etc\etc" rather than "D:\" where it is running from.
Since the program will be running on multiple users computers that won't necessarily have CD-ROM / DVD Drives and may be running the setup from a USB drive, I can't just hard code the starting executable.
Thanks for any help!
Code:
Dim AppPath As String
AppPath = Path.GetFullPath(Application.ExecutablePath)
MsgBox(AppPath)
Microsoft.VisualBasic.FileIO.FileSystem.CopyDirectory(AppPath, "C:\Temp\")Since the program will be running on multiple users computers that won't necessarily have CD-ROM / DVD Drives and may be running the setup from a USB drive, I can't just hard code the starting executable.
Thanks for any help!