How to make icon to command on mac?

Questions about Wine on macOS.
Locked
Bazilisk
Level 2
Level 2
Posts: 47
Joined: Sat Sep 12, 2009 3:27 pm

How to make icon to command on mac?

Post by Bazilisk »

Is it possible to make grafic icon to start comand "wine win.exe" on Mac Os?
It will pleasent to start without Terminal...
doh123
Level 8
Level 8
Posts: 1227
Joined: Tue Jul 14, 2009 1:21 pm

Re: How to make icon to command on mac?

Post by doh123 »

Bazilisk wrote:Is it possible to make grafic icon to start comand "wine win.exe" on Mac Os?
It will pleasent to start without Terminal...
yes... I wrote a small way to do so in the FAQ by making an Applescript .app launcher...

http://wiki.winehq.org/MacOSX/FAQs#head ... fc87fd3911

not terribly easy, but you should be able to figure it out... just have to edit the code slightly.
doh123
Level 8
Level 8
Posts: 1227
Joined: Tue Jul 14, 2009 1:21 pm

Re: How to make icon to command on mac?

Post by doh123 »

doh123 wrote: yes... I wrote a small way to do so in the FAQ by making an Applescript .app launcher....
I just updated the FAQ, I wrote that so long ago, it was kinda tough to use... so i re-wrote a better applescript there you can use thats much easier to edit for what you need.
Bazilisk
Level 2
Level 2
Posts: 47
Joined: Sat Sep 12, 2009 3:27 pm

sorry

Post by Bazilisk »

2 problems

I installed wine thru MacPorts and can not sure about /path/to/wine

Code: Select all

#! /bin/sh
export WINEPREFIX=$HOME/.wine
export DYLD_FALLBACK_LIBRARY_PATH=/usr/X11/lib
cd "/path/to/my/app" && exec wine "myapp.exe"
I put wine without /path/to/ becouse I can not find it :(

I save it as soft.config
When I try to start it Mac asked about default application for .config
I selected Terminal (not sure what is correct)
When I click on soft.config - myapp.exe dont started :(
May be wrong path to wine, may be wrong application to run config.
What the correct choise?
doh123
Level 8
Level 8
Posts: 1227
Joined: Tue Jul 14, 2009 1:21 pm

Re: sorry

Post by doh123 »

Bazilisk wrote:2 problems

I installed wine thru MacPorts and can not sure about /path/to/wine

Code: Select all

#! /bin/sh
export WINEPREFIX=$HOME/.wine
export DYLD_FALLBACK_LIBRARY_PATH=/usr/X11/lib
cd "/path/to/my/app" && exec wine "myapp.exe"
I put wine without /path/to/ becouse I can not find it :(

I save it as soft.config
When I try to start it Mac asked about default application for .config
I selected Terminal (not sure what is correct)
When I click on soft.config - myapp.exe dont started :(
May be wrong path to wine, may be wrong application to run config.
What the correct choise?
your doing a bash script to run through terminal? The longer bit of code I stuck up there that uses Applescript wont use terminal to run.

if you want to go the terminal way, you need the save it as .command , not .config .. and it'll open by default in Terminal.app.

Macports installs Wine by default to /opt/local/bin

if you type this in Terminal, it will tell you where it finds wine in the path...

Code: Select all

which wine

I do recommend the other entry I put in there about using Applescript Editor.
You just copy and paste the code in the editor, edit the first line section for the exe location...(other lines are optional, the directions are written beside them)

then in Applescript Editor you "save as" "application" and it makes a normal Mac .app that you can double click and it runs... no terminal or anything. You can also change its Icon the same way you change any Icon in OSX, and make it look more customized.
Bazilisk
Level 2
Level 2
Posts: 47
Joined: Sat Sep 12, 2009 3:27 pm

not working

Post by Bazilisk »

I usual start soft in Terminal as:

Code: Select all

wine ~/desktop/bullion/bulliator.exe
I made script in AppleScript:on run

Code: Select all

	--edit this to be the correct location and file to run (typically only edit after the "drive_c")
	set toRun to "~/desktop/bullion/bulliator.exe"
	--edit winePrefix if you are not using the default prefix
	set winePrefix to "~/.wine"
	--edit wineLocation if your wine install is not the default location
	set wineLocation to "/opt/local/bin"
	--edit dyldFallbackLibraryPath if your using X11.app that is not the default Apple one
	set dyldFallbackLibraryPath to "/usr/X11/lib"
	-------------------------------------------------------
	--DO NOT EDIT ANYTHING BELOW THIS LINE
	-------------------------------------------------------
	set toRunPath to do shell script "TEMPVAR=\"" & toRun & "\"; echo \"${TEMPVAR%/*}\""
	set toRunFile to do shell script "TEMPVAR=\"" & toRun & "\"; TEMPVAR2=\"" & toRunPath & "\"; echo \"${TEMPVAR#$TEMPVAR2/}\""
	do shell script "PATH=\"" & wineLocation & ":$PATH\";
export WINEPREFIX=\"" & winePrefix & "\";
export DYLD_FALLBACK_LIBRARY_PATH=\"" & dyldFallbackLibraryPath & "\";
cd \"" & toRunPath & "\";
wine \"" & toRunFile & "\" > /dev/null 2>&1 &"
end run
But its not working
When I make

Code: Select all

which wine
I have:

Code: Select all

/opt/local/bin/wine
Where is my mistake?
Bazilisk
Level 2
Level 2
Posts: 47
Joined: Sat Sep 12, 2009 3:27 pm

Post by Bazilisk »

Sorry, I found

Its not working with ~/desktop

Correct is Users/name/desktop
doh123
Level 8
Level 8
Posts: 1227
Joined: Tue Jul 14, 2009 1:21 pm

Post by doh123 »

Bazilisk wrote:Sorry, I found

Its not working with ~/desktop

Correct is Users/name/desktop
so you got it working?

yes you cannot use ~ for home

you can use $HOME though...

$HOME will always be set to the same thing as when you type ~ in terminal. Its why the default wineprefix is set in there to $HOME/.wine, don't change it to ~/.wine ... if you do thats fine cuz it'll fail and just go to the default of the same location... but you could use a prefix thats like right beside your .exe file in the same folder, then you wouldnt have to worry about any other Wine apps you might run in the future that will mess with $HOME/wine
Bazilisk
Level 2
Level 2
Posts: 47
Joined: Sat Sep 12, 2009 3:27 pm

Post by Bazilisk »

Thanks a great!
asheenlevrai
Level 1
Level 1
Posts: 9
Joined: Sun Jan 17, 2010 12:51 pm

Post by asheenlevrai »

it didn't work for me (neither the .command file and nor script).

on execution of the .command file it says I do not have the rights to execute. propreties say that I can read&write this file (I can not set to read,write&execute)

clicking on the generated .app file opens nothing (seems like it quits immediately)

FYI: OS X snow leopard (10.6.2)
wine 1.1.36

thanx a lot for your help

-a-
JimmyO
Newbie
Newbie
Posts: 2
Joined: Mon Jun 28, 2010 2:12 pm

Post by JimmyO »

I am sorry for resurrecting this topic, but I've been looking for this answer for a while and haven't found it. I am having the same issues the user 'asheenlevrai' presented. I am using Mac OS 10.6.4 Snow Leopard, and whenever I try to run the program with this method, it looks like it opens for a fraction of a second then quits, and running through AppleScript itself just returns an empty string.

Is there any way to solve this?
JimmyO
Newbie
Newbie
Posts: 2
Joined: Mon Jun 28, 2010 2:12 pm

Post by JimmyO »

Never mind me, I solved it, sorry >.> :oops:
asheenlevrai
Level 1
Level 1
Posts: 9
Joined: Sun Jan 17, 2010 12:51 pm

Post by asheenlevrai »

well, maybe you'd like to share with us?
;-)
doh123
Level 8
Level 8
Posts: 1227
Joined: Tue Jul 14, 2009 1:21 pm

Post by doh123 »

asheenlevrai wrote:well, maybe you'd like to share with us?
;-)
if you could copy and paste the full code your using into code tags here for the launcher, we could try to figure out why its not working...
Locked