Application will only run when executed from its directory

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
netgui68
Newbie
Newbie
Posts: 4
Joined: Wed Jan 21, 2009 5:26 pm

Application will only run when executed from its directory

Post by netgui68 »

Hi everyone! I am running Wine 1.0 on Linux Mint 5.1. I have a custom developed program that was designed in Delphi using the Borland Database library that will only run correctly if executed from the directory it is contained in. It will not run from the start menu nor will it run from a launcher that I have built on the Desktop. I figure it has to be something with the path referencing. I have scoured the internet and tried many suggestions, however none of which have solved the problem.

To be more specific, it seems like the program is unable to find the Borland files.

The path to the application is: .wine/drive_c/Scan
The path to the Borland dll's, odbc drives, and other shared libraries is:
.wine/drive_c/Program Files/Common Files/Borland Shared/BDE/

My main desire is to be able to launch this program from a launcher that I can create on the Desktop, eventually I would like to make this universally accessible to all users. Your help and suggestions would be most appreciated.

Thank you!
austin987
Wine Developer
Wine Developer
Posts: 2383
Joined: Fri Feb 22, 2008 8:19 pm

Application will only run when executed from its directory

Post by austin987 »

On Thu, Jan 22, 2009 at 9:21 AM, netgui68 <[email protected]> wrote:
Hi everyone! I am running Wine 1.0 on Linux Mint 5.1. I have a custom developed program that was designed in Delphi using the Borland Database library that will only run correctly if executed from the directory it is contained in. It will not run from the start menu nor will it run from a launcher that I have built on the Desktop. I figure it has to be something with the path referencing. I have scoured the internet and tried many suggestions, however none of which have solved the problem.

To be more specific, it seems like the program is unable to find the Borland files.

The path to the application is: .wine/drive_c/Scan
The path to the Borland dll's, odbc drives, and other shared libraries is:
.wine/drive_c/Program Files/Common Files/Borland Shared/BDE/

My main desire is to be able to launch this program from a launcher that I can create on the Desktop, eventually I would like to make this universally accessible to all users. Your help and suggestions would be most appreciated.

Thank you!





Does using:
$ wine "C:\Scan\program.exe"
work?

--
-Austin
netgui68
Newbie
Newbie
Posts: 4
Joined: Wed Jan 21, 2009 5:26 pm

Unfortunately it does not work correctly

Post by netgui68 »

Does using:
$ wine "C:\Scan\program.exe"
work?

---------------------------Answer------------------------------

It runs but not correctly, I receive all kinds of errors about not being able to build table files and such...If I go to the start menu and tell wine to let me browse the C:\ drive and execute the application there...it works flawlessly. Trying to execute it from any other place gives me errors.
austin987
Wine Developer
Wine Developer
Posts: 2383
Joined: Fri Feb 22, 2008 8:19 pm

Application will only run when executed from its directory

Post by austin987 »

On Thu, Jan 22, 2009 at 10:00 AM, netgui68 <[email protected]> wrote:
Does using:
$ wine "C:\Scan\program.exe"
work?

---------------------------Answer------------------------------

It runs but not correctly, I receive all kinds of errors about not being able to build table files and such...If I go to the start menu and tell wine to let me browse the C:\ drive and execute the application there...it works flawlessly. Trying to execute it from any other place gives me errors.





Many programs rely on being run from their current directory, Delphi
was well known for that.

If your window manager supports it, you can tell it to run from that
directory, then use the full path. Should work then.

--
-Austin
netgui68
Newbie
Newbie
Posts: 4
Joined: Wed Jan 21, 2009 5:26 pm

I do not have that option

Post by netgui68 »

Many programs rely on being run from their current directory, Delphi
was well known for that.

If your window manager supports it, you can tell it to run from that
directory, then use the full path. Should work then.

--
-Austin

-----------Answer---------------------------------
The window launcher does not give me that option and most importantly I am trying to build this to work for novice users...they need the link on the Desktop to click or they will be lost.

Thanks for your suggestions.
Vincent Povirk

Application will only run when executed from its directory

Post by Vincent Povirk »

Short of writing a shell script, the easiest way to start an
executable file in its directory is to run

$ wine start /unix ".wine/drive_c/Scan/program.exe"

When invoked this way, wine will try to start the file the same as if
it were double-clicked in windows explorer. It will start from the
path containing the exe and invoke it with its full dos path.

This is the way file browsers invoke Wine. If that worked, this should
also work.

The drawback is that you cannot pass arguments to the executable this
way; for that you would need a shell script.

Vincent Povirk
netgui68
Newbie
Newbie
Posts: 4
Joined: Wed Jan 21, 2009 5:26 pm

Vincent...you are genious!

Post by netgui68 »

That command structure worked perfectly. This issue is resolved. Strangely enough I had tried a similar command found on the net, I guess the syntax was incorrect. Again..thank you very much for your help.
Locked