Comments

: hi;: : I want to obtain the exact directory which the executable itself resides in. I use the GetDir() procedure, but it returns the directory of the parameter file.: : Thanx...:

Do you mean the path for your application itself ?I don't have Delphi here but it's in the [b]Application[/b] component.Something like [b]Application.ExeName[/b] if I remember right. And to obtain the path respectively you can use [b]ExtractFilePath[/b] (not so sure about the name of the function either).Hope that helps.

: : hi;: : : : I want to obtain the exact directory which the executable itself resides in. I use the GetDir() procedure, but it returns the directory of the parameter file.: : : : Thanx...: : : : Do you mean the path for your application itself ?: I don't have Delphi here but it's in the [b]Application[/b] component.: Something like [b]Application.ExeName[/b] if I remember right. And to obtain the path respectively you can use [b]ExtractFilePath[/b] (not so sure about the name of the function either).: Hope that helps.: You can also use the GetParam() function for that. The zeroth param is the complete exe-name including the path. This can also be used in a console application without the 400 kB forms overhead.

Thanks to both. I need this to keep some additional text data related to the application.

Is it good to keep such data in the same directory with the .exe file or is there any other way to do this?

(I don't want to use an absolute path like "C:Program FilesMy Applicaton" because the user may want to install the application to some other location he/she wants)

: : : hi;: : : : : : I want to obtain the exact directory which the executable itself resides in. I use the GetDir() procedure, but it returns the directory of the parameter file.: : : : : : Thanx...: : : : : : : Do you mean the path for your application itself ?: : I don't have Delphi here but it's in the [b]Application[/b] component.: : Something like [b]Application.ExeName[/b] if I remember right. And to obtain the path respectively you can use [b]ExtractFilePath[/b] (not so sure about the name of the function either).: : Hope that helps.: : : You can also use the GetParam() function for that. The zeroth param is the complete exe-name including the path. This can also be used in a console application without the 400 kB forms overhead.:

: Thanks to both. I need this to keep some additional text data related to the application.: : Is it good to keep such data in the same directory with the .exe file or is there any other way to do this?: : (I don't want to use an absolute path like "C:Program FilesMy Applicaton" because the user may want to install the application to some other location he/she wants): : : : : hi;: : : : : : : : I want to obtain the exact directory which the executable itself resides in. I use the GetDir() procedure, but it returns the directory of the parameter file.: : : : : : : : Thanx...: : : : : : : : : : Do you mean the path for your application itself ?: : : I don't have Delphi here but it's in the [b]Application[/b] component.: : : Something like [b]Application.ExeName[/b] if I remember right. And to obtain the path respectively you can use [b]ExtractFilePath[/b] (not so sure about the name of the function either).: : : Hope that helps.: : : : : You can also use the GetParam() function for that. The zeroth param is the complete exe-name including the path. This can also be used in a console application without the 400 kB forms overhead.: : : : Getting the exe-path in run-time is the best way to ensure that that data file is in the same directory as the exe-file. It also makes the program easier to remove from the system. If you have a lot of data, you might also consider using a subdirectory in the exe-directory. Most games use this method. That is also very easy to implement once you have the exe-path.

: Thanks to both. I need this to keep some additional text data related to the application.: : Is it good to keep such data in the same directory with the .exe file or is there any other way to do this?: : (I don't want to use an absolute path like "C:Program FilesMy Applicaton" because the user may want to install the application to some other location he/she wants): You can use:[b]RootPath = ExtractFilePath(Application.ExeName)[/b]or [b]RootPath = ExtractFilePath(GetParam(0))[/b]Then you can have things like:[b]DataPath = RootPath + 'Data'[/b]Use it whenenver needed:[b]AssignFile(f, DataPath + 'config.sys')[/b]Hope this helps.

: : : hi;: : : : : : I want to obtain the exact directory which the executable itself resides in. I use the GetDir() procedure, but it returns the directory of the parameter file.: : : : : : Thanx...: : : : : : : Do you mean the path for your application itself ?: : I don't have Delphi here but it's in the [b]Application[/b] component.: : Something like [b]Application.ExeName[/b] if I remember right. And to obtain the path respectively you can use [b]ExtractFilePath[/b] (not so sure about the name of the function either).: : Hope that helps.: : : You can also use the GetParam() function for that. The zeroth param is the complete exe-name including the path. This can also be used in a console application without the 400 kB forms overhead.: That is a very good idea indeed.