Find the answer to your Linux question:
Results 1 to 9 of 9
Hi, Having dabbled with Linux for years, I have now finally decided to consign M$oft to the dustbin. Since installing Ubuntu 9.04 as a dual boot system some weeks ago, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2009
    Location
    France
    Posts
    5

    Adding shortcuts for Wine


    Hi,

    Having dabbled with Linux for years, I have now finally decided to consign M$oft to the dustbin. Since installing Ubuntu 9.04 as a dual boot system some weeks ago, I have found no need to boot into Window$ at all. However, as a programmer (during the last several years in Delphi Pascal) I have written half a dozen utilities which I still want to use – at least until I have learned to reprogram them in Python! In general they work well using Wine (I have version 1.0.1), give or take minor display issues arising from different fonts and sizes.

    My problem is that I cannot create desktop, panel, or menu shortcuts for these programs. Each program is contained entirely in its own folder (I hate the bloated Window$ Registry, and always prefer to have .ini or .dat files containing any necessary information) so there is no setup to be done; simply copying the program's folder from Window$ to Ubuntu is all that's needed. This means that Wine cannot be used to install the program into Ubuntu, which in turn means that there is no automatic Applications -> Wine -> Programs entry.

    My approach was to copy the folder MyProg into /.wine/drive_c/ , then to right click MyProg.exe in that folder and select “Open with Wine Windows Program Loader”. Subsequently a double click on MyProg.exe runs the program correctly, but this means navigating to the MyProg folder each time I want to run the program. I have tried three ways to create a shortcut:

    1.Right click on a blank area of screen and choose Create Launcher. Leave Type as Application, and put “/home/username/.wine/drive_c/MyProg/MyProg.exe” either by typing, or using Browse. This creates a screen launcher but, when clicked, the Launcher does absolutely nothing, not even an error message.

    2.Creating a launcher on the Panel is equally non-effective.

    3.System -> Preferences -> Main Menu . Then under Wine -> Programs select New Item and fill in the Create Launcher box as before. Now under Applications -> Wine -> Programs I have a new menu item for MyProg, but clicking on this produces exactly the same as before – nothing at all.

    Using Configure Wine to add MyProg.exe into the Applications tab makes no difference. And going to home/.local/share/applications/MyProg and setting Properties -> Permissions to read and write, and clicking the “Allow executing file as program” makes no difference either.

    Even using the Command Line (Alt/F2) to run “/home/username/.wine/drive_c/MyProg/MyProg.exe” produces nothing, although this is said to log error messages.

    Has anyone any suggestions for creating working shortcuts for Wine with non-installable programs? Perhaps Wine can be used to copy the MyProg folder across from Window$, which would be at least part of a setup procedure. I'd be most grateful for any help!

    CNB

  2. #2
    Linux Enthusiast meton_magis's Avatar
    Join Date
    Oct 2006
    Location
    arizona
    Posts
    699
    from the command prompt, run
    ln -s ~/.wine/drive_c ~/Desktop/wine_c_drive

    This will create a folder icon on your desktop named "wine_c_drive" that you can just open to get to your programs. There may be a better solution for what you're looking for, but this would work until someone can post something better.
    New to the internet, technical forums, or the hacker / open source community??
    Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html

    RHCE for RHEL version 5
    RHCT for RHEL version 4

  3. #3
    Just Joined!
    Join Date
    Jul 2009
    Location
    France
    Posts
    5
    Thanks meton_magis. That will certainly save me a good deal of navigating! I'd still like to do the job properly and set up a menu or shortcut, though.

    Incidentally, if I try to run MyProg.exe in Terminal it works perfectly well when I cd down to MyProg and invoke "wine MyProg.exe" from there, but if I try invoking
    "~/.wine/drive_c/MyProg/MyProg.exe"
    from my home directory, I get a whole screed of error message information. Is there any point in dumping to a file and posting it on this forum (or perhaps on the Wine forum)?

    CNB

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Enthusiast meton_magis's Avatar
    Join Date
    Oct 2006
    Location
    arizona
    Posts
    699
    have you tried
    wine ~/.wine/drive_c/MyProg/MyProg.exe
    ???

    as far as I know, if you try to execute something from bash, it will not try to interpret it, just attempt to execute it (unless it is a script with a #!/bin/interpreter line).

    in the X gui, it will look at the type of file it is, and try to find an appropriate application to run it, in this case being wine.
    New to the internet, technical forums, or the hacker / open source community??
    Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html

    RHCE for RHEL version 5
    RHCT for RHEL version 4

  6. #5
    Just Joined!
    Join Date
    Jul 2009
    Location
    France
    Posts
    5
    Yes, I had tried that too - and got the same screed of error message.

    I'm now thinking of writing a simple script which will cd down to the relevant file, run it with Wine, and exit out. Doing the necessary reading-up to find out how to do this!

    CNB

  7. #6
    Just Joined!
    Join Date
    Jul 2009
    Location
    France
    Posts
    5
    Ok, I have my work-around. Create a shell script called MyProg.sh

    cd ~/.wine/drive_c/MyProg
    wine MyProg.exe
    exit 0

    Set its execute property and create a Launcher linked to it. Double click on the Launcher, et voila!

    Many thanks for your help, meton_magis, your comments sparked off my ideas.

    CNB

  8. #7
    Linux Enthusiast meton_magis's Avatar
    Join Date
    Oct 2006
    Location
    arizona
    Posts
    699
    your welcome, I had to use the same method when I was using wine for world of warcraft (don't worry, I have since stopped playing.)
    New to the internet, technical forums, or the hacker / open source community??
    Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html

    RHCE for RHEL version 5
    RHCT for RHEL version 4

  9. #8
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Quote Originally Posted by Exedukator View Post
    Ok, I have my work-around. Create a shell script called MyProg.sh

    cd ~/.wine/drive_c/MyProg
    wine MyProg.exe
    exit 0

    Set its execute property and create a Launcher linked to it. Double click on the Launcher, et voila!

    Many thanks for your help, meton_magis, your comments sparked off my ideas.

    CNB
    Instead of this I use a function in my ~/.bashrc and ~/.bash_profile files, that way I don't need to have lots of scripts around that do mostly the same but for different windows programs. Something in the lines of

    Code:
    # Function to run on wine
    function winerun () {
      DIR="$PWD"
      cd "$1"
      wine "$2"
      cd "$DIR"
      xgamma -gamma 1.0
    }
    then you can do things like:

    Code:
    winerun ~/whatever/directory whatever.exe
    It also resets the gamma to 1.0, some games forget to do that when exiting. You can use this in desktop links I guess, panel buttons or whatever you prefer. Of course, you could as well define aliases using this as a base:

    Code:
    alias foo="winerun ~/whateverdir whatever.exe"
    And so on...

  10. #9
    Just Joined!
    Join Date
    Jul 2009
    Location
    France
    Posts
    5
    Yes, thankyou for that, i92guboj - much neater.

    I have a GREAT deal to learn!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •