WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [SOLVED] wine: How to pass filenames to win apps?  (Read 5448 times)

Offline jur

  • Hero Member
  • *****
  • Posts: 863
    • cycling photo essays
[SOLVED] wine: How to pass filenames to win apps?
« on: October 13, 2010, 02:06:18 AM »
I'd like to be able to open up a wine app when clicking on the file; eg to open Foxit reader. The command would be wine /path/to/spice/foxit.exe. But that just open the app itself; how would I pass the pdf filename? Anything I tried just results in foxit coming up with a dialog box, lecturing me on "usage".

The reason I need to use the win version and not the linux one, is the win one runs much faster even over wine (important with big files); and the win one has annotation tools which the linux one does not.

There are other win apps where I have the same problem, of passing filename to the win app.

Help please?
« Last Edit: October 15, 2010, 09:42:09 PM by jur »

Online curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: wine: How to pass filenames to win apps?
« Reply #1 on: October 13, 2010, 02:42:22 AM »
man wine says you'd just use them normally. Though I think it would need full Win paths, escaped as appropriate.

e.g. wine 'C:\windows\notepad.exe' 'Z:\tmp\my.pdf'
The only barriers that can stop you are the ones you create yourself.

Offline jur

  • Hero Member
  • *****
  • Posts: 863
    • cycling photo essays
Re: wine: How to pass filenames to win apps?
« Reply #2 on: October 13, 2010, 08:42:19 AM »
Well that worked... but I realized I would have to reconstruct a win path from the linux one... that seems way beyond what is easy and reasonable, so that project is shelved.

aus9

  • Guest
Re: wine: How to pass filenames to win apps?
« Reply #3 on: October 13, 2010, 06:41:03 PM »
hi

not sure what you have, but if you have a graphical file manager (with the right associations) you can have a bookmark to navigate directly inside your /home/tc/.wine/pathway to files

then

right hand clicking (for a right hander)

on the target file .....you choose the windows wine app (foxit reader) to open the file....instead of epdfview (or other linux pdf readers as eg)

This should work for any wine app that you have installed.

this mostly works in the lxde file manager.....pcmanfm or (2) but not extensively tested.

good luck
« Last Edit: October 13, 2010, 06:43:15 PM by aus9 »

Offline jur

  • Hero Member
  • *****
  • Posts: 863
    • cycling photo essays
Re: wine: How to pass filenames to win apps?
« Reply #4 on: October 13, 2010, 10:36:08 PM »
I has a bit of a go in rox... got nowhere... any pointers with rox?

aus9

  • Guest
Re: wine: How to pass filenames to win apps?
« Reply #5 on: October 14, 2010, 08:43:27 AM »
hi

I have only just tried out rox so until you get a better reply try this

1) I am using wine-gl version and as per info, installed gecko installer and tweaked the winecfg run as local user=tc

2) start rox

icon 7 from left...click to show extra details....reveals file details instead of icons (my preference)

icon 9 click to show hidden files

3) navigate in .wine to pathway where pdf file exists

eg .wine/drive-c/users/tc/My Music

click on third icon...its the lemon? to bookmark this folder

I am right handed

RH click on your target file ....file.pdf

select "set run action"

clear the list if its wrong for your current pdf action "association"

otherwise, leave this window open and now navigate in rox to your executable

eg if you have linux foxit..../usr/local/bin/foxit etc

or if its the windows editon ....maybe  .wine/.....Program files /foxit etc

Which ever app it is....Left hand click and hold the icon and drag it into the grey box to associate it

4) now left hand clicking the pdf should open foxit at your file page

good luck

PS I suggest you also click on the help icon ? and associate the manual.html with your fav web browser executable....for me its /usr/local/firefox-official/run-mozilla.sh

Help section 16 refers



« Last Edit: October 14, 2010, 08:51:59 AM by aus9 »

Offline jur

  • Hero Member
  • *****
  • Posts: 863
    • cycling photo essays
Re: wine: How to pass filenames to win apps?
« Reply #6 on: October 14, 2010, 09:48:53 AM »
Hey aus9 thanks for the effort... really appreciated... :) unfortunately it is not what my problem is. The process you outlined above there I have already been using for the past year or so.

My current problem is that using this procedure with a Windows app running on wine, the filename does not get passed correctly to the Windows app, perhaps because of Windows using backslash vs linux using forward slash in the paths. So the Windows app starts all right but without the file loaded. Foxit for Windows won't even start, instead just displaying a dialog box and then closing again.

Sometimes Windows apps are all that's available for particular applications.

Online curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: wine: How to pass filenames to win apps?
« Reply #7 on: October 14, 2010, 11:00:16 AM »
Windows apps actually do translate the slashes, but they consider \ to be C:\.
The only barriers that can stop you are the ones you create yourself.

aus9

  • Guest
Re: wine: How to pass filenames to win apps?
« Reply #8 on: October 14, 2010, 06:39:39 PM »
hi

OOPS

I fogot to specify you can't use /home/tc/filename.pdf

It HAS to be home/tc/.wine/pathway/folder/filename.pdf

Do you actually mean it does not work for foxit (windows version) or are you being nice and not naming the actual executable for fear it might attract some flames? If so, pm the name of the app and if its freeware shareware I can test on the weekend
« Last Edit: October 14, 2010, 06:47:18 PM by aus9 »

Offline jur

  • Hero Member
  • *****
  • Posts: 863
    • cycling photo essays
Re: wine: How to pass filenames to win apps?
« Reply #9 on: October 15, 2010, 04:27:11 AM »
No I mean foxit for Windows which somehow performs much better than the linux version. I also use LTspice which the author has developed specifically to run with wine. Another app would be irfanview.

aus9

  • Guest
Re: wine: How to pass filenames to win apps?
« Reply #10 on: October 15, 2010, 06:57:25 AM »
jur

I have attempted to re-read some info so forgive me for asking more questions.

1) foxit for windows does not start......does any other wine dependent window app start ?

I am wondering if its not foxit for windows issue but a ....linux wine issue?

2) I know we have talked about rox  ...graphical file manager but have you attempted to run ....wine foxit (whatever) in a terminal to see what errors occur

3) there is a wine forum for this issue....feel free to cross post there...but what version do you have?

4) what wine version are you using?

If I am to test I need to be on the exact TC type pls.

b) what windowmanager are you on

aus9

  • Guest
Re: wine: How to pass filenames to win apps?
« Reply #11 on: October 15, 2010, 07:17:40 AM »
hi

I have just successfully run ms version of foxit but I downloaded the zip file not the exe...heh heh

after unzipping it...I just stuck in wine's Program folder....it seems to have few dependencies?

then a button appears to open a file.....and I already had a test file there and waiting.

works for me without all my other stuf but I just installed basic wine....but had already downloaded gecko installer.

maybe a snapshot?


Offline jur

  • Hero Member
  • *****
  • Posts: 863
    • cycling photo essays
Re: wine: How to pass filenames to win apps?
« Reply #12 on: October 15, 2010, 06:29:10 PM »
Ah, there is a bit of info I didn't give - I use portsableapps where possible for everything since I *hate* installing stuff. So I use FoxitPortable (see portableapps.com). This app you can just copy to wherever you want it and all the deps are there with it.

I can get foxit (and other apps too) to immediately open a file with the manual method outlined by curaga earlier in the thread, I am looking for a way to do it by just clicking on the file in rox. Easy enough for linux apps, so far not achieved for win apps.

Offline jur

  • Hero Member
  • *****
  • Posts: 863
    • cycling photo essays
Re: wine: How to pass filenames to win apps?
« Reply #13 on: October 15, 2010, 06:43:14 PM »
So just to recap to try and eliminate any misunderstandings...

* I use rox filer. I set the "Set run action..." to run foxit for windows, which I call with a simple script file:
loadapp wine
wine '/mnt/sda2/PortableApps/FoxitReaderPortable/FoxitReaderPortable.exe' '$1'

* I can get a linux app to open a file eg foxit for linux can open a pdf. I do this by clicking the file in rox.
* I can get a win app such as foxitPortable to open by clicking on a pdf file. Foxit opens with the default screen, but without the file.

So what I am aiming at is for foxit to actually open the pdf file that I clicked on.

Thanks for all the help you are giving me! :)

aus9

  • Guest
Re: wine: How to pass filenames to win apps?
« Reply #14 on: October 15, 2010, 07:15:08 PM »
hi

EDIT

success

as per

http://appdb.winehq.org/objectManager.php?sClass=version&iId=14654

create script as /home/tc/myapp.sh

cat myapp.sh is

Quote
#!/bin/sh


# Purpose: To convert Linux-style filename to Windows-style to pass as an argument
# to wine when starting Foxit Reader
Filename="z:"${1//\//\\}
App='eval /usr/local/bin/wine "/home/tc/.wine/drive_c/Program Files/Foxit Reader.exe" "'$Filename'"'
$App

2) associate in rox for any pdf....drag myapp etc

3) clicking on pdf opens as correct

4) I shall repeat....the zip file gives you the independent foxit ....the winehq site says so as well

stick it anywhere you like

mod it to your pathway

I am happy
« Last Edit: October 15, 2010, 07:32:52 PM by aus9 »