|
-
Jan 24th, 2000, 07:58 PM
#1
Thread Starter
New Member
Does anyone know how to use AppPath properly?
I have created a setup file for my application and it will only work if users install it in a certain directory. I have been trying to use the $(AppPath) in the code and it simply won't work
E.G. I have a directory testfiles as a subdirectory of the installation directory.
At the moment in the code, I access files in that directory directly by c:\MyApplication\testfiles\whatever.file
but I would like a way to be able to access it as
(installation directory)\testfiles\whatever.file
I know this can be done using $(AppPath) but have not found the correct way of doing this.
Any of you out there got examples of how this can be done?
Thanks.
-
Jan 24th, 2000, 08:06 PM
#2
Lively Member
I usually use the following code:
Code:
Dim FileName as String
FileName = App.Path
If Right$(FileName, 1) <> "\" Then FileName = FileName & "\"
FileName = FileName & "testfiles\whatever.file"
------------------
-
Jan 24th, 2000, 09:00 PM
#3
Thread Starter
New Member
If you don't know what the path to the file is going to be before hand, then that won't work, thanks anyway.
-
Jan 24th, 2000, 09:11 PM
#4
Hyperactive Member
Did you test it??
App.Path returns the path where the program is installed...
And if everything else fails, modify setup1.exe (source comes with VB), and save the path where the program is installed in the registry (useless though since app.path does the trick...)
-
Jan 24th, 2000, 09:31 PM
#5
Thread Starter
New Member
No I didn't.
I just didn't read it properly, not with it today, sorry about that. Thanks again.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|