| Author |
Message |
davids45

Joined: 26 Nov 2006 Posts: 581 Location: Chatswood, NSW
|
Posted: Sat 16 May 2009, 01:53 Post subject:
"Set run action" for Wine .exe programs Subject description: Differentiating the gear wheel iconified data files for different programs |
|
G'day,
I'm running wine 1.1.19 quite happily in Puppy 4.2 SMP (full install).
In Rox, the data files for most Windows programs appear as gear-wheel icons. There is no differentiation based on the extension.
To explain my problem, I right-click on a particular gear-wheel file with the extension .ocd which happens to contain data for a map that was created by a specialised CAD program (Ocad).
Searching fhe forum , I learnt I needed to "Set run action" to
wine /root/.wine/drive_c/"Program Files"/Ocad8/ocad.exe & "$1"
or
wine /root/.wine/drive_c/"Program Files"/Ocad8/ocad.exe & "$@"
so that if I then clicked on a .ocd file gear-icon, Ocad would start up. It wont actually open the particular data file, just gives me a blank work-space. This is my lesser problem at the moment.
My major problem is that all the gear-wheel files are now default-set to Rox-open with Ocad regardless of their extension. So, for example, genealogy data files with a .paf extension (for a program known as Personal Ancestral File paf.exe) if clicked, open up Ocad, not PAF.
How in Rox can I differentiate the various data files for different wine-runnable programs?
David S.
|
|
Back to top
|
|
 |
Béèm

Joined: 21 Nov 2006 Posts: 11782 Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win
|
Posted: Sat 16 May 2009, 04:25 Post subject:
|
|
In the set run action panel you did tick the wrong box on the top.
You can choose to set for all applications or for only this type of file.
Redo the set run action for the .ocd files and change to only for this type tick box.
_________________ Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
Consult Wikka
Use peppyy's puppysearch
|
|
Back to top
|
|
 |
davids45

Joined: 26 Nov 2006 Posts: 581 Location: Chatswood, NSW
|
Posted: Sat 16 May 2009, 07:36 Post subject:
|
|
G'day Béèm,
Thanks for the suggestion, but I have tried both options in the top of the ROX dialog box.
Both options set by the default program path I enter as the "Set run action" will then open any the 'gear-wheel' iconified files if I click on regardless of its extension.
The simple 'wine "$@" ' as the 'action' will not activate a data file, only the main program.
Where does ROX decide what file is of what type? Can it use the final three letters of the file "name" (ie as per Windows) for this purpose?
David S.
|
|
Back to top
|
|
 |
Béèm

Joined: 21 Nov 2006 Posts: 11782 Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win
|
Posted: Sat 16 May 2009, 08:02 Post subject:
|
|
Yes rox uses the file name extension also. f.e. .odt is an openoffice text document. I did set the run action to swriter and when I click on a .odt file it opens in swriter.
Now I never tried it for a wine application.
I would create in /usr/share/applications a .desktop file for your wine ocad program.
As an example see the .desktop for my pegasus mail client which runs in wine. | Code: | [Desktop Entry]
Encoding=UTF-8
Name=Pegasus Mail
Icon=mini-mail.xpm
Comment=Pegasus Mail
Exec=wine "c:\program files\pmail\programs\winpm-32.exe"
Terminal=false
Type=Application
Categories=X-Internet
GenericName=Pegasus Mail
| Change the values to match your ocad program and don't forget to use the back-slash not the forward-slash..
When done verify that clicking the desktop created runs the ocad program.
Now go to a .ocd file again and select set run action.
Be sure to tick for this application only.
Drag and drop the for ocad created .desktop to the set run action panel to the region 'drop a suitable program here'
Logically when clicking on a .ocd file now ocad should open and use the .ocd file.
_________________ Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
Consult Wikka
Use peppyy's puppysearch
|
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 3845
|
Posted: Sat 16 May 2009, 12:44 Post subject:
|
|
ROX has them in /root/Choices/MIME-types
you should make a bash script and put it there
| Code: |
#!/bin/sh
exec wine /root/.wine/drive_c/"Program Files"/Ocad8/ocad.exe & "$@" |
name the file application_ocd and change its permissions to make it executable (via right click menu)
_________________ Puppy Web Desktop Now with pet packages - Pet Packaging 100 & 101
|
|
Back to top
|
|
 |
Béèm

Joined: 21 Nov 2006 Posts: 11782 Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win
|
Posted: Sat 16 May 2009, 13:47 Post subject:
|
|
I never understood the MIME-type thing.
In this case, by what magic, when clicking on a .ocd file is the application_ocd called? How does ROX know?
_________________ Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
Consult Wikka
Use peppyy's puppysearch
|
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 3845
|
Posted: Sun 17 May 2009, 01:41 Post subject:
|
|
It looks in the specified path for MIME's that match the file type
Do you know why it looks for them?
...
.....because you can't listen for a MIME
ok that was bad... must be time to get some sleep
_________________ Puppy Web Desktop Now with pet packages - Pet Packaging 100 & 101
|
|
Back to top
|
|
 |
Bruce B

Joined: 18 May 2005 Posts: 10823 Location: The Peoples Republic of California
|
Posted: Sun 17 May 2009, 02:27 Post subject:
|
|
| Béèm wrote: | I never understood the MIME-type thing.
In this case, by what magic, when clicking on a .ocd file is the application_ocd called? How does ROX know? |
It is not a .ocd file and the name is not arbitrary. It is a shell script. I think what technosaurus wants to achieve here is the ability to give any desktop name and particularly any icon to the script.
And if I'm wrong, technosaurus can correct the error after he wakes up.
_________________ New! Puppy Linux Links Page
|
|
Back to top
|
|
 |
davids45

Joined: 26 Nov 2006 Posts: 581 Location: Chatswood, NSW
|
Posted: Sun 17 May 2009, 03:36 Post subject:
|
|
G'day,
Technosaurus, thanks so far, and I think a good sleep will help your problem.
When you're awake again, I have tried the MIME-types approach by copying an existing application_xxx file in the Choices/MIME-types as application_ocd and another as application_paf then editing these to find (or exec) the relevant wine executable file along the .wine path.
Clicking on the edited application_ocd icon in Choices/MIME-types opens Ocad and clicking on the application_paf opens PAF5, so I'm assuming these work (I've got the path right).
But the gear-wheel iconed data files with an .ocd and .paf extension do not respond when clicked in ROX. I tried re-booting as well as re-starting X and refreshing menus.
The "Set run action.." options from the right-click dialog box seem to be stored as similar 'application' files in /.config/rox.sourceforge.net/MIME-types, one called "application", the other "application_octet-stream". So it seems like there are only two options in the "Set run action.." menu, unless I can define my data files as something other than one of these two options?
Where in ROX is the decision to use or specify or default to the gear-wheel icon made for these various 'unknown' data file types? Normal data files such as .rtf, .txt., .doc each have a different icon and can be opened by a chosen application so presumably there is a config type file somewhere that includes what to do and what icon to use for them? I may be could then modify these to suit my data file types.
For 'fun', I'd like to create modified icons for my different data files, once I can sort out how to get them to open with their desired wine application, if that's possible.
Thanks for your time,
David S.
|
|
Back to top
|
|
 |
Béèm

Joined: 21 Nov 2006 Posts: 11782 Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win
|
Posted: Sun 17 May 2009, 03:46 Post subject:
|
|
Davids45,
What happens if you try my method?
_________________ Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
Consult Wikka
Use peppyy's puppysearch
|
|
Back to top
|
|
 |
Béèm

Joined: 21 Nov 2006 Posts: 11782 Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win
|
Posted: Sun 17 May 2009, 04:35 Post subject:
|
|
As far as I understand:
Mime stands for Multimedia Internet Mail Extension
It are indications inside an attachment/data file to indicate the type of the file.
So a text/plain inside such a file indicates the file is a plain text file.
It isn't absolutely necessary that the data file also has the extension.txt. It can be blank.
Clicking on such a file in a file manager, like rox, the file manager should analyze and detect detect the mime-type and through a mechanism give control to a script to open the corresponding program, I suppose the scripts in .../Choices/MIME-types.
In the example of text/plain the script says: defaulteditor
So I am not sure of it and hope someone can confirm or explain better for the MIME-type.
Another method is working only on the extension.
So in the case of the OP when clicking on a .ocd extension and when set run action is specified to open ocad, the ocad program should start and the .ocd file opened.
This is the way I did choose for my .odt, .ods etc.. extensions which starts the corresponding OOo program with the data file openend and I can work on the data right away.
As far as I understand, the method with MIME-type to open the ocad program with the data loaded, did fail
_________________ Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
Consult Wikka
Use peppyy's puppysearch
|
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 3845
|
Posted: Sun 17 May 2009, 10:59 Post subject:
|
|
that is what I have done for other things... not sure why its not working
(it may be helpful to put your working bash script in /usr/local/bin/defaultosdviewer)
then edit /root/Choices/MIME-types/application_osd to use defaultosdviewer
the alternative is to edit /usr/local/bin/defaulthandler ... just follow the pattern
Just for curiosity can you post your bash script (including what you named it)... it could always be just a typo or something - those are the biggest pains because I never seem to notice my own typos
_________________ Puppy Web Desktop Now with pet packages - Pet Packaging 100 & 101
|
|
Back to top
|
|
 |
davids45

Joined: 26 Nov 2006 Posts: 581 Location: Chatswood, NSW
|
Posted: Mon 18 May 2009, 06:08 Post subject:
|
|
G'day,
I have now created a Menu entry as per Béèm's suggestion, using the following text for my Ocad8.desktop file.
Encoding=UTF-8
Name=Ocad8
Icon=/mnt/sdb5/Puppy_Archive/Icons/WineIcons/adb7_ocad.0.xpm
Comment=Ocad map program
Exec=wine /root/.wine/drive_c/"Program Files"/Ocad8/ocad.exe & "$1"
Terminal=false
Type=Application
Categories=Graphics
GenericName=Ocad8 map drawing program
This gave me the menu entry with mini-icon under Graphic (Puppy 4.2) which opens the Ocad program if clicked.
I went to a directory containing data files with the .ocd extension and after right-clicking on one of the gear-wheel icons, and selecting "Set run action..", dragged the ocad8.desktop to the upper part of the dialog box. This box then showed this gear-wheel .ocd file was to be opened by the ocad8.desktop link. Clicking on the gear-wheel .ocd file now opened the Ocad program but not the data file itself.
But switching to a genealogy program (PAF5) directory with its .paf data files which also appear as gear-wheels, I see these are also associated with the Ocad link. Clicking on a .paf file opens Ocad.
So it still looks like I can't get ROX to differentiate these gear-wheel icon data files.
The script in my application_paf file in root/Choices/MIME-types is:
#! /bin/sh
exec wine /root/.wine/drive_c/"Program Files"/FamilySearch/Paf5/paf5.exe & "$1"
but this doesn't lead to .paf files being opened by PAF5.
Geany colours the "Program Files" part of the path orange, like the "$1" at the end - does this mean anything? And what's the difference between using $1 and $@? Clicking on the application_paf icon opens PAF5 (the program, not the data file) so it works despite the odd colours.
I'll next try technosaurus's suggestion and have a go at setting up a default_ocdviewer file in /usr/local/bin and see what happens.
Thanks again for your continued ideas.
David S.
|
|
Back to top
|
|
 |
mcewanw
Joined: 16 Aug 2007 Posts: 1522 Location: New Zealand
|
Posted: Wed 11 Nov 2009, 22:46 Post subject:
set run action for wine windows programs data |
|
I think this is what you want:
wine /root/.wine/drive_c/"Program Files"/Ocad8/ocad.exe "${1//\//\\}"
Similarly,
wine /mnt/home/ProgramFiles/IrfanView/i_view32.exe "${1//\//\\}"
[EDIT: Here is how "${1//\//\\}" works:
${string//substring/replacement}
meaning - Replace all matches of $substring with $replacement
Note that \/ is escaped / so that the shell doesn't treat the / as a special character. Similarly \\ is escaped \ so that the shell doesn't treat the \ as a special character.]
works for me with graphics files and IrfanView using wine.
[In the above case I had i_view32.exe in a directory called ProgramFiles/IrfanView on /mnt/home as shown]
In practice, on my system, using Puppy 4.3.1, in order to use wine and IrfanView for image files I altered /usr/local/bin/defaultimageviewer from:
| Code: |
#!/bin/sh
exec viewnior "$@"
|
to:
| Code: |
#!/bin/sh
exec wine /mnt/home/ProgramFiles/IrfanView/i_view32.exe "${1//\//\\}"
|
That way I didn't need to change any image file type run actions (just left them as: defaultimageviewer "$1" for all image file types).
Hopefully, the above scheme will also work with MIME type handling (though haven't tried yet) since the shell script
/root/Choices/MIME-types/image_[jpeg, png and so on...]
contains:
| Code: |
#! /bin/sh
exec defaultimageviewer "$1"
|
Similarly, I use the windows program PDF-Xchange Viewer to read (and annotate pdf files) so I created a defaultpdfreader shell script in /usr/local/bin in a similar way to defaultimageviewer and I altered /root/Choices/MIME-types/application_pdf to:
| Code: |
#! /bin/sh
# exec epdfview "$1" (this is what used to be there...)
exec defaultpdfreader "$1"
|
Note that an alternative to some of the above is probably to use winepath as described here:
http://www.murga-linux.com/puppy/viewtopic.php?p=246860&search_id=845434576#246860
_________________ Non enim propter gloriam, diuicias aut honores pugnamus set propter libertatem solummodo quam Nemo bonus nisi simul cum vita amittit.
Last edited by mcewanw on Sun 15 Nov 2009, 02:10; edited 1 time in total
|
|
Back to top
|
|
 |
Béèm

Joined: 21 Nov 2006 Posts: 11782 Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win
|
Posted: Thu 12 Nov 2009, 12:52 Post subject:
|
|
Hello,
What version of irfanview did you install?
I tried the latest, 425 and got an error while executing.
_________________ Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
Consult Wikka
Use peppyy's puppysearch
|
|
Back to top
|
|
 |
|