Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27514

Where does the application start from?

$
0
0
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:

Code:

        Dim AppPath As String
        AppPath = Path.GetFullPath(Application.ExecutablePath)
        MsgBox(AppPath)
        Microsoft.VisualBasic.FileIO.FileSystem.CopyDirectory(AppPath, "C:\Temp\")

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!

Viewing all articles
Browse latest Browse all 27514

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>