Starting a Linux application for a windows file in wine

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
dreamstogo
Level 2
Level 2
Posts: 10
Joined: Tue May 13, 2008 8:07 am

Starting a Linux application for a windows file in wine

Post by dreamstogo »

Hello,

This is my first post here, so please forgive me if a get some terms wrong!

I want to be able to use Linux applications to open files from within a windows application running under wine. Here's why,

I have installed Ubuntu 8.04 and wine 0.9.61 using Synaptic. I have installed a very old PIM called infocentral that was originally created by Corel and which I have been using for the last 25 years or so. It allows you to create objects and links between objects within a database that is totally flexible.

One of the things you can do is to connect files to people, ie a letter that you have sent to that person. When you double click that fie, Infocentral should open the appropriate application, say word, or excel or other.

Now, this being a Linux box, I don't have Microsoft office installed, so I thought I'll create registry entries to point to the OO equivalent found in the Linux directories, ie /usr/bin/oocalc etc.

I created and entry for .xls in HKEY_CLASSES_ROOT with the Data of Spreadsheet. I then created a key called Spreadsheet, subkey shell, subkey open with the command /usr/bin/oocalc %1.

This works up to a point,

- when I click on a file in Infocentral (running under wine), oocalc now attempts to open and tries to open the file. The problem is that the name of the file is not passed to OO correctly, the %1 parameter should pass the names of the file to OO, it does but it is corrupted. it shows as,

Z:/home/hilary/infocentraldata/myfiles/filename.xls.

OO shows an error message and then stops.

Obviously for Linux the Z:/ at the front is causing some trouble (I think). I also note that if there are spaces in the names of the directories or files this causes a problem, but this I can fix.

- if I leave off the %1 parameter from the registry open command, oocalc opens with no problem but into a blank file.

Any help on this would be greatly appreciated.

Regards

Hilary
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: Starting a Linux application for a windows file in wine

Post by vitamin »

dreamstogo wrote:I created and entry for .xls in HKEY_CLASSES_ROOT with the Data of Spreadsheet. I then created a key called Spreadsheet, subkey shell, subkey open with the command /usr/bin/oocalc %1.

This works up to a point,

- when I click on a file in Infocentral (running under wine), oocalc now attempts to open and tries to open the file. The problem is that the name of the file is not passed to OO correctly, the %1 parameter should pass the names of the file to OO, it does but it is corrupted. it shows as,

Z:/home/hilary/infocentraldata/myfiles/filename.xls.

OO shows an error message and then stops.

Obviously for Linux the Z:/ at the front is causing some trouble (I think). I also note that if there are spaces in the names of the directories or files this causes a problem, but this I can fix.

- if I leave off the %1 parameter from the registry open command, oocalc opens with no problem but into a blank file.

Any help on this would be greatly appreciated.

Regards

Hilary
You need a small shell script that remaps windows path into unix path. Wine has a special program for that - 'winepath'.

Here is an example of how this script might look like run_prog:

Code: Select all

#!/bin/sh
$1 "`wine winepath -u "$2"`"
And how to use it:

Code: Select all

[HKEY_CLASSES_ROOT\xcelfile\Shell\Open\command]
@="/bin/sh run_prog /usr/bin/oocalc "%1""
Dan Kegel

Starting a Linux application for a windows file in wine

Post by Dan Kegel »

On Tue, May 13, 2008 at 6:31 AM, dreamstogo <[email protected]> wrote:
I created and entry for .xls in HKEY_CLASSES_ROOT with the Data of Spreadsheet. I then created a key called Spreadsheet, subkey shell, subkey open with the command /usr/bin/oocalc %1.

This works up to a point,

- when I click on a file in Infocentral (running under wine), oocalc now attempts to open and tries to open the file. The problem is that the name of the file is not passed to OO correctly, the %1 parameter should pass the names of the file to OO, it does but it is corrupted. it shows as,

Z:/home/hilary/infocentraldata/myfiles/filename.xls.

OO shows an error message and then stops.
See http://wiki.winehq.org/FAQ#head-6a4666a ... dbb4aba694

The examples are pretty weak, could somebody improve them?
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: Starting a Linux application for a windows file in wine

Post by vitamin »

Dan Kegel wrote:On Tue, May 13, 2008 at 6:31 AM, dreamstogo <[email protected]> wrote:
I created and entry for .xls in HKEY_CLASSES_ROOT with the Data of Spreadsheet. I then created a key called Spreadsheet, subkey shell, subkey open with the command /usr/bin/oocalc %1.

This works up to a point,

- when I click on a file in Infocentral (running under wine), oocalc now attempts to open and tries to open the file. The problem is that the name of the file is not passed to OO correctly, the %1 parameter should pass the names of the file to OO, it does but it is corrupted. it shows as,

Z:/home/hilary/infocentraldata/myfiles/filename.xls.

OO shows an error message and then stops.
See http://wiki.winehq.org/FAQ#head-6a4666a ... dbb4aba694

The examples are pretty weak, could somebody improve them?
You can use an example from my previous post.
Dan Kegel

Starting a Linux application for a windows file in wine

Post by Dan Kegel »

On Tue, May 13, 2008 at 8:00 AM, vitamin <[email protected]> wrote:
See http://wiki.winehq.org/FAQ#head-6a4666a ... dbb4aba694

The examples are pretty weak, could somebody improve them?
You can use an example from my previous post.
Done (as soon as I saw it). It could probably still use some work.
dreamstogo
Level 2
Level 2
Posts: 10
Joined: Tue May 13, 2008 8:07 am

Post by dreamstogo »

Thank you vitamin and Dan Kegel.

Here's what I had to do to get this working from within Infocentral.

I created the run_prog as per the code from vitamin. I made it executable.

I added a key to [HKEY_CLASSES_ROOT\.xls] with data as "xcelfile"

I added the key [HKEY_CLASSES_ROOT\xcelfile\Shell\Open\command]
/usr/bin/run_prog /usr/bin/oocalc "%1"

Note that the command is slightly different from that posted by vitamin. I don't know why, but it works. Now when I click on an excel file in Infocentral, oocalc opens the spreadsheet correctly.

- I didn't need the /bin/sh
- I did need to fully qualify the run_prog path.
- I didn't need the \"%1\", I just needed "%1"

This has also solved my spaces in path names issue - the "" I suppose.

Now I need to create entries for .doc files etc.

Thank you very much for your excellent help and speed of reply.

Best wishes

Hilary
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

dreamstogo wrote:Thank you vitamin and Dan Kegel.

Here's what I had to do to get this working from within Infocentral.

I created the run_prog as per the code from vitamin. I made it executable.

I added a key to [HKEY_CLASSES_ROOT\.xls] with data as "xcelfile"

I added the key [HKEY_CLASSES_ROOT\xcelfile\Shell\Open\command]
/usr/bin/run_prog /usr/bin/oocalc "%1"

Note that the command is slightly different from that posted by vitamin. I don't know why, but it works. Now when I click on an excel file in Infocentral, oocalc opens the spreadsheet correctly.

- I didn't need the /bin/sh
- I did need to fully qualify the run_prog path.
- I didn't need the "%1", I just needed "%1"

This has also solved my spaces in path names issue - the "" I suppose.

Now I need to create entries for .doc files etc.

Thank you very much for your excellent help and speed of reply.

Best wishes

Hilary
What I posted was a contents of the .reg file. You can't write "blah"foo"" in the regfile - all extra double quotes have to be escaped.
Using /bin/sh will work on _ALL_ *NIXes. You can put "run_prog" anywhere on your $PATH. Hard-coding the location of "run_prog" will work for you only.
dreamstogo
Level 2
Level 2
Posts: 10
Joined: Tue May 13, 2008 8:07 am

Post by dreamstogo »

vitamin, thank you for the explanation
DRNewcomb
Level 2
Level 2
Posts: 18
Joined: Wed Apr 09, 2008 6:04 pm

Post by DRNewcomb »

While I read the FAQ on this, I didn't understand its importance. The subject is something I've been wondering about but didn't understand. If Wine is to be used for more than playing games, the users will have to be able to link between the Windows applications running under Wine and the native Linux applications.
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

DRNewcomb wrote:While I read the FAQ on this, I didn't understand its importance. The subject is something I've been wondering about but didn't understand. If Wine is to be used for more than playing games, the users will have to be able to link between the Windows applications running under Wine and the native Linux applications.
What are you talking about? Are you implying that all windows programs some how magically will understand UNIX paths? And some how all UNIX programs will some how can use file paths inside Wine's space?
Spit whatever you are smocking, take a deep breath and repeat your question.
DRNewcomb
Level 2
Level 2
Posts: 18
Joined: Wed Apr 09, 2008 6:04 pm

Post by DRNewcomb »

I think I'll just take the subject elsewhere.
austin987
Wine Developer
Wine Developer
Posts: 2383
Joined: Fri Feb 22, 2008 8:19 pm

Starting a Linux application for a windows file in wine

Post by austin987 »

On Tue, May 13, 2008 at 5:16 PM, vitamin <[email protected]> wrote:
DRNewcomb wrote:
While I read the FAQ on this, I didn't understand its importance. The subject is something I've been wondering about but didn't understand. If Wine is to be used for more than playing games, the users will have to be able to link between the Windows applications running under Wine and the native Linux applications.
What are you talking about? Are you implying that all windows programs some how magically will understand UNIX paths? And some how all UNIX programs will some how can use file paths inside Wine's space?
Spit whatever you are smocking, take a deep breath and repeat your question.





Jeez vitamin, chill out...
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: Starting a Linux application for a windows file in wine

Post by vitamin »

austin987 wrote:On Tue, May 13, 2008 at 5:16 PM, vitamin <[email protected]> wrote:
DRNewcomb wrote:
While I read the FAQ on this, I didn't understand its importance. The subject is something I've been wondering about but didn't understand. If Wine is to be used for more than playing games, the users will have to be able to link between the Windows applications running under Wine and the native Linux applications.
What are you talking about? Are you implying that all windows programs some how magically will understand UNIX paths? And some how all UNIX programs will some how can use file paths inside Wine's space?
Spit whatever you are smocking, take a deep breath and repeat your question.
Jeez vitamin, chill out...
I'm perfectly cool. I did not understood a single part about what was he talking about. He is welcome to spell the actual questions, problems, suggestions, etc. Making some blatant statements didn't told me anything.
hendrik

Starting a Linux application for a windows file in wine

Post by hendrik »

On Tue, May 13, 2008 at 06:47:27PM -0500, vitamin wrote:
austin987 wrote:
On Tue, May 13, 2008 at 5:16 PM, vitamin <[email protected]> wrote:
DRNewcomb wrote:
What are you talking about? Are you implying that all windows programs some how magically will understand UNIX paths? And some how all UNIX programs will some how can use file paths inside Wine's space?
Spit whatever you are smocking, take a deep breath and repeat your question.
Jeez vitamin, chill out...
I'm perfectly cool. I did not understood a single part about what was
he talking about. He is welcome to spell the actual questions,
problems, suggestions, etc. Making some blatant statements didn't told
me anything.
But you said it in a rude, insulting way, driving him off.

That's not good nettiquette.

-- hendrik
hendrik

Starting a Linux application for a windows file in wine

Post by hendrik »

On Tue, May 13, 2008 at 05:20:08PM -0500, DRNewcomb wrote:
I think I'll just take the subject elsewhere.
I'm sorry you hit such a rude answer. I'm also sorry I don't know the
answer myself, or I'd tell you. Perhaps someone else can explain what I
cannot?

I'd *suspect* that to access the simulated Windows environment, you's
use function in the Wine library, but to access the Linux environment,
you'd use Linux libraries. What you have to do for functions that exist
in both, I don't know.

-- hendrik
David Gerard

Starting a Linux application for a windows file in wine

Post by David Gerard »

2008/5/14 vitamin <[email protected]>:
I'm perfectly cool.
You're incredibly bloody rude and obnoxious - not in your factual
information but in the way you state it - and you appear to be utterly
unaware (a) that you're doing this (b) that it's a problem.


- d.
Dan Kegel

Starting a Linux application for a windows file in wine

Post by Dan Kegel »

On Wed, May 14, 2008 at 2:56 AM, David Gerard <[email protected]> wrote:
2008/5/14 vitamin <[email protected]>:
I'm perfectly cool.
You're incredibly bloody rude and obnoxious - not in your factual
information but in the way you state it - and you appear to be utterly
unaware (a) that you're doing this (b) that it's a problem.
Indeed. Vitamin is very well informed and gives good advice, but he
does it often with a really bad attitude, as if he's being forced
against his will to do tech support for total idiots. I have asked
him many times to tone down his attitude, but it seems he can't.

What do people think? Is Vitamin doing more harm than good?
- Dan
dreamstogo
Level 2
Level 2
Posts: 10
Joined: Tue May 13, 2008 8:07 am

Re: Starting a Linux application for a windows file in wine

Post by dreamstogo »

Dan Kegel wrote:
What do people think? Is Vitamin doing more harm than good?
- Dan
Well, he helped me solve my original problem before the flames started, for which I thanked him. So that was good. Since then I've stayed away...
austin987
Wine Developer
Wine Developer
Posts: 2383
Joined: Fri Feb 22, 2008 8:19 pm

Starting a Linux application for a windows file in wine

Post by austin987 »

On Wed, May 14, 2008 at 5:08 AM, Dan Kegel <[email protected]> wrote:
Indeed. Vitamin is very well informed and gives good advice, but he
does it often with a really bad attitude, as if he's being forced
against his will to do tech support for total idiots. I have asked
him many times to tone down his attitude, but it seems he can't.

What do people think? Is Vitamin doing more harm than good?
- Dan

I get the feeling he's scared more than a few users away from the
forum/mailing list & irc channel. He's very well informed, but as
we're all aware, needs to calm his attitude down, especially on
wine-users.

-Austin
Marcel W. Wysocki

Starting a Linux application for a windows file in wine

Post by Marcel W. Wysocki »

On Wed, 14 May 2008 11:03:10 -0500
"Austin English" <[email protected]> wrote:
On Wed, May 14, 2008 at 5:08 AM, Dan Kegel <[email protected]> wrote:
Indeed. Vitamin is very well informed and gives good advice, but he
does it often with a really bad attitude, as if he's being forced
against his will to do tech support for total idiots. I have asked
him many times to tone down his attitude, but it seems he can't.

What do people think? Is Vitamin doing more harm than good?
- Dan

I get the feeling he's scared more than a few users away from the
forum/mailing list & irc channel. He's very well informed, but as
we're all aware, needs to calm his attitude down, especially on
wine-users.
I can understand when he gets a bit angry from time to time, with all this people asking the same moronic questions over and over again.
I think he is doing a good job. Show me one case where he shows a bad attitude in response to a well-written, precise and sane question.
Perhaps there should be a small quiz when you want to register at the forums or mailinglists, asking very basic wine questions, to ensure everyone did read the FAQ :P


--
Marcel W. Wysocki <[email protected]>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-us ... chment.pgp
David Gerard

Starting a Linux application for a windows file in wine

Post by David Gerard »

to list as well


---------- Forwarded message ----------
From: David Gerard <[email protected]>
Date: 2008/5/14
Subject: Re: [Wine] Starting a Linux application for a windows file in wine
To: "Marcel W. Wysocki" <[email protected]>


2008/5/14 Marcel W. Wysocki <[email protected]>:

I can understand when he gets a bit angry from time to time, with
all this people asking the same moronic questions over and over again.


They're different questions when they come from different people
having the same problem.


I think he is doing a good job. Show me one case where he shows a
bad attitude in response to a well-written, precise and sane question.


Users are not developers. Wine is getting users who don't understand
how to bring up a command prompt. I don't think having someone there
with the specific job of driving them away is likely to help the
project.


- d.
hendrik

Starting a Linux application for a windows file in wine

Post by hendrik »

On Wed, May 14, 2008 at 06:13:20PM +0200, Marcel W. Wysocki wrote:
On Wed, 14 May 2008 11:03:10 -0500
"Austin English" <[email protected]> wrote:
On Wed, May 14, 2008 at 5:08 AM, Dan Kegel <[email protected]> wrote:
Indeed. Vitamin is very well informed and gives good advice, but he
does it often with a really bad attitude, as if he's being forced
against his will to do tech support for total idiots. I have asked
him many times to tone down his attitude, but it seems he can't.

What do people think? Is Vitamin doing more harm than good?
- Dan

I get the feeling he's scared more than a few users away from the
forum/mailing list & irc channel. He's very well informed, but as
we're all aware, needs to calm his attitude down, especially on
wine-users.
I can understand when he gets a bit angry from time to time, with all this people asking the same moronic questions over and over again.
I think he is doing a good job. Show me one case where he shows a bad
attitude in response to a well-written, precise and sane question.
In this very thread.

DRNewcomb wrote:
: While I read the FAQ on this, I didn't understand its importance. The
: subject is something I've been wondering about but didn't understand.
: If Wine is to be used for more than playing games, the users will have
: to be able to link between the Windows applications running under Wine
: and the native Linux applications.

This does not seem to be an unreasonable question. DRNewcomb even
indicates that he has read the FAQ, and goes on to express a reasonable
concern. There may be technical and policy reasone for doing or not
doing what he wants, but his request is a sane one, especially because
Wine Is a library, Not an Emulator.

But vitamin replied:

: What are you talking about? Are you implying that all windows programs
: some how magically will understand UNIX paths? And some how all UNIX
: programs will some how can use file paths inside Wine's space?
: Spit whatever you are smocking, take a deep breath and repeat your
: question.

The entire reply shows an unnecessarily aggressive attitude, and where
he ways, "Spit whatever you are smocking", he really crosses the line
into overt offensiveness. Whatever his intention, he has succeeded in
convincing DRNewcomb that he is not welcome here.

An answer to the question might have explained how the Wine and Linux
file-name spaces are, or can be made to be, related to one another.
Perhaps there should be a small quiz when you want to register at the
forums or mailinglists, asking very basic wine questions, to ensure
everyone did read the FAQ :P
DRNewcomb evidently did read the FAQ, and found it unsufficent.

-- hendrik
User avatar
DanKegel
Moderator
Moderator
Posts: 1164
Joined: Wed May 14, 2008 11:44 am

Starting a Linux application for a windows file in wine

Post by DanKegel »

On Wed, May 14, 2008 at 9:13 AM, Marcel W. Wysocki <[email protected]> wrote:
I can understand when he gets a bit angry from time to time,
with all this people asking the same moronic questions over and over again.
Absolutely. Anybody would. The only problem is that he
then takes it out on the poor newbie user.
Show me one case where he shows a bad attitude in
response to a well-written, precise and sane question.
That's not the problem! The problem is when confronted with
a new Wine user who knows nothing and has not read the FAQ,
he reacts in a way that makes many users feel bad, and
scares some away. There's no point in kicking a puppy.
Much better to calmly update the FAQ to be even more obvious,
and post a link to it, to see if the user can in fact help themselves
via the FAQ.
Perhaps there should be a small quiz when you want to
register at the forums or mailinglists, asking very basic
wine questions, to ensure everyone did read the FAQ :P
We've all wished for that! It's not practical, but we could at
least add text on the 'new post' form like this:
Are you having trouble getting started with Wine?
Please check the FAQ before asking for help!
and make it link to the FAQ. Heck, we don't even have a
sticky saying "Please check the FAQ first"!
- Dan
dreamstogo
Level 2
Level 2
Posts: 10
Joined: Tue May 13, 2008 8:07 am

Post by dreamstogo »

My last post on this subject,

I own up to be being a complete newbie concerning wine, but not on Linux or windows. I did do a search for my problem before posting but I didn't find what I was looking for. Hence my original post. Which was answered very well by vitamin.

The problem with any type of search or FAQ is that you need to know what you are looking for first. You need to type the "correct" search terms in order to find what you are looking for. If you're lucky you get a hit. If you're not, you're stuck.

So tolerance and good manners are the key.
User avatar
DanKegel
Moderator
Moderator
Posts: 1164
Joined: Wed May 14, 2008 11:44 am

Starting a Linux application for a windows file in wine

Post by DanKegel »

On Wed, May 14, 2008 at 9:49 AM, <[email protected]> wrote:
Perhaps there should be a small quiz when you want to register at the
forums or mailinglists, asking very basic wine questions, to ensure
everyone did read the FAQ :P
DRNewcomb evidently did read the FAQ, and found it unsufficent.
And I scurried behind the conversation and improved the FAQ,
so hopefully the next user with this question will find
it in the FAQ.
Locked