I'm trying to install d3dx9 with winetricks on wine 1.5 from ppa and I keep getting an error. I tried:
WINEARCH=win32 WINEPREFIX=~/.win32 winecfg
sudo WINEARCH=win32 WINEPREFIX=~/.win32 winetricks
And still get this error:
wine cmd.exe /c echo '%ProgramFiles%' returned empty string
If I type wine cmd.exe /c echo '%ProgramFiles%'
into the terminal I get C:\Program Files
so the path seems correct but not when I run winetricks.
I also tried this regedit fix with no luck.
Any ideas?
Best Answer
I see you use sudo in one of your
winetricks
commands: that could be the main problem, as sudo shouldn't be used withwine
orwinetricks
(only when runningsudo apt-get install wine
); see my comment at the end of my post.*When I successfully installed d3dx9 to a separate wine prefix, which I see you are also using, I used the below command in the terminal.
This is part of the voluminous output I got from the command using the
WINEPREFIX
:You must change
.myprefixname
to the name of your own prefix; for more explanation of wine prefixes and their use, please see this question.You only need to specify
WINEARCH=win32
or the 64bit equivalent when you create the prefix, as it can't be altered afterwards, as noted at WineHQ.Wine
will also refuse to load if you specify a differentWINEARCH
to the one you created it with.Just entering in terminal
winetricks d3dx9
would instead install directX to your default~/.wine
folder.*It is most important to note that when installing things with
winetricks
or usingwine
, you don't need to use sudo, as you are not installing the files to the system, but to your Wine folder or separate wine prefix in your home folder. Using sudo might cause the problem you are experiencing with paths, as is noted on the actual link given. In the WineFAQ it notes thatSo, I should also check your permissions and refer to the WineFAQ article, as you will need to reset your permissions even if you reinstall
wine
. If you have used sudo withwine
and now root owns some of the files, you will need to change the permissions by running the following commands from the WineFAQ:Replace
.wine
with your prefix if you use aWINEPREFIX
or use the command for both your.wine
folder and your prefix if you have both.