Creat a shotcut for app launcher

Questions about Wine on macOS.
Locked
Fisker
Newbie
Newbie
Posts: 4
Joined: Fri Aug 16, 2013 5:04 am

Creat a shotcut for app launcher

Post by Fisker »

Hello ppl

I'm new to wine, only used wineskin before and try some of the others to get a windows program to work without any luck. So i tried to install it my self in wine where i create a prefix and actually got all of the programs i need to run :D :D So now i can uninstall my bootcamp partition, wuuhu :D

But i'll only got one problem now, and that is how do i create a shortcut in my app launcher so i don't have to use wine file manager to find the .exe and execute it? i've tried what the MacOSX FAQ said "How to create an icon on the desktop to start a given .exe" but couldn't get it working.
So now i am asking for some help to get this to work.

i appreciate your help and time!

- Fisker
doh123
Level 8
Level 8
Posts: 1227
Joined: Tue Jul 14, 2009 1:21 pm

Re: Creat a shotcut for app launcher

Post by doh123 »

It looks like that word-wrap changed since i wrote that entry... and its all jumbled up... here is what you can do.

You can make an AppleScript app launcher using the code on that page... here it is easier to read

Code: Select all

on run
	
	--edit this to be the correct location and file to run (typically only edit after the "drive_c")
	set toRun to "$WINEPREFIX/drive_c/Program Files/MyProgram/MyProgramName.exe"
	
	--edit winePrefix if you are not using the default prefix
	set winePrefix to "$HOME/.wine"
	
	--edit wineLocation if your wine install is not the default location
	set wineLocation to "/usr/local/bin"
	
	--edit dyldFallbackLibraryPath to your X11 lib folder, this one is set for XQuartz on 10.6+
	set dyldFallbackLibraryPath to "/opt/X11/lib"
	-------------------------------------------------------
	--DO NOT EDIT ANYTHING BELOW THIS LINE
	-------------------------------------------------------
	set toRunPath to do shell script "WINEPREFIX=\"" & winePrefix & "\"; TEMPVAR=\"" & toRun & "\"; echo \"${TEMPVAR%/*}\""
	set toRunFile to do shell script "WINEPREFIX=\"" & winePrefix & "\"; 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
Just paste that in AppleScript editor, edit the top lines to be the right locations, and save it as an app bundle, and you'll have an app you can double click and run
Maexel
Level 3
Level 3
Posts: 71
Joined: Fri Dec 07, 2012 11:08 am

Re: Creat a shotcut for app launcher

Post by Maexel »

Hi Fisker,

In addition, you can follow the instructions from David Baumgold's site :wink: .
(http://www.davidbaumgold.com/tutorials/ ... #dock-icon)

If wine is in its default folder (use/local/bin), which will be the case when installed over MacPorts, you can simply follow the step by step advices on the website.

Cheers mate,
Maexel
Fisker
Newbie
Newbie
Posts: 4
Joined: Fri Aug 16, 2013 5:04 am

Re: Creat a shotcut for app launcher

Post by Fisker »

dont know if i am doing anything wrong or it is because off the wine application i am using.

iv'e got a wine app in my /Applications folder, installed as a drag and drop ap
so my winelocation is "/Applications/wine" ?

The Prefix i am using is one i made myself, so i easily can share it with some classmates who also needs it. and that Prefix is located at /Users/Nicklas/Documents and is called FEM-Design, so the wine Prefix must be, "$/Users/Nicklas/Documents/FEM-Design" ?

--edit dyldFallbackLibraryPath to your X11 lib folder, this one is set for XQuartz on 10.6+, this one i am not quiet sure off, i once had XQuartz on my mac but deleted is as i didn't have any need for it, but i got the folder path called "/opt/X11/lib" as its suggest but is there any specific files that need to be there ?

so this i what i end up with:

Code: Select all

on run
	
	--edit this to be the correct location and file to run (typically only edit after the "drive_c")
	set toRun to "$WINEPREFIX/drive_c/Program Files/STRUSOFT/FEM-Design 12.0/fd3dstruct.exe"
	
	--edit winePrefix if you are not using the default prefix
	set winePrefix to "$/Users/Nicklas/Documents/FEM-Design"
	
	--edit wineLocation if your wine install is not the default location
	set wineLocation to "/Applications/wine"
	
	--edit dyldFallbackLibraryPath to your X11 lib folder, this one is set for XQuartz on 10.6+
	set dyldFallbackLibraryPath to "/opt/X11/lib"
	-------------------------------------------------------
	--DO NOT EDIT ANYTHING BELOW THIS LINE
	-------------------------------------------------------
	set toRunPath to do shell script "WINEPREFIX=\"" & winePrefix & "\"; TEMPVAR=\"" & toRun & "\"; echo \"${TEMPVAR%/*}\""
	set toRunFile to do shell script "WINEPREFIX=\"" & winePrefix & "\"; 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


Which does absolutely nothing when i run it :(. hope my explanation can help you help me with this or else i will try and install wine in the way suggesting on this link: http://www.davidbaumgold.com/tutorials/ ... #dock-icon as you posted (:
doh123
Level 8
Level 8
Posts: 1227
Joined: Tue Jul 14, 2009 1:21 pm

Re: Creat a shotcut for app launcher

Post by doh123 »

if you have some "wine.app" then you do not have normal plain Wine... which is what that is made for. I'm assuming what you have is the Wine.app that comes with WineBottler. That is part of WineBottler and not just normal plain Wine.

3rd party Wine using apps aren't supported here (too much a of a nightmare to support so many different programs doing different things). I'd assume this script will still work, but you need to get the real path to the Wine executable... Wine.app is not the executable, its inside there somewhere... you can right click on the app and "Show Package Contents" and dig around inside and find some bin folder somewhere that has wine and wineserver and winecfg and such in it... so your path would be something like...
/Applications/Wine.app/Contents/Resources/SomeFolder/someOtherFolder/bin

You'll also want to pull that $ off the front of the wineprefix setting ($ is for specifying a variable)... either use the full path or the $HOME variable.
/Users/Nicklas/Documents/FEM-Design
$HOME/Documents/FEM-Design
both are the same thing if the current user logged in is Nicklas. ... and your sure thats really the wineprefix you installed to.
Fisker
Newbie
Newbie
Posts: 4
Joined: Fri Aug 16, 2013 5:04 am

Re: Creat a shotcut for app launcher

Post by Fisker »

ahh okay, i wasnt sure weather is was navtive wine app or it was some easy to install way. but thanks for clearing that for me! and thanks for the support even if its not within the rules.

i am gonna try it out or just install plain wine.

many thanks and thank you for the quick reply! :D
Fisker
Newbie
Newbie
Posts: 4
Joined: Fri Aug 16, 2013 5:04 am

Re: Creat a shotcut for app launcher

Post by Fisker »

Again many thanks for the help, the only thing that i need to change was the bin folder location so thank you thank you!! :D
Locked