Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 24 Oct 2014, 21:53
All times are UTC - 4
 Forum index » House Training » Beginners Help ( Start Here)
"Set run action" for Wine .exe programs
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 3 Posts_count   Goto page: 1, 2, 3 Next
Author Message
davids45


Joined: 26 Nov 2006
Posts: 652
Location: Chatswood, NSW

PostPosted: Sat 16 May 2009, 01:53    Post_subject:  "Set run action" for Wine .exe programs
Sub_title: 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 Smile , 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
View user's profile Send_private_message 
Béèm


Joined: 21 Nov 2006
Posts: 11782
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

PostPosted: 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
View user's profile Send_private_message 
davids45


Joined: 26 Nov 2006
Posts: 652
Location: Chatswood, NSW

PostPosted: 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
View user's profile Send_private_message 
Béèm


Joined: 21 Nov 2006
Posts: 11782
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

PostPosted: 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
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4353

PostPosted: 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)

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
Béèm


Joined: 21 Nov 2006
Posts: 11782
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

PostPosted: 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
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4353

PostPosted: 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

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
Bruce B


Joined: 18 May 2005
Posts: 11130
Location: The Peoples Republic of California

PostPosted: 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
View user's profile Send_private_message 
davids45


Joined: 26 Nov 2006
Posts: 652
Location: Chatswood, NSW

PostPosted: 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
View user's profile Send_private_message 
Béèm


Joined: 21 Nov 2006
Posts: 11782
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

PostPosted: 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
View user's profile Send_private_message 
Béèm


Joined: 21 Nov 2006
Posts: 11782
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

PostPosted: 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
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4353

PostPosted: 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

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
davids45


Joined: 26 Nov 2006
Posts: 652
Location: Chatswood, NSW

PostPosted: 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
View user's profile Send_private_message 
mcewanw

Joined: 16 Aug 2007
Posts: 2346
Location: New Zealand

PostPosted: 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.

Edited_time_total
Back to top
View user's profile Send_private_message Visit_website 
Béèm


Joined: 21 Nov 2006
Posts: 11782
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

PostPosted: 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
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 3 Posts_count   Goto page: 1, 2, 3 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » Beginners Help ( Start Here)
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1028s ][ Queries: 12 (0.0122s) ][ GZIP on ]