Installed program not in ~/.wine/drive_c/Program\ Files/

Questions about Wine on macOS.
Swarup
Level 2
Level 2
Posts: 22
Joined: Sat May 16, 2009 7:29 pm

Installed program not in ~/.wine/drive_c/Program\ Files/

Post by Swarup »

I installed WINE in my new Mac, then used it to install a Windows program called "EE7 Search". Everything went perfectly, and upon completing installation, WINE opened the program and I tested it, everything works perfectly in the program. Then I closed the program, but cannot figure out how to open it again. I am a long time user of WINE in Ubuntu, but I understand that in OSX, WINE programs have to be opened from the command line. When I do "cd ~/.wine/drive_c/Program\ Files/" and then "ls", I get the listing of installed programs and mine is not there. So where is the program I installed? I need to know the location in order to run from the command line.

Please see the below terminal window output:

Code: Select all

Babas-iMac:~ baba$ cd ~/.wine/drive_c/Program\ Files/
Babas-iMac:Program Files baba$ ls
Common Files		Windows Media Player
Internet Explorer	Windows NT
Babas-iMac:Program Files baba$ wine EE7\ Search.exe
wine: cannot find 'EE7 Search.exe'
Babas-iMac:Program Files baba$ 
SetantaLP
Level 3
Level 3
Posts: 54
Joined: Mon Jul 31, 2017 3:55 am

Re: Installed program not in ~/.wine/drive_c/Program\ Files/

Post by SetantaLP »

If it's a 64bit program it might be installed inside 'Program Files (x86)'. If not you can either create a new wine prefix and start the installation again to find out if the installer mentions the install directory during the process or you just use "open ~/.wine" to open a finder window with the wine-directory and then search for the program-name.
Besides that, you can start Wine-Program just by double-clicking the exe, if you have a winehq-release installed, but in this case the program will use the default wine prefix, won't setup anything that might be necessary (e.g. set the current directory to the program directory which might be necessary if the program folder includes additional components and references them with relative paths) and you won't have a log in case of problems. So it's recommended to use the command line, maybe together with a small script (.sh or in case you just want to double click it .command), so you don't have to type everything every time you want to start the program.
Swarup
Level 2
Level 2
Posts: 22
Joined: Sat May 16, 2009 7:29 pm

Re: Installed program not in ~/.wine/drive_c/Program\ Files/

Post by Swarup »

When I go into Finder and type "Program Files (x86)" in the search window, then the icon of my installed program, EE7 Search, shows up there. So you are correct, that is the location.

Although actually, that icon is on the desktop. Here is the pathway to the file when I copy it and paste into a terminal window:

/Users/baba/Desktop/EE7\ Search.desktop

So I do not quite understand how it is that this file is located both on the desktop, and also in "Program Files (x86)".

At any rate, when I put the above pathway into a terminal command, it does not work-- either with or without ".exe" added:

Code: Select all

Babas-iMac:Program Files baba$ wine /Users/baba/Desktop/EE7\ Search.desktop
preloader: Warning: failed to reserve range 000000007ff00000-000000007fff0000
wine: Bad EXE format for Z:\Users\baba\Desktop\EE7 Search.desktop.
Babas-iMac:Program Files baba$ wine /Users/baba/Desktop/EE7\ Search.desktop.exe
wine: cannot find '/Users/baba/Desktop/EE7 Search.desktop.exe'
Babas-iMac:Program Files baba$ 
And if I cd to the desktop, still it does not work:

Code: Select all

Babas-iMac:Program Files baba$ cd /Users/baba/Desktop/
Babas-iMac:Desktop baba$ wine EE7\ Search.desktop.exe
wine: cannot find 'EE7 Search.desktop.exe'
Babas-iMac:Desktop baba$ 
jkfloris
Level 12
Level 12
Posts: 3136
Joined: Thu Aug 14, 2014 10:10 am

Re: Installed program not in ~/.wine/drive_c/Program\ Files/

Post by jkfloris »

A .desktop file is shortcut to a program. You could open the file in your favorite text editor and find the location where it refers to.
Swarup
Level 2
Level 2
Posts: 22
Joined: Sat May 16, 2009 7:29 pm

Re: Installed program not in ~/.wine/drive_c/Program\ Files/

Post by Swarup »

Ok, perfect. So I opened it with a text file, got the pathway, and put it into terminal window to start the program. I think I'm getting close! Here below is the error I got:

Code: Select all

Babas-iMac:Desktop baba$ wine /Users/baba/.wine/dosdevices/c:/Program Files (x86)/Electronic Edition 7/Windows/Search.exe
-bash: syntax error near unexpected token `('
What do I need to do to remedy this, i.e. fix the pathway, so the program will open?
jkfloris
Level 12
Level 12
Posts: 3136
Joined: Thu Aug 14, 2014 10:10 am

Re: Installed program not in ~/.wine/drive_c/Program\ Files/

Post by jkfloris »

Two solutions
- Go to the program directory and start the program

Code: Select all

cd "/Users/baba/.wine/dosdevices/c:/Program Files (x86)/Electronic Edition 7/Windows/"
wine Search.exe
- Use wine start

Code: Select all

wine start /unix  "/Users/baba/.wine/dosdevices/c:/Program Files (x86)/Electronic Edition 7/Windows/Search.exe"
Because there are weird characters in the path name you must put quotes around the path or put a backslash before the characters.

Code: Select all

cd /Users/baba/.wine/dosdevices/c:/Program\ Files\ \(x86\)/Electronic\ Edition\ 7/Windows/
Swarup
Level 2
Level 2
Posts: 22
Joined: Sat May 16, 2009 7:29 pm

Re: Installed program not in ~/.wine/drive_c/Program\ Files/

Post by Swarup »

Please see the below attempts I made, without success. I am a bit confused now as to how much of that line is the pathway to the .exe file, and how much of it should be included as the name of the .exe file. Because, as far as I know the name of the program is "EE7 Search", or "Electronic Edition 7 Search". But when I opened the shortcut located on the desktop as a text file to get the pathway, it included what seemed to me to be part of the program name, in the file pathway. Anyhow, please kindly see below my attempts:

Code: Select all

Babas-iMac:Desktop baba$ cd "/Users/baba/.wine/dosdevices/c:/Program Files (x86)/Electronic Edition 7/Windows/"
Babas-iMac:Windows baba$ wine Search.exe
wine: cannot find L"C:\\windows\\system32\\Search.exe"
Babas-iMac:Program Files (x86) baba$ wine Electronic\ Edition\ 7\ Windows\ Search.exe
wine: cannot find 'Electronic Edition 7 Windows Search.exe'
Babas-iMac:Program Files (x86) baba$ wine EE7\ Search.exe
wine: cannot find 'EE7 Search.exe'
Babas-iMac:Program Files (x86) baba$ wine start /unix  "/Users/baba/.wine/dosdevices/c:/Program Files (x86)/Electronic Edition 7/Windows/Search.exe"
0009:fixme:exec:SHELL_execute flags ignored: 0x00000100
/BuildRoot/Library/Caches/com.apple.xbs/Sources/AppleFSCompression/AppleFSCompression-96.200.3/Common/ChunkCompression.cpp:49: Error: unsupported compressor 8
/BuildRoot/Library/Caches/com.apple.xbs/Sources/AppleFSCompression/AppleFSCompression-96.200.3/Libraries/CompressData/CompressData.c:353: Error: Unknown compression scheme encountered for file '/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Exceptions.plist'
/BuildRoot/Library/Caches/com.apple.xbs/Sources/AppleFSCompression/AppleFSCompression-96.200.3/Common/ChunkCompression.cpp:49: Error: unsupported compressor 8
/BuildRoot/Library/Caches/com.apple.xbs/Sources/AppleFSCompression/AppleFSCompression-96.200.3/Libraries/CompressData/CompressData.c:353: Error: Unknown compression scheme encountered for file '/System/Library/CoreServices/CoreTypes.bundle/Contents/Library/AppExceptions.bundle/Exceptions.plist'
I made a few more attempts just now, and now it is no longer giving me the error that it cannot find the file i.e. "wine: cannot find...", but is instead telling me the command itself is not found "wine: command not found". Would the attempt at using "wine start" have brought this about?

Code: Select all

Babas-iMac:~ baba$ cd /Users/baba/.wine/dosdevices/c:/Program\ Files\ \(x86\)/Electronic\ Edition\ 7/Windows/
Babas-iMac:Windows baba$ wine Electronic\ Edition\ 7\ Windows\ Search.exe
-bash: wine: command not found
Babas-iMac:Windows baba$ wine Electronic\ Edition\ 7\ Search.exe
-bash: wine: command not found
Babas-iMac:Windows baba$ cd /Users/baba/.wine/dosdevices/c:/Program\ Files\ \(x86\)
Babas-iMac:Program Files (x86) baba$ wine Electronic\ Edition\ 7\ Search.exe
-bash: wine: command not found
Babas-iMac:Program Files (x86) baba$ wine
-bash: wine: command not found
Babas-iMac:Program Files (x86) baba$ wine start Electronic\ Edition\ 7\ Search.exe
-bash: wine: command not found
Babas-iMac:Program Files (x86) baba$ wine start /unix Electronic\ Edition\ 7\ Search.exe
-bash: wine: command not found
Babas-iMac:Program Files (x86) baba$ 
Last edited by Swarup on Fri Jul 26, 2019 8:59 am, edited 1 time in total.
jkfloris
Level 12
Level 12
Posts: 3136
Joined: Thu Aug 14, 2014 10:10 am

Re: Installed program not in ~/.wine/drive_c/Program\ Files/

Post by jkfloris »

Could you post the output of:

Code: Select all

cat /Users/baba/Desktop/EE7\ Search.desktop
and

Code: Select all

ls -asl "/Users/baba/.wine/dosdevices/c:/Program Files (x86)/Electronic Edition 7/Windows/"
Swarup
Level 2
Level 2
Posts: 22
Joined: Sat May 16, 2009 7:29 pm

Re: Installed program not in ~/.wine/drive_c/Program\ Files/

Post by Swarup »

Code: Select all

Babas-iMac:~ baba$ cat /Users/baba/Desktop/EE7\ Search.desktop
[Desktop Entry]
Name=EE7 Search
Exec=env WINEPREFIX="/Users/baba/.wine" wine C:\\\\Program\\ Files\\ \\(x86\\)\\\\Electronic\\ Edition\\ 7\\\\Windows\\\\Search\\\\EE7Search.exe 
Type=Application
StartupNotify=true
Path=/Users/baba/.wine/dosdevices/c:/Program Files (x86)/Electronic Edition 7/Windows/Search
Icon=2F6F_EE7Search.0
StartupWMClass=ee7search.exe
Babas-iMac:~ baba$ ls -asl "/Users/baba/.wine/dosdevices/c:/Program Files (x86)/Electronic Edition 7/Windows/"
total 0
0 drwxr-xr-x  5 baba  staff  160 Jul 25 00:56 .
0 drwxr-xr-x  7 baba  staff  224 Jul 25 00:56 ..
0 drwxr-xr-x  3 baba  staff   96 Jul 25 00:56 Icons
0 drwxr-xr-x  6 baba  staff  192 Jul 25 13:47 Search
0 drwxr-xr-x  3 baba  staff   96 Jul 25 00:56 Setup
Babas-iMac:~ baba$ 
jkfloris
Level 12
Level 12
Posts: 3136
Joined: Thu Aug 14, 2014 10:10 am

Re: Installed program not in ~/.wine/drive_c/Program\ Files/

Post by jkfloris »

Exec=env WINEPREFIX="/Users/baba/.wine" wine C:\\\\Program\\ Files\\ \\(x86\\)\\\\Electronic\\ Edition\\ 7\\\\Windows\\\\Search\\\\EE7Search.exe
You almost used the right path.
Reopen your WineHQ terminal and type:

Code: Select all

cd "/Users/baba/.wine/drive_c/Program Files (x86)/Electronic Edition 7/Windows/Search"
wine EE7Search.exe
Swarup
Level 2
Level 2
Posts: 22
Joined: Sat May 16, 2009 7:29 pm

Re: Installed program not in ~/.wine/drive_c/Program\ Files/

Post by Swarup »

I'm sorry, I'm not sure what you mean by a WineHQ terminal. What is the difference between a terminal window and a WineHQ terminal window? Probably, due to this misunderstanding I am getting the below i.e. "command not found":

Code: Select all

Babas-iMac:~ baba$ cd "/Users/baba/.wine/drive_c/Program Files (x86)/Electronic Edition 7/Windows/Search"
Babas-iMac:Search baba$ wine EE7Search.exe
-bash: wine: command not found
Babas-iMac:Search baba$ 
jkfloris
Level 12
Level 12
Posts: 3136
Joined: Thu Aug 14, 2014 10:10 am

Re: Installed program not in ~/.wine/drive_c/Program\ Files/

Post by jkfloris »

There is a program called "Terminal" which will open the default terminal window.
If you open the "Wine" program a terminal window is shown which, among other things, will set the "wine" command.
Swarup
Level 2
Level 2
Posts: 22
Joined: Sat May 16, 2009 7:29 pm

Re: Installed program not in ~/.wine/drive_c/Program\ Files/

Post by Swarup »

It worked! Beautiful. Thank you so much!

If you would be so kind, there are just two related last works in this connection:

1) I would like to make a script for this command, so as to create an icon and place it in the dock. This computer is actually for my colleague, who is not tech savvy and it would be difficult for him to have to deal with the wine terminal window.

On the basis of the pathway which we've confirmed could you let me know how to update the below generic script for our current program EE7Search. In the below, we need to replace $PATH_TO_PROGRAM with the path from the Program Files directory to my program executable. This a bit confusing to me due to the "x86".

Code: Select all

tell application "Terminal"
    do script "/usr/local/bin/wine ~/.wine/drive_c/Program\\ Files/$PATH_TO_PROGRAM.exe"
end tell
2) The search program actually consists of two sister programs, both of which are installed. We got the first one to open. The details on the second are as follows. If you could help by giving the wine terminal command for this sister program, and then the script to make an icon for it as above, this work will be all complete.

Name=Electronic Edition 7
Exec=env WINEPREFIX="/Users/baba/.wine" wine C:\\\\windows\\\\command\\\\start.exe \\"C:\\\\Program\\ Files\\ \\(x86\\)\\\\Electronic\\ Edition\\ 7\\\\HTML\\\\index.html\\"
Type=Application
StartupNotify=true
Icon=E428_EE7.0
jkfloris
Level 12
Level 12
Posts: 3136
Joined: Thu Aug 14, 2014 10:10 am

Re: Installed program not in ~/.wine/drive_c/Program\ Files/

Post by jkfloris »

1. Both the space and the brackets are special characters and have to be escaped with a backslash

Code: Select all

tell application "Terminal"
    do script "/usr/local/bin/wine ~/.wine/drive_c/Program\\ Files\\ \\(86\\)/$PATH_TO_PROGRAM.exe"
end tell
2.
Exec=env WINEPREFIX="/Users/baba/.wine" wine C:\\\\windows\\\\command\\\\start.exe \\"C:\\\\Program\\ Files\\ \\(x86\\)\\\\Electronic\\ Edition\\ 7\\\\HTML\\\\index.html\\"
This looks like a web page instead of program. Could you open:
"/Users/baba/.wine/drive_c/Program Files (x86)/Electronic Edition 7/HTML/index.html"
with Safari?
Swarup
Level 2
Level 2
Posts: 22
Joined: Sat May 16, 2009 7:29 pm

Re: Installed program not in ~/.wine/drive_c/Program\ Files/

Post by Swarup »

jkfloris wrote:1. Both the space and the brackets are special characters and have to be escaped with a backslash

Code: Select all

tell application "Terminal"
    do script "/usr/local/bin/wine ~/.wine/drive_c/Program\\ Files\\ \\(86\\)/$PATH_TO_PROGRAM.exe"
end tell
Ok, but we need to also replace the "$PATH_TO_PROGRAM" with the path to our program, right?

So would the below be correct?

Code: Select all

tell application "Terminal"
    do script "/usr/local/bin/wine ~/.wine/drive_c/Program\\ Files\\ \\(86\\)/Electronic Edition 7/Windows/Search/EE7Search.exe"
end tell
jkfloris wrote:2.
Exec=env WINEPREFIX="/Users/baba/.wine" wine C:\\\\windows\\\\command\\\\start.exe \\"C:\\\\Program\\ Files\\ \\(x86\\)\\\\Electronic\\ Edition\\ 7\\\\HTML\\\\index.html\\"
This looks like a web page instead of program. Could you open:
"/Users/baba/.wine/drive_c/Program Files (x86)/Electronic Edition 7/HTML/index.html"
with Safari?
It opens in one's web browser. Yes-- the link you gave here opens immediately in my web browser (I opened it in Chrome). And it is working properly. I don't know whether to call it a program or a web page, or both. Usually it can be triggered to open the web page by clicking an icon on one's desktop. That is how it always works in my windows computers. Can we make a script for it?
jkfloris
Level 12
Level 12
Posts: 3136
Joined: Thu Aug 14, 2014 10:10 am

Re: Installed program not in ~/.wine/drive_c/Program\ Files/

Post by jkfloris »

1. There are also spaces in "Electronic Edition 7". Each space get a double back slash in front.

Code: Select all

tell application "Terminal"
    do script "/usr/local/bin/wine ~/.wine/drive_c/Program\\ Files\\ \\(86\\)/Electronic\\ Edition\\ 7/Windows/Search/EE7Search.exe"
end tell
2. Create a link to the html file.

Code: Select all

ln -s "/Users/baba/.wine/drive_c/Program Files (x86)/Electronic Edition 7/HTML/index.html" "/Users/baba/Desktop/EE7.html"
You can replace the last "EE7.html" to any name you like. For example: "/Users/baba/Desktop/Some important website.html"
Swarup
Level 2
Level 2
Posts: 22
Joined: Sat May 16, 2009 7:29 pm

Re: Installed program not in ~/.wine/drive_c/Program\ Files/

Post by Swarup »

jkfloris wrote:1. There are also spaces in "Electronic Edition 7". Each space get a double back slash in front.

Code: Select all

tell application "Terminal"
    do script "/usr/local/bin/wine ~/.wine/drive_c/Program\\ Files\\ \\(86\\)/Electronic\\ Edition\\ 7/Windows/Search/EE7Search.exe"
end tell
I added an 'x' next to the '86' as I think it was supposed to be 'x86', right? Then I entered the above into an Apple Script window; when I clicked on "compile", I received the below:

Code: Select all

Syntax error: Expected “end” or “end tell” but found unknown token.
Any idea where the mistake is?

For convenience, I am pasting here the command that worked in the WINE terminal window for starting the program:

Code: Select all

cd "/Users/baba/.wine/drive_c/Program Files (x86)/Electronic Edition 7/Windows/Search"
wine EE7Search.exe
The very beginning of the pathway is different: "/Users/baba/.wine/..." versus how it is in the script "/usr/local/bin/wine ~/.wine...". Would that matter?
jkfloris
Level 12
Level 12
Posts: 3136
Joined: Thu Aug 14, 2014 10:10 am

Re: Installed program not in ~/.wine/drive_c/Program\ Files/

Post by jkfloris »

I added an 'x' next to the '86' as I think it was supposed to be 'x86', right?
:oops: You are right!
Any idea where the mistake is?
I'm not sure where your Wine installation is stored. Could you open the Wine terminal and post the output of:

Code: Select all

which wine
Swarup
Level 2
Level 2
Posts: 22
Joined: Sat May 16, 2009 7:29 pm

Re: Installed program not in ~/.wine/drive_c/Program\ Files/

Post by Swarup »

Code: Select all

Babas-iMac:~ baba$ which wine
/Applications/Wine Stable.app/Contents/Resources/wine/bin/wine
Swarup
Level 2
Level 2
Posts: 22
Joined: Sat May 16, 2009 7:29 pm

Re: Installed program not in ~/.wine/drive_c/Program\ Files/

Post by Swarup »

Somewhere along the path of my experimentation with making a script, something worked. There is now an item in the "Recents" folder in finder called "EE7Search.exe", and when I click on that the program opens. However, if I move that time from "Recents" into "Applications", then it no longer works. I don't trust that this item is going to always remain present in the "Recents" folder, hence my desire to put it somewhere permanent such as in the Applications folder. But as stated, when I move it there then clicking on it no longer opens the program. I would like to have a functioning icon sitting permanently in the dock for this program.
Swarup
Level 2
Level 2
Posts: 22
Joined: Sat May 16, 2009 7:29 pm

Re: Installed program not in ~/.wine/drive_c/Program\ Files/

Post by Swarup »

jkfloris wrote:2. Create a link to the html file.

Code: Select all

ln -s "/Users/baba/.wine/drive_c/Program Files (x86)/Electronic Edition 7/HTML/index.html" "/Users/baba/Desktop/EE7.html"
You can replace the last "EE7.html" to any name you like. For example: "/Users/baba/Desktop/Some important website.html"
I executed the above command in an ordinary terminal window. It seemed to execute without any error message. Now I need to know where to find the "link" that is supposed to have been created by the above command.
jkfloris
Level 12
Level 12
Posts: 3136
Joined: Thu Aug 14, 2014 10:10 am

Re: Installed program not in ~/.wine/drive_c/Program\ Files/

Post by jkfloris »

1.
Does this script do the trick?

Code: Select all

tell application "Terminal"
    do script "/Applications/Wine\\ Stable.app/Contents/Resources/wine/bin/wine /Users/baba/.wine/drive_c/Program\\ Files\\ \\(x86\\)/Electronic\\ Edition\\ 7/Windows/Search/EE7Search.exe"
end tell
2.
There should be a link on the Desktop
Swarup
Level 2
Level 2
Posts: 22
Joined: Sat May 16, 2009 7:29 pm

Re: Installed program not in ~/.wine/drive_c/Program\ Files/

Post by Swarup »

I compiled the script and it compiled without any error. It also ran fine. On the desktop there is a link for starting up the html search program. And when I click on it, it does open the page on a web browser. So that is working perfectly.

I am not sure though: The script you just provided was not for the html but for the desktop program, right? I think something you had given earlier is what got the html link on the desktop. We still have no permanent icon for starting up the desktop EE7 Search program. If we can get a permanent icon for that in the dock or on the desktop, that will be perfect.

(As I mentioned earlier, there is an item in "Recents" which, when clicked, opens the desktop EE7 search program. But the items in "Recents" change depending on what was used recently, right? So we need to get this item into the "Applications" folder, or on the desktop, or in the dock as a permanent item.)
jkfloris
Level 12
Level 12
Posts: 3136
Joined: Thu Aug 14, 2014 10:10 am

Re: Installed program not in ~/.wine/drive_c/Program\ Files/

Post by jkfloris »

The script you just provided was not for the html but for the desktop program, right?
You are right, the script will launch the desktop program.
We still have no permanent icon for starting up the EE7 Search desktop program.
You can turn a AppleScript into a program:

Code: Select all

File -> Save ->
  Save As: EE7 Search
  Tags:     <leave blank>
  Where:   Desktop

  File Format: Application
  Options:    <none selected>
Save
Drag-and-drop the new desktop icon to the dock if you like.

I think something you had given earlier is what got the html link on the desktop.
Yes, this post creates a link to the html page on de desktop.
Swarup
Level 2
Level 2
Posts: 22
Joined: Sat May 16, 2009 7:29 pm

Re: Installed program not in ~/.wine/drive_c/Program\ Files/

Post by Swarup »

Ok yes, that is perfect. You can see I know nothing about Mac computers :roll:
Now everything is solved. There are two icons on the desktop-- one for opening the html page, and one for opening the desktop program. And I've created an instance of the desktop icon in the dock as well. Problem solved!

Many thanks, you have been a great guide.

(I have just looked around this forum page, but do not see a place to mark this thread as "solved". Is there such a marker in Wine Forums?)
Locked