HOW TO - Create working Wine desktop launcher
Ok, some hard earned info for all you folks that like those pretty desktop icons to click and play
Are your Wine menu items not working right? Have you tried to make a desktop launcher for a Wine program but can't seem to make it work? Here's the answer, step by easy step.
First, the reason you have a problem. Two reasons really, not related. First, I've found some games' launcher exe files just don't work right, and you have to use the main exe file to get the program to run.
Second, Windows and/or Wine (not sure which is to blame) is picky ... it wants to BE in the directory the file is in WHEN you run the exe. Normal menu items point to the program using the path, i.e. /home/ed/.wine/la la la .exe. That won't cut it.
So, you have to create a script that will change to the proper directory, then run the right file. Here is how you do that. We are going to create a launcher for World of Warcraft. Commands you type are in color. Important things are in bold.
Open a terminal.
Type sudo gedit (or gkedit or whatever editing program you use).
Type in your password.
Add the following lines to the file:
The first line is for the bash script.
cd ~/.wine/drive_c/World\ of\ Warcraft/
The second line changes to the World of Warcraft directory. If your WoW is installed somewhere else, edit this line to match your path. The \ MUST be used after any word that has a space after it.
The third line runs the program.
Time to save the file. I personally like to put script files in my /bin directory, which is located under File System. Browse to the bin directory.
Save the file as wow.sh
In the terminal, type the following command:
chmod a+x /bin/wow.sh
This makes the script an executable file.
Close the terminal.
Now to make the desktop launcher ... right click on the desktop and choose Create Launcher.
Under Name, type World of Warcraft (unless you want to call it something else).
Under Command, type /bin/wow.sh
Leave Comment blank, or put whatever pleases you there, like the date or Ubuntu rocks!
The default icon sucks, so if you want to change it, right click on your new launcher, choose Properties, then left click on the icon and choose a different one and click Open. I personally download icons from the web and save them in an icon folder in my home directory.
Presto! You can now run World of Warcraft flawlessly from your desktop icon.
This info can be changed to suit any Wine program. Pass on what you've learned, and do tell me if this does not work for you so I can update the instructions.
Learn something new and have fun every day! Ubuntu!