How to find the path to wine program files?

Joined
Dec 20, 2012
Messages
12
Reaction score
0
Points
1
I have installed a program via wine, and am trying to put an icon for it in the doc. I found instructions for how to do it-- I need to make a script for launching the program and put that script in the doc. Here is the script I need to make via AppleScript Editor

Code:
tell application "Terminal"
    do script "/opt/local/bin/wine ~/.wine/drive_c/Program\\ Files/$PATH_TO_PROGRAM.exe"
end tell

But in the above code I need to need to replace $PATH_TO_PROGRAM with the path from the Program Files directory to your program executable. I have spent the last hour googling about finding hidden files and system files in mac, and although I activated those options I still can't find the "c-drive" which wine has made, along with the program files located there. I just need to find the pathway to the .exe file to put it into the above code. What is the way to do this in mac?
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
In Finder, push Shift-Command-G and enter the following:
Code:
~/.wine/drive_c/
Navigate from there to find the name of the relevant folder.

Remember, when using directory names in that Applescript, you need to replace spaces with "\ " (without the quotes and the space).
 
OP
S
Joined
Dec 20, 2012
Messages
12
Reaction score
0
Points
1
I got the pathway by the directions you have given. Here is the pathway to the .exe file:

Code:
/Users/[username]/.wine/drive_c/Program\ Files/Electronic\ Edition\ 7.5/Windows/Search/EE7Search.exe

On that basis here is the code that I made:

Code:
tell application "Terminal"
    do script "/opt/local/bin/wine ~/.wine/drive_c/Program\\ Files/Electronic\Edition\7.5/Windows/Search/EE7Search.exe"
end tell

When I click "compile", get the error:

Syntax Error: Expected """ but found unknown token.

Together with the above error note, it highlights the "E" of "Edition". I had removed the space before the word "Edition", as per what I understood from you. But when the error came, then I tried placing a space between the "\" and the "E". But with the space there I still get the same error, just the highlight comes at the space itself.

What is wrong with my syntax?

Other than that I know the pathway is proper, because when I click directly on that .exe file in Finder, it opens the program.
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,762
Reaction score
2,100
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
Spaces in paths are just annoying..you want to use a single '\' and follow that with a space to escape it and get the space..

During the installation of the application, if you had the option to set the path of the installation, delete this installation, re-install and choose to use "program_files/Electronic_Edition_7.5" instead of the directories with spaces..
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Replace:
Code:
/opt/local/bin/wine ~/.wine/drive_c/Program\\ Files/Electronic\Edition\7.5/Windows/Search/EE7Search.exe
with:
Code:
/opt/local/bin/wine ~/.wine/drive_c/Program\ Files/Electronic\ Edition\ 7.5/Windows/Search/EE7Search.exe
 
OP
S
Joined
Dec 20, 2012
Messages
12
Reaction score
0
Points
1
Vansmith, I implemented the change you indicated-- but am still getting the syntax error. Here is the current code:

Code:
tell application "Terminal"
    do script "/opt/local/bin/wine ~/.wine/drive_c/Program\ Files/Electronic\ Edition\ 7.5/Windows/Search/EE7Search.exe"
end tell

The same syntax error is coming as I mentioned above, and now the highlight is appearing at the space before the word "Files".
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,762
Reaction score
2,100
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
Open a terminal and enter the string "/opt/local/bin/wine ~/.wine/drive_c/Program\ Files/Electronic\ Edition\ 7.5/Windows/Search/EE7Search.exe" without the double quotes and see if it works..
 
OP
S
Joined
Dec 20, 2012
Messages
12
Reaction score
0
Points
1
Open a terminal and enter the string "/opt/local/bin/wine ~/.wine/drive_c/Program\ Files/Electronic\ Edition\ 7.5/Windows/Search/EE7Search.exe" without the double quotes and see if it works..

Yes, it works. When pasted into a terminal window, it will boot up the program.

But when I put that very code into the Applescript and click "compile", it gives a syntax error. And I need the Applescript in order to create an icon for the doc.
 
OP
S
Joined
Dec 20, 2012
Messages
12
Reaction score
0
Points
1
If my post #8 just above has a solution, that will be wonderful and I will be most happy to execute that.

If no one knows how the Applescript can be made to work when there are spaces in the pathway, i.e. if the spaces are indeed the problem here, then please instruct me how to uninstall the wine program which I have installed. During its installation there is indeed the option to set the path of the installation. So in the absence of a solution to my post#8 above, I will delete this installation, re-install and choose to use "program_files/Electronic_Edition_7.5" instead of the directories with spaces.
 
OP
S
Joined
Dec 20, 2012
Messages
12
Reaction score
0
Points
1
Sorry to bump this thread, but I need a solution...

If someone knows how to get the Applescript to work with the existing spaces in the pathway, please let me know. Otherwise, if someone can let me know how to uninstall this application from within wine, then please let me know. Then I can reinstall it, and take the spaces out of the pathway. Either one will allow me to solve this. Thanks!
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Yes, it works. When pasted into a terminal window, it will boot up the program.

But when I put that very code into the Applescript and click "compile", it gives a syntax error. And I need the Applescript in order to create an icon for the doc.
What syntax error? If the line works outside of the Apple script editor, I'm going to guess that you simply pasted it wrong.
 
Joined
Oct 27, 2014
Messages
1
Reaction score
0
Points
1
An alternative approach

I know this is an old thread, but I needed the same feature.
As an alternative solution, I used the advice from this page to find the directory in finder, but then dragged it to the side-bar.
This provides a quick link from Finder (as opposed to the desktop) to all of the Windows applications (Program Files). I could have chosen a single program to drag there instead (e.g. WinSCP).
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top