Wine path-association

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
c_andy_man
Level 2
Level 2
Posts: 16
Joined: Wed May 20, 2009 8:17 am

Wine path-association

Post by c_andy_man »

hello.

I am trying to install an exe-file in the Program-Path of an individual Wine-Prefix. This exe-file reads an Inifile, which is in the same Directory.

When I use Winefile to open the .exe, the inifile is read correctly.
When I use it in a .desktop file with the order below, it does not work.

Code: Select all

env WINEPREFIX "/opt/WPrefix" wine "C:\Program Files\Test\test.exe"
What is the problem and what can I do?
User avatar
dimesio
Moderator
Moderator
Posts: 13369
Joined: Tue Mar 25, 2008 10:30 pm

Re: Wine path-association

Post by dimesio »

c_andy_man wrote:hello.

I am trying to install an exe-file in the Program-Path of an individual Wine-Prefix. This exe-file reads an Inifile, which is in the same Directory.

When I use Winefile to open the .exe, the inifile is read correctly.
When I use it in a .desktop file with the order below, it does not work.

Code: Select all

env WINEPREFIX "/opt/WPrefix" wine "C:\Program Files\Test\test.exe"
What is the problem and what can I do?
Should be:

Code: Select all

env WINEPREFIX="/opt/WPrefix" wine "C:\Program Files\Test\test.exe"
c_andy_man
Level 2
Level 2
Posts: 16
Joined: Wed May 20, 2009 8:17 am

Post by c_andy_man »

?

There is no difference to my code!

I just changed the .exe so that the @WorkingDir gets displayed in a messagebox.
That leads to "C:\Program Files\Test\" when i use it via winedir
and to Z:\root when i use it from the shortcut.
Somehow the path where the exe is executed is not the same.
austin987
Wine Developer
Wine Developer
Posts: 2383
Joined: Fri Feb 22, 2008 8:19 pm

Wine path-association

Post by austin987 »

On Wed, Jun 10, 2009 at 9:51 AM, c_andy_man<[email protected]> wrote:
?

There is no difference!

I just changed the .exe so that the @WorkingDir gets displayed in a messagebox.
That leads to "C:\Program Files\Test\" when i use it via winedir
and to Z:\root when i use it from the shortcut.
Somehow the path where the exe is executed is not the same.
That's what the set working directory option is for.

--
-Austin
DaVince
Level 8
Level 8
Posts: 1099
Joined: Wed Oct 29, 2008 4:53 pm

Post by DaVince »

c_andy_man wrote:?

There is no difference to my code!
The difference is WINEPREFIX="/opt/WPrefix" instead of WINEPREFIX "/opt/WPrefix"...

See? An = instead of a space.
c_andy_man
Level 2
Level 2
Posts: 16
Joined: Wed May 20, 2009 8:17 am

Post by c_andy_man »

Okay. so workingdir is simply wrong because it shows the standard user-directory...

The when the exe opens the file is by using fileRead("inifile.ini",0) without a path => in the actual directory. This works on windows, no matter where i put the two files.
But in Linux/Wine, when the inifile is in the same directory as the exe, the file will not be read.
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

c_andy_man wrote:But in Linux/Wine, when the inifile is in the same directory as the exe, the file will not be read.
Not true. Try starting your program on windows from 'cmd' from a different directory specifying the full path. Ex:

Code: Select all

c:
cd \
d:\some\program\dir\my_program.exe
Locked