http://bugs.winehq.org/show_bug.cgi?id=16246
Summary: Setting WINEPATH has no effect. Product: Wine Version: 1.1.9 Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: kernel32 AssignedTo: wine-bugs@winehq.org ReportedBy: aziz.koeksal@gmail.com
Hi,
The following doesn't work as expected:
$ export WINEPATH="C:\dir" $ printenv | grep WINEPATH # Check if it's in the shell's environment. WINEPATH=C:\dir $ wine ./environment.exe # E.g.: printf("PATH=%s", getenv("PATH")); PATH=C:\windows\system32;C:\Windows
I expect that by defining WINEPATH it would get appended to PATH. I also expect wine to search in WINEPATH folders to locate a command, e.g. "wine compiler.exe". Before filing this report I did some research into this, and apparently there has been only one person so far who complained about this feature not working anymore (http://www.winehq.org/pipermail/wine-users/2006-August/023179.html). I have also browsed the source code, and found the following identifiers that should be of interest:
http://source.winehq.org/ident?i=__wine_main_environ http://source.winehq.org/ident?i=build_initial_environment
I could help debugging this, but only if someone guided me through setting up everything that is required to debug wine in a graphical and sane environment.
http://bugs.winehq.org/show_bug.cgi?id=16246
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID
--- Comment #1 from Vitaliy Margolen vitaliy@kievinfo.com 2008-11-28 14:08:59 --- WINEPATH is not used anywhere within Wine. Where did you found that Wine uses WINEPATH.
If you want to alter PATH withing Wine you will have to do it the same way as windows - via registry.
Closing invalid
http://bugs.winehq.org/show_bug.cgi?id=16246
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #2 from Vitaliy Margolen vitaliy@kievinfo.com 2008-11-28 14:09:55 --- Closing invalid.
http://bugs.winehq.org/show_bug.cgi?id=16246
Aziz Köksal aziz.koeksal@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|CLOSED |UNCONFIRMED Resolution|INVALID |
--- Comment #3 from Aziz Köksal aziz.koeksal@gmail.com 2008-11-28 14:56:19 --- (In reply to comment #1)
WINEPATH is not used anywhere within Wine. Where did you found that Wine uses WINEPATH.
If you want to alter PATH withing Wine you will have to do it the same way as windows - via registry.
Closing invalid
Yes it is, at least it was in older versions of wine. For example, see http://source.winehq.org/search?v=wine20040309;string=WINEPATH
I don't appreciate it at all that this bug has been marked invalid almost instantly. I would like to have a discussion, because I think this is a necessary feature. The alternative way to set PATH using regedit is not acceptable in all situations. Especially not when you have to run Windows programs from bash or python scripts and don't want to alter the PATH variable permanently. Consider what you have to do in a script: currently you have to create a temporary registry file, then call wine regedit.exe on it (which can't even read reg files from stdin), but then you have a problem because you can't restore the original PATH variable anymore. There is probably a solution to this, but I'm sure it's definately not as easy as just setting WINEPATH and let wine handle this.
To my mind having support for WINEPATH would be a very welcome feature. It's strange that it somehow disappeared in the newer versions. Can we have it back, please?
http://bugs.winehq.org/show_bug.cgi?id=16246
--- Comment #4 from Jeff Zaroyko jeffz@jeffz.name 2008-11-28 15:41:35 --- (In reply to comment #3)
(In reply to comment #1)
WINEPATH is not used anywhere within Wine. Where did you found that Wine uses WINEPATH.
If you want to alter PATH withing Wine you will have to do it the same way as windows - via registry.
Closing invalid
Yes it is, at least it was in older versions of wine. For example, see http://source.winehq.org/search?v=wine20040309;string=WINEPATH
That was not a stable release.
I don't appreciate it at all that this bug has been marked invalid almost instantly. I would like to have a discussion, because I think this is a necessary feature. The alternative way to set PATH using regedit is not acceptable in all situations. Especially not when you have to run Windows programs from bash or python scripts and don't want to alter the PATH variable permanently.
If you don't want to set it globally then instead of launching whatever program you are running under Wine directly, modify the PATH environment variable as part of a batch file which then runs your program.
http://bugs.winehq.org/show_bug.cgi?id=16246
--- Comment #5 from Aziz Köksal aziz.koeksal@gmail.com 2008-11-28 18:25:47 --- (In reply to comment #4)
If you don't want to set it globally then instead of launching whatever program you are running under Wine directly, modify the PATH environment variable as part of a batch file which then runs your program.
That would be a workaround, but still not something that just feels right. It has to be the most optimal solution, documented and easy to understand for users and programmers. I can only see WINEPATH being that. Keep in mind that on a Windows command line you can just do "set PATH="%PATH%;C:\new_path" and then launch your program. Also, if you have a Python script on Windows, you can just modify os.environ['PATH'] before calling an external program to achieve the same effect. I want to be able to do the same thing on Linux, by modifying os.environ['WINEPATH'].
In the meantime, I will have to use the batch file workaround.
http://bugs.winehq.org/show_bug.cgi?id=16246
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |WONTFIX
--- Comment #6 from Vitaliy Margolen vitaliy@kievinfo.com 2008-11-28 19:14:06 --- It was removed for a reason.
http://bugs.winehq.org/show_bug.cgi?id=16246
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED Component|kernel32 |-unknown
--- Comment #7 from Vitaliy Margolen vitaliy@kievinfo.com 2008-11-28 19:14:50 --- Use the proper Wine ways to change configuration.
Closing. There is nothing to discuss. It was already discussed a long time ago.
http://bugs.winehq.org/show_bug.cgi?id=16246
Aziz Köksal aziz.koeksal@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|CLOSED |UNCONFIRMED Resolution|WONTFIX |
--- Comment #8 from Aziz Köksal aziz.koeksal@gmail.com 2008-11-29 07:20:07 --- (In reply to comment #7)
Use the proper Wine ways to change configuration.
Closing. There is nothing to discuss. It was already discussed a long time ago.
Please, explain why you think it was removed for a reason. I don't see a good reason in this at all. Also, please, refer me to the discussion you mentioned, I don't seem to be able to find anything by searching for WINEPATH or WINETEMP on winehq.org and the whole web.
This is a quotation from the man page of wine: "wine makes the environment variables of the shell from which wine is started accessible to the windows/dos processes started. So use the appropriate syntax for your shell to enter environment variables you need."
Then the available variables are listed, like WINEDLLPATH for example. So, why is it that WINEPATH or WINETEMP is not passed as PATH and TEMP respectively to the Windows process anymore? You can do exactly the same on a Windows shell, but without the WINE prefix of course.
I really have a hard time understanding why my request is opposed and rejected. My experience of reporting my first bug wasn't pleasant, and I'm nearly put off enough not to report a helpful bug again.
I'm sorry, it's not meant to piss anybody off, but I have to insist and reopen the bug.
http://bugs.winehq.org/show_bug.cgi?id=16246
--- Comment #9 from Jeff Zaroyko jeffz@jeffz.name 2008-11-29 07:30:34 --- There's nothing wrong with setting the environment within Wine, either through a batch script, python, registry or otherwise. This is how you would do it in Windows.
http://bugs.winehq.org/show_bug.cgi?id=16246
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement
--- Comment #10 from Alexandre Julliard julliard@winehq.org 2008-11-29 07:39:09 --- WINEPATH is used internally to pass the PATH across Unix exec, so the feature you want is not entirely trivial to do. Still, this is a reasonable enhancement request.
http://bugs.winehq.org/show_bug.cgi?id=16246
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Summary|Setting WINEPATH has no |Setting WINEPATH has no |effect. |effect
--- Comment #11 from Austin English austinenglish@gmail.com 2008-11-29 14:27:11 --- Confirming per Alexandre.
http://bugs.winehq.org/show_bug.cgi?id=16246
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |ABANDONED
--- Comment #12 from Austin English austinenglish@gmail.com 2009-05-29 12:44:28 --- Abandoned. If you still have a problem in current (1.1.22 or newer) wine and can provide the requested information, feel free to reopen.
http://bugs.winehq.org/show_bug.cgi?id=16246
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #13 from Austin English austinenglish@gmail.com 2009-05-29 12:50:51 --- Closing.
http://bugs.winehq.org/show_bug.cgi?id=16246
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|CLOSED |REOPENED Resolution|ABANDONED |
--- Comment #14 from Austin English austinenglish@gmail.com 2009-05-29 12:51:51 --- Whoops, sorry. This one shouldn't have been in the abandoned list.
http://bugs.winehq.org/show_bug.cgi?id=16246
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download Status|REOPENED |NEW
--- Comment #15 from Austin English austinenglish@gmail.com 2010-01-04 13:38:06 --- Confirming.
http://bugs.winehq.org/show_bug.cgi?id=16246
Sam Morris sam@robots.org.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sam@robots.org.uk
http://bugs.winehq.org/show_bug.cgi?id=16246
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #16 from Austin English austinenglish@gmail.com 2012-06-24 20:45:56 CDT --- austin@laptop:~$ mkdir .wine/drive_c/dir austin@laptop:~$ export WINEPATH="C:\dir" austin@laptop:~$ wine cmd CMD Version 1.5.7
Z:\home\austin>echo %PATH% C:\dir;C:\windows\system32;C:\windows;C:\windows\system32\wbem
looks fixed to me.
http://bugs.winehq.org/show_bug.cgi?id=16246
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #17 from Alexandre Julliard julliard@winehq.org 2012-07-03 14:14:53 CDT --- Closing bugs fixed in 1.5.8.