alias defined in bash_profile doesn't work for wine, while the same path given in CLI works

Questions about Wine on macOS.
Locked
darwinexe
Level 1
Level 1
Posts: 5
Joined: Sun Feb 16, 2020 1:49 am

alias defined in bash_profile doesn't work for wine, while the same path given in CLI works

Post by darwinexe »

I defined an alias for a program LTSpice as follows in .bash_profile:

Code: Select all

alias ltspice="/Users/me/Desktop/trashh/ltc/scad3.exe"
I want to run it as

Code: Select all

$ wine ltspice
wine: cannot find L"C:\\windows\\system32\\ltspice.exe"
$
However this works:

Code: Select all

$ wine /Users/me/Desktop/trashh/ltc/scad3.exe
How can I get alias to work?
Gcenx
Level 6
Level 6
Posts: 709
Joined: Mon Dec 25, 2017 12:11 pm

Re: alias defined in bash_profile doesn't work for wine, while the same path given in CLI works

Post by Gcenx »

Your giving wine a Unix path when it’s expecting a Windows path so it ignores the path

To use a Unix path you would need to instead do;

Code: Select all

wine start /unix "/Users/me/Desktop/trashh/ltc/scad3.exe"
Also you don’t need to launch via terminal if you got the application working you could instead make a Apple script launcher.
User avatar
DarkShadow44
Level 8
Level 8
Posts: 1207
Joined: Tue Nov 22, 2016 5:39 pm

Re: alias defined in bash_profile doesn't work for wine, while the same path given in CLI works

Post by DarkShadow44 »

Gcenx wrote: Sun Feb 16, 2020 9:09 am Your giving wine a Unix path when it’s expecting a Windows path so it ignores the path
Actually, that's not the case - wine can start a program using a Unix path just fine.

The actual problem here is, that wine doesn't know about aliases. The alias is resolved by bash, you can't pass an alias to wine like that.
darwinexe
Level 1
Level 1
Posts: 5
Joined: Sun Feb 16, 2020 1:49 am

Re: alias defined in bash_profile doesn't work for wine, while the same path given in CLI works

Post by darwinexe »

I could use an Automator made app. Could you tell me which executable to use for wine path among these two? I have both in PATH rn.

Code: Select all

/Users/me/Applications/Wine Stable.app/Contents/Resources/start/bin
/Users/me/Applications/Wine Stable.app/Contents/Resources/wine/bin
darwinexe
Level 1
Level 1
Posts: 5
Joined: Sun Feb 16, 2020 1:49 am

Re: alias defined in bash_profile doesn't work for wine, while the same path given in CLI works

Post by darwinexe »

Never mind, its in /Users/me/Applications/Wine\ Stable.app/Contents/MacOS/wine
Gcenx
Level 6
Level 6
Posts: 709
Joined: Mon Dec 25, 2017 12:11 pm

Re: alias defined in bash_profile doesn't work for wine, while the same path given in CLI works

Post by Gcenx »

The correct location is

Code: Select all

 /Users/me/Applications/Wine Stable.app/Contents/Resources/wine/bin
as that contains the other components of wine.

Launching via

Code: Select all

 /Users/me/Applications/Wine\ Stable.app/Contents/MacOS/wine
Means your launching the wrapper to then launch wine and not all environment variables will be passed onto wine correctly.
darwinexe
Level 1
Level 1
Posts: 5
Joined: Sun Feb 16, 2020 1:49 am

Re: alias defined in bash_profile doesn't work for wine, while the same path given in CLI works

Post by darwinexe »

Gcenx wrote: Mon Feb 17, 2020 9:52 am The correct location is

Code: Select all

 /Users/me/Applications/Wine Stable.app/Contents/Resources/wine/bin
as that contains the other components of wine.

Launching via

Code: Select all

 /Users/me/Applications/Wine\ Stable.app/Contents/MacOS/wine
Means your launching the wrapper to then launch wine and not all environment variables will be passed onto wine correctly.
Okay I have changed it! Thanks a lot
https://i.stack.imgur.com/52lJ2.png works great!
Locked