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 Sun 21 Sep 2014, 18:30
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 2 of 3 Posts_count   Goto page: Previous 1, 2, 3 Next
Author Message
mcewanw

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

PostPosted: Thu 12 Nov 2009, 20:21    Post_subject:  

I'm using IrfanView version 4.00

I didn't install it over wine, I just copied the IrfanView folder over from an underlying MS windows install and use wine with Puppy Linux 4.3.1 to run it.

[In fact I can also mount the partition that holds that MS windows installation and run IrfanView 4.00 directly from its Program Files folder there (using wine on Puppy Linux)].

_________________
Non enim propter gloriam, diuicias aut honores pugnamus set propter libertatem solummodo quam Nemo bonus nisi simul cum vita amittit.
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, 20:53    Post_subject:  

Thanks for the update
_________________
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 
CatDude


Joined: 03 Jan 2007
Posts: 1473
Location: UK

PostPosted: Fri 13 Nov 2009, 11:29    Post_subject:  

Hi

It seems that technosaurus has the right idea.

technosaurus wrote:
...
(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

I use a windows programme called DeltaCad (via wine),
and it creates files with a .dc extension.

So using technosaurus's advice i did the following:

    1.
    Created: /usr/local/bin/defaultdeltacad (set as Executable)
    Code:
    #!/bin/sh
    exec wine "/root/Wine/drive_c/Program Files/DeltaCad/DELTACAD.EXE" "$@"

    NOTE: The above path to DETACAD.EXE had to have the surrounging double quotes, or it would not work.

    2.
    Edited: /usr/local/bin/defaulthandler
    adding the following:
    Code:
     dc|DC)
      /usr/local/bin/defaultdeltacad "$1"


    3.
    Opened a ROX-Filer window at a directory containing some .dc files.

    I then right clicked on a .dc file, and selected: Set Run Action
    see image set-run-action.jpg
    After clicking on the: Use Command button
    the following file was automatically created: /root/.config/rox.sourceforge.net/MIME-types/application_x-dc-rom
    the contents of which is:
    Code:
    #! /bin/sh
    exec defaultdeltacad "$@"


    4.
    Opened a ROX-Filer window at a directory containing some .dc files,
    and another ROX-Filer window at the directory containing my desired icon.

    I then right clicked on a .dc file, and selected: Set Icon
    and then dragged my desired icon to where it said "Drop an icon file here"
    see image set-icon.jpg

    After "Dropping" said icon,
    the following file was automatically created: /root/.config/rox.sourceforge.net/MIME-icons/application_x-dc-rom.png

I can now click on any .dc file, and have it open in DeltaCad,
also all .dc files now display my chosen icon.
see image deltacad-files-displaying-chosen-icon.jpg

Hope this may help
CatDude
.
set-run-action.jpg
 Description   
 Filesize   25.97 KB
 Viewed   1413 Time(s)

set-run-action.jpg

set-icon.jpg
 Description   
 Filesize   18.43 KB
 Viewed   1434 Time(s)

set-icon.jpg

deltacad-files-displaying-chosen-icon.jpg
 Description   
 Filesize   19.35 KB
 Viewed   1546 Time(s)

deltacad-files-displaying-chosen-icon.jpg


_________________

Back to top
View user's profile Send_private_message 
davids45


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

PostPosted: Fri 13 Nov 2009, 23:16    Post_subject: Rox problem?  

G'day CateDude,
Thank you for your detailed post - this is just about what I was after.

I've created some executables as per your Step 1, changing your "Wine" to my ".wine" in the path, and naming these executables as "run_ocdfiles", "run_docfiles", "run_rmgfiles", etc., in place of your "default..." naming style.
These work from my /usr/local/bin when mouse-clicked.

Things don't go to plan however when I try to "Set Run Action" in Rox. I'm doing this in aragon's kernel 2.6.29 Pup 42 in case that's part of my problem. I have other Pups to try to set this up in this in as well. And if it's a Rox issue, how do I check the Rox version I've got, by the way?

For my Ocad program with its .ocd data files, the two button options for the 'Set Run Option' I get from Rox are:

'application/<anything>'
'application/octet-stream'

but not the 'application/x-dc-rom (application-x-dc-rom)' or similar, as per your posted image.

I did not get the automatically generated file as per your Step 3 after trying to 'Set Run Action'. Perhaps I had done something in trying to sort this out earlier, hence the 'octet-stream' default which needs to be deleted or dis-associated?

Is there a manual way to create the desired application-association for my .ocd files? I imagine it should be something like application-x-ocd? I see many similar files in /root/Choices/MIME-types like what I expect is needed?

Thanks again for your advice,

David S.
Back to top
View user's profile Send_private_message 
CatDude


Joined: 03 Jan 2007
Posts: 1473
Location: UK

PostPosted: Sat 14 Nov 2009, 08:09    Post_subject:  

Hello davids45

I downloaded the trial version of OCAD 10,
but i am not able to get it to open a .ocd file.
The programme itself starts, but will not open a file using the methods we have been trying (see image cannot-open.png)

I have tried various methods, as described in my previous post, and using your file naming as well,
i also tried with both:
    /root/Choices/MIME-types/application_ocd
    /root/Choices/MIME-types/application_x-ocd

on seperate occasions obviously.
NOTHING seems to work

davids45 wrote:

And if it's a Rox issue, how do I check the Rox version I've got, by the way?

Open a console/terminal, and enter the following:
Code:
rox --version

But i do not think that it's a Rox issue myself,
as what worked for my DeltaCad will not work for OCAD

As to the automatically created files at steps 3 & 4 in my previous post,
they are still created, albeit with different names:
    /root/.config/rox.sourceforge.net/MIME-types/application_octet-stream
    /root/.config/rox.sourceforge.net/MIME-icons/application_octet-stream.png

and all .ocd files display my chosen icon,
and clicking on any of them will open OCAD but NOT the actual file.
    EDIT:
    Not only the .ocd files are showing my icon,
    i just noticed that vmlinuz is also showing it, and has the run action as set for the .ocd files. NOT GOOD


I honestly do not know what is going on here,
is it perhaps something peculiar to OCAD files ?

Yours completley baffled
CatDude
.
cannot-open.png
 Description   
 Filesize   6.71 KB
 Viewed   1494 Time(s)

cannot-open.png


_________________


Edited_time_total
Back to top
View user's profile Send_private_message 
davids45


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

PostPosted: Sat 14 Nov 2009, 08:50    Post_subject:  

G'day CatDude,

Thank you again for your trouble with this problem.

I have an earlier version of Ocad (Ocad8) so maybe Ocad10 is particularly difficult being the latest Windows ware.

I wondered if the "octet-stream" default is something to do with the .ocd extension being already allocated in some way, or are the "Permissions" important and the default for the .ocd format is wrong so needs to be re-set before the file will open with Wine-Ocad?

I think I'll try to use your 4-step method with a different Wine-Windows program and see if that works, meaning there is a particular issue with the Ocad program and its data files used this way. Ocad (in wine) has been very good when starting up the program then opening a file from the <File> menu.

I'll let you know what happens.

David S.
.
Back to top
View user's profile Send_private_message 
CatDude


Joined: 03 Jan 2007
Posts: 1473
Location: UK

PostPosted: Sat 14 Nov 2009, 09:29    Post_subject:  

Hello davids45

Please see my EDIT:
in my previous post.

CatDude
.

_________________

Back to top
View user's profile Send_private_message 
davids45


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

PostPosted: Sat 14 Nov 2009, 20:57    Post_subject:  

G'day CateDude,

Yes, I see from your Edit, you now have the problem I have, that I cannot just select with 'Set Run Action' to open any .odc file with Ocad, but all gear-wheel iconified files (presumably these are all octet-stream applications) are given the Ocad default.

G'day mcewanw,
Apologies for missing your recent post on my problem - extrapolating from your information, I have created new image_ocd and image-x_ocd executables in /root/Choices/MIME-types which if clicked in Rox will open the Ocad program. But clicking on a data .ocd file in Rox does nothing so far (I have not re-booted - are these likely to be start-up only changes?).

I have not used your string of slashes after the "$" as the "@" seems to work in opening the program for me. Could you expand on the meaning of these slashes?

Reading your conversation with Béèm, I think you are re-assigning an existing set of file types (standard image files) - changing a default viewer.

I think what I want to do is to introduce to Rox (or Puppy) a completely new file type (identified by its .ocd extension), and then open these files using the:

"exec wine "/root/.wine/drive_c/Program Files/OCad8/ocad.exe" "$@"

script in something like its own MIME-type application definition file, not the Rox-default 'application/octet-stream' which causes errors in lots of other files marked by gear-wheel icons by ROX.

I had a quick try to set the run action for an .ocd file with MuppyFiler and Worker (two other file manager programs on this Pup) but I was not successful in getting these to open by clicking on any .ocd file either (ie same as ROX). Worker reported the .ocd files as 'unidentified types' - so how can I 'identify' these files as the type I need to?

David S.
Back to top
View user's profile Send_private_message 
mcewanw

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

PostPosted: Sun 15 Nov 2009, 01:47    Post_subject: "$1" won't do... You need ${1//\//\\}  

davids45 wrote:

I have not used your string of slashes after the "$" as the "@" seems to work in opening the program for me. Could you expand on the meaning of these slashes?


Pity you didn't try the string of slashes; without them only the program itself opens (without the data file). The slashes are there because wine needs MS windows type paths I believe (so the sed-like regular expression string of slashes swaps / for \; I think! but haven't done any bash stuff for ages so can't be sure without looking it up...). Unfortunately, I wrote the required slash sequence down in my notebook a long time ago, having come across their use in another post somewhere back then, but I can't remember the post where I first came across it and haven't found it in a quick search (might have been another forum?).

You may well be after something else, or at least extra, but as far as getting the program data to open and not just the program when you click on the data icon I definitely find that the slashes I gave are absolutely required. [ i.e. "$1" only is not enough - that just results in the program alone opening... You need: "${1//\//\\}"]

EDIT: Ah... 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.

From: http://tldp.org/LDP/abs/html/refcards.html#AEN21678

_________________
Non enim propter gloriam, diuicias aut honores pugnamus set propter libertatem solummodo quam Nemo bonus nisi simul cum vita amittit.
Back to top
View user's profile Send_private_message Visit_website 
davids45


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

PostPosted: Tue 17 Nov 2009, 00:01    Post_subject:  

G'day again,

I have now tried the slash combination in mcewanw's above post, by copying from the post and pasting the ${1//\//\\} over the $@ and $1 in my various MIME-type application files.

Unfortunately, then clicking on a data .ocd file, all I can get is the opening of the Ocad program with the last opened file re-opening.
The clicked-on .ocd file does not open automatically. I've tried this using ROX, MuppyFiler, Worker and X-File Explorer to navigate to a .ocd file, with the same result.

Have I missed something important?

Frustratingly, I can get the result I want (the clicked-on .ocd data file opens with the program) if I use Wine File (Windows file-manager under Wine). But I have got quite used to using ROX, so am still hoping for some magic from somewhere.

David S.
Back to top
View user's profile Send_private_message 
mcewanw

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

PostPosted: Thu 19 Nov 2009, 07:12    Post_subject: MIME globs file and maybe use "${@//\//\\}"  

davids45 wrote:
I have now tried the slash combination in mcewanw's above post, by copying from the post and pasting the ${1//\//\\} over the $@ and $1 in my various MIME-type application files.

Unfortunately, then clicking on a data .ocd file, all I can get is the opening of the Ocad program with the last opened file re-opening.
The clicked-on .ocd file does not open automatically. I've tried this using ROX, MuppyFiler, Worker and X-File Explorer to navigate to a .ocd file, with the same result.

Have I missed something important?


@davids45:

Okay, to recap (using a different example):

In my /usr/local/bin there are various defaulthandlers (e.g. defaultspreadsheet)

For my defaultspreadsheet script I now have:

Code:

#!/bin/sh
exec wine /mnt/home/ProgramFiles/AshampooOffice2008/PlanMaker.exe "${@//\//\\}"


Planmaker is the spreadsheet from softmaker office, which I run using wine. It uses the extension .pmd

I similarly have a defaultpresentations script (for powerpoint-like softmaker office files.

Code:

#!/bin/sh
exec wine /mnt/home/ProgramFiles/AshampooOffice2008/Presentations.exe "${@//\//\\}"


Presentations uses the extension .prd

By default, Puppy recognises both .pmd and .prd files as the MIME type:
application/x-ole-storage

The problem with that is that if I assign a Run type to either .pmd then the .prd files will be automatically forced to run by exactly the same application (which is not what I want).

What I need is for the .pmd to be recognised as a different MIME type to the .prd

I have no idea about how to do that really, but what I experimentally did was add the following two lines to the end of the text file /usr/share/mime/globs

[Disclaimer: Any modifications you make are at your own risk!]

Code:

application/x-pmd:*.pmd
application/x-prd:*.prd


Make sure the globs file ends with a single carriage return!

Then I created the following two executable shell scripts in /root/Choices/MIME-types:

The first script I called application_x-pmd
which contained:

Code:

#!/bin/sh
exec defaultspreadsheet "$1"


The second script I called application_x-prd
which contained:

application_x-prd

Code:

#!/bin/sh
exec defaultpresentations "$1"


That worked for me. Now any file with the extension .pmd is recognised as having MIME type application/x-pmd and any file with extension .prd is recognised as having MIME type application/x-prd.
[Right clicking on the file icon and selecting Properties shows you the mime type the file is being recognised as].

The appropriate application is thus opened on clicking either type of file icon.

I believe you need to do something similar for your .paf and .ocd file types.

Note that I didn't need to set a default Run Action after doing the above; fixing the mime type information was enough. i.e DO NOT right click on the file icon in order to forcibly enter a shell command for the file type; instead leave everything up to the mime type.

Note also that you may need to close the ROX window and reopen it before clicking on the app icon after doing all the above; I can't remember. I certainly did not need to reboot though.

Disclaimer: I really know nothing about MIME editing. I just noticed that BarryK had edited the globs file for his own purposes (even though the file header suggested it should not be manually edited) - I thus tried likewise...

My idea of modifying the globs file arose from my reading this extract from

http://roscidus.com/desktop/taxonomy/term/16

Quote:

File types and icons
Category:

* MIME types
* Theming

How does the filer decide what icon to show for a file, and which program to use to open it?

For each file, the filer starts by working out its MIME-Type, as follows:

* If the file's user.mime_type extended attribute it set, then that is its MIME type.
* If the file's name matches a pattern in one of the globs file (usually, /usr/share/mime/globs) then the line in that file gives the type.
* If the contents of the file match a pattern in one of the magic files (usually, /usr/share/mime/magic) then that gives the type.

_________________
Non enim propter gloriam, diuicias aut honores pugnamus set propter libertatem solummodo quam Nemo bonus nisi simul cum vita amittit.
Back to top
View user's profile Send_private_message Visit_website 
davids45


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

PostPosted: Fri 20 Nov 2009, 19:08    Post_subject:  

G'day mcewanw,
Thanks for finding out how this is done. Globs seems the file to edit to define a data file by its extension, despite the BK warning.

And thanks for the link to the Rox site. Excellent!

Creating the specific application_x now means I can use an icon for all files of the particular application without other file types also getting iconified incorrectly. The upper button option of the "Set Icon" right-click menu shows the new application type. Magic!

I've also modified some existing globs entries so .doc and .xls files open in my wine MS Office, as well as adding some other new Windows specific program types.

I've found your method works quickly and well with a couple of Pups (so far - I've plenty more to modify as I pick to boot up with them).

But I'm now thinking of how I can modify my personal wine+programs pet and sfs files? I find it very simple to create a single Pet of the latest wine, including all my fonts links, and my particular Windows programs and just install that into each Pup. I also convert this Pet into sfs files for the Frugals' home directories.

How can the extra lines for these 'unusual' applications can be added to each new Pup's default globs file - adding the extra application_x files into /root/Choices/MIME-types directory is OK, but with globs, it is modifying not replacing an existing file. Or is just replacing a new Pup's globs file with my modified globs going to be OK as the data in the globs file is not changing from Pup to Pup? I suppose I should just try it for starters?

Is it worth suggesting a "How to add a new MIME-type (file extension type) in Puppy" for the "How To" section of the forum? Probably should mention the "Set run action" situation as well because that's what I first thought I had to do, but couldn't.

Thanks again for your sleuthing,

David S.
Back to top
View user's profile Send_private_message 
mcewanw

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

PostPosted: Fri 20 Nov 2009, 20:36    Post_subject: adding new mime types  

davids45 wrote:

Is it worth suggesting a "How to add a new MIME-type (file extension type) in Puppy" for the "How To" section of the forum? Probably should mention the "Set run action" situation as well because that's what I first thought I had to do, but couldn't.


Done. http://www.murga-linux.com/puppy/viewtopic.php?p=363990#363990

_________________
Non enim propter gloriam, diuicias aut honores pugnamus set propter libertatem solummodo quam Nemo bonus nisi simul cum vita amittit.
Back to top
View user's profile Send_private_message Visit_website 
mcewanw

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

PostPosted: Sat 21 Nov 2009, 02:49    Post_subject: modifying globs entries  

davids45 wrote:

I've also modified some existing globs entries so .doc and .xls files open in my wine MS Office, as well as adding some other new Windows specific program types.


Of course you could also leave the, for example, .xls glob entry as it is and instead modify the ~/Choices/MIME-types/application_vnd.ms-excel shell script to execute a different application (than the defaultspreadsheet).

I expect the use of a common globs file may work. Alternatively, you could use a simple shell script to append a fixed set of new entries to the end of any glob file, using, for example:

Code:

cat file_containing_new_glob_entries >> /usr/share/mime/globs


Always good to make a backup of the original globs file first of course! ;-)

Not so easy to modify existing entries automatically of course (nor to check what is already in a particular globs file), and you probably want to avoid modifying existing globs entries as much as possible anyway (and instead modify the scripts in ~/Choices/MIME-types to point to/exec different applications).

_________________
Non enim propter gloriam, diuicias aut honores pugnamus set propter libertatem solummodo quam Nemo bonus nisi simul cum vita amittit.
Back to top
View user's profile Send_private_message Visit_website 
davids45


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

PostPosted: Sat 21 Nov 2009, 18:43    Post_subject:  

G'day mcewanw,

Thank you for the rapid 'How To". I trust it will help others who want to run esoteric software with unusual extensions and still be able to click open a file.

As you mention my doctoring of existing globs entries for the standard .doc and .xls files, I'm now having a problem with these (Office 97 versions) and do need to try something different from simply editing the .doc and .xls line. Maybe that's what the warning DO NOT EDIT is all about? I should RTFW - read the first warning?? Word & Excel are complaining about not being able to find the data file I click on from Rox.

I find MuppyFiler works as well as Rox with the newly defined MIME-types but xfe (X-Filer) and Worker do not. Presumably other Puppy file managers have different means of determining file associations?

Anyway, despite the predicted heat here (41C in November), I'll first try your above suggestion as I have plenty of Pup CDs to recover a globs file from if I need to. And then see how I can improve my wine Pet and sfs to incorporate the new MIME-types.

Thanks,

David S.
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 2 of 3 Posts_count   Goto page: Previous 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.1438s ][ Queries: 13 (0.0193s) ][ GZIP on ]