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 Thu 19 Jul 2018, 09:54
All times are UTC - 4
 Forum index » House Training » Beginners Help ( Start Here)
How to make Windows app (installed using Wine) the default?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [21 Posts]   Goto page: 1, 2 Next
Author Message
rupak504

Joined: 20 Aug 2014
Posts: 10

PostPosted: Wed 20 Aug 2014, 03:29    Post subject:  How to make Windows app (installed using Wine) the default?  

Namaste

I am using lupu-528.005 , i installed a windows app eg. say foxitreader.exe using wine.It installed ok, but it didnt show up in menu secondly what do i do if i want to make this wine installed foxit my default reader in puppy.

Thank you Shocked
Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 11131

PostPosted: Wed 20 Aug 2014, 04:45    Post subject:  

ok someone may have a simpler answer.

You have no menu entry since its a program under wine and puppy does not handle desktop files created by wine in /root/.local

I do it by making a miniscript like
Code:

#! /bin/sh

a=${1/\//Z:\\}
a=${a//\//\\}

wine /usr/local/kool/SAflashplayer7.exe "$a"


which I then use rox to set as default action from the right click menu... the code is needed to convert the linux address to a windows one that the program will understand...you could follow this pattern to do this for foxit but make sure the path for it is correct...something like /root/.wine/c_drive/program files etc etc...and if spaces are present enclose in "quotes".

If this sounds a bit unfamiliar then just ask for help

mike
Back to top
View user's profile Send private message 
Sylvander

Joined: 15 Dec 2008
Posts: 4352
Location: West Lothian, Scotland, UK

PostPosted: Wed 20 Aug 2014, 05:26    Post subject:  

1. Here in Slacko-5.7.0 I used the PPM to install the Puppy-Linux version = FoxitReader-1.1.0; never had any trouble using it.

Why would you want to use the Windows version, when the Linux version is available?

2. When I want to run Windows programs in WINE...
I have a HUGE number of portable Windows programs on my e: partition [sda3].
See below, the top folders holding these.
I run any of those by entering the command winefile in a terminal...
Choosing to use the z: drive...
Navigating to the exe file for the program, and double-click it to run it.

3. Here's a link to a download page for Foxit Reader Portable.
00.jpg
 Description   
 Filesize   47.5 KB
 Viewed   575 Time(s)

00.jpg

Back to top
View user's profile Send private message 
mikeb


Joined: 23 Nov 2006
Posts: 11131

PostPosted: Wed 20 Aug 2014, 05:35    Post subject:  

the linux version of foxit is severely lacking functions compared to the windows release and development stopped years ago with no plans to continue.
poppler based readers have some rendering joke funnies at times.... a recent one was hysterical...text was totally out of place and back to front for example when printing...even the linux foxit got it right. I assume some linux users print cos sometimes it seems otherwise. Very Happy

Regardless of portable or not to make it click and open with windows foxit a script like above is usually needed.

mike
Back to top
View user's profile Send private message 
nic007


Joined: 13 Nov 2011
Posts: 2473
Location: Cradle of Humankind

PostPosted: Wed 20 Aug 2014, 09:47    Post subject:  

I use SumatraPDF, better than Foxit imho. Anyways, back to the opening poster's questions. Easiest way to start a windows application is to make a shortcut of the applicable .exe file to desktop (drag and drop). By right-clicking on the shortcut you can change the name, icon, etc. To make a certain windows program the default handler for a specific file type you can go to/usr/local/bin. In this folder you will find a few default handling scripts already. Say for instance you want to make a windows program called "spreadsheet" your default spreadsheet handler, right-click on the defaultspreadsheet script and choose open as text. Then edit the execution path eg: exec wine "followed by location of exe file". Alternative: Right-click on a file with the extension you want to open with a windows program and select "set run-action to". In the bottom space fill in the path of the executable eg: wine "followed by path of executable". In my experience this defaut handling does not always work perfectly for windows applications. For instance, I have a word processor called Atlantis, when I click a specific file associated with it, Atlantis will run but the specific file will not open I have to open it from within Atlantis. To get a windows application into puppy's menu is a bit of a task. The desktop files are kept in /usr/share/applications so you will have to create another desktop file here. Easiest way is to edit an existing desktop file which basically has the same use as the windows program you want to use. So right-click, edit with your windows program's details, save as another desktop file. After this you will have to run fixmenus from terminal and then restart JWM to see the menu entry. I know this is a lot of information but ask if you need more help.
Back to top
View user's profile Send private message 
version2013

Joined: 08 Sep 2013
Posts: 362
Location: Florida, USA

PostPosted: Wed 20 Aug 2014, 10:45    Post subject:  

nic007 wrote:
...Say for instance you want to make a windows program called "spreadsheet" your default spreadsheet handler, right-click on the defaultspreadsheet script and choose open as text. Then edit the execution path eg: exec wine "followed by location of exe file". Alternative: Right-click on a file with the extension you want to open with a windows program and select "set run-action to". In the bottom space fill in the path of the executable eg: wine "followed by path of executable". In my experience this defaut handling does not always work perfectly for windows applications. For instance, I have a word processor called Atlantis, when I click a specific file associated with it, Atlantis will run but the specific file will not open I have to open it from within Atlantis. ...

eg: exec wine "followed by location of exe file" "$@"
eg. wine "followed by path of executable" "$@"

Does adding "$@" or "$1" (with quotes) fix that issue?
I have noticed that extra bit when I open different scripts in /root/Choices/MIME-types/
Back to top
View user's profile Send private message Visit poster's website 
rupak504

Joined: 20 Aug 2014
Posts: 10

PostPosted: Wed 20 Aug 2014, 10:57    Post subject:  

wow , Thank you mikeb, nic007,Sylvander.You guys r great and this forum is very much alive. Smile Shocked Smile
Back to top
View user's profile Send private message 
nic007


Joined: 13 Nov 2011
Posts: 2473
Location: Cradle of Humankind

PostPosted: Wed 20 Aug 2014, 11:18    Post subject:  

version2013 wrote:
nic007 wrote:
...Say for instance you want to make a windows program called "spreadsheet" your default spreadsheet handler, right-click on the defaultspreadsheet script and choose open as text. Then edit the execution path eg: exec wine "followed by location of exe file". Alternative: Right-click on a file with the extension you want to open with a windows program and select "set run-action to". In the bottom space fill in the path of the executable eg: wine "followed by path of executable". In my experience this defaut handling does not always work perfectly for windows applications. For instance, I have a word processor called Atlantis, when I click a specific file associated with it, Atlantis will run but the specific file will not open I have to open it from within Atlantis. ...

eg: exec wine "followed by location of exe file" "$@"
eg. wine "followed by path of executable" "$@"

Does adding "$@" or "$1" (with quotes) fix that issue?
I have noticed that extra bit when I open different scripts in /root/Choices/MIME-types/

Yes that must obviously follow but it does not fix the specific problem. It seems to have something to do with the specific windows program you use. Some work "right" others don't
Back to top
View user's profile Send private message 
RSH


Joined: 05 Sep 2011
Posts: 2420
Location: Germany

PostPosted: Wed 20 Aug 2014, 18:45    Post subject:  

Hi.

Here is how I do run .exe Files and how I do send e.g. .mp3 Files to Audacity Portable.

Usually my Portable Apps .exe Files are present in a Menu Pipe. When clicking such Menu Entry it searches and loads automatically a pre-defined Wine SFS and immediately after that executing the Portable Apps .exe File.

To do this I do have two Scripts in /root/Choices/MIME-types.

First Script is called: application_x-ms-dos-executable, and has the following content:
Code:
#! /bin/sh
exec /root/Choices/MIME-types/application_x-my-wine-apps-starter "$@"


The 2nd Script is called: application_x-my-wine-apps-starter (like the above code shows) and has the following content:
Code:
#! /bin/sh
#------------------------------------------------------------------------------
# Load Wine SFS and execute Windows .exe Application
#------------------------------------------------------------------------------

# Set Name of your Wine SFS here
WineSFS="LP2_WineCorelSuite.sfs"

FileLoopMnt() { mount |grep loop* |sed 's# .*$##' | while read N
   do losetup-FULL $N |grep $WineSFS |sed 's#^.* .##;s#.$##' ;done ; }
fm=$(FileLoopMnt)

bfm=`basename $fm`
if [ "$bfm" = "" ]; then
   sfs_load --cli --skip-fixmenus --quiet "$WineSFS"
   exec wine "$@"
   else
   exec wine "$@"
fi

Just enter the Name of your Wine SFS in this Line: WineSFS="LP2_WineCorelSuite.sfs"

To send automatically .mp3 Files to Audacity Portable in Wine, I change the default action for .mp3 Files (right-clicking a .mp3, default action or run action ???, I'm in DE, so don't know the right term) and entering the following line as the new command:
Code:
exec wine /mnt/sdc1/PortableApplications/PortableApps/AudacityPortable/AudacityPortable.exe "$1"

Probably this will be better for sending multiple Files:
Code:
exec wine /mnt/sdc1/PortableApplications/PortableApps/AudacityPortable/AudacityPortable.exe "$@"


Note the difference: "$1" <--> "$@" and note the drive: /mnt/sdc1 (needs to be changed to your needs)

This should do what you need, though the Wine SFS needs to be loaded first.

_________________
LazY Puppy
RSH's DNA
SARA B.
Back to top
View user's profile Send private message 
version2013

Joined: 08 Sep 2013
Posts: 362
Location: Florida, USA

PostPosted: Wed 20 Aug 2014, 21:17    Post subject:  

I have not used portable apps before.

How are wine prefixes handled?
Does each portable app have a separate wine prefix?

Last edited by version2013 on Wed 20 Aug 2014, 22:20; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
RSH


Joined: 05 Sep 2011
Posts: 2420
Location: Germany

PostPosted: Wed 20 Aug 2014, 21:51    Post subject:  

Hi, version2013.

Usually the Portable Applications are packaged in a directory that contains everything what's needed, to run a installable Application as PortableApp.

Those Applications that needs to set some data into the registry come with the needed files, which are handled/executed from the Portable App. This Portable App does initialize all needed settings and then executes the binary.

Example on MP3GainPortable:

The Portable App
- /mnt/sdc1/PortableApplications/PortableApps/MP3GainPortable/MP3GainPortable.exe

The real Application binary (.exe)
- /mnt/sdc1/PortableApplications/PortableApps/MP3GainPortable/App/MP3Gain/mp3gain.exe

The Registry File
- /mnt/sdc1/PortableApplications/PortableApps/MP3GainPortable/Data/settings/MP3Gain.reg

The Application Settings
- /mnt/sdc1/PortableApplications/PortableApps/MP3GainPortable/Data/settings/MP3GainPortableSettings.ini

Some .exe Applications that come with an installer do work as PortableApp also. Just copy the Applications Directory from Wine Program Folder to your PortableApps Directory.

I have done this successfully e.g. for FractalFr0st (Fractal Image Creator), WavOSaur (Audio Editor), Photoline32 7.20 (Graphics with Layers Technic), Kid3 (Audio Tagger) and some more.

On the other Hand there is a Portable Application Builder available, though I've never tested it.
image-2.jpg
 Description   PortableApp Directory
 Filesize   11.46 KB
 Viewed   317 Time(s)

image-2.jpg

image-3.jpg
 Description   Applications Directory
 Filesize   10 KB
 Viewed   319 Time(s)

image-3.jpg

image-1.jpg
 Description   Registry and Settings
 Filesize   15.57 KB
 Viewed   321 Time(s)

image-1.jpg


_________________
LazY Puppy
RSH's DNA
SARA B.
Back to top
View user's profile Send private message 
Geoffrey


Joined: 30 May 2010
Posts: 2348
Location: Queensland

PostPosted: Thu 21 Aug 2014, 00:48    Post subject:  

I use this command to run windows apps, as an example:
Code:
exec wine start /Unix "/root/.wine/drive_c/Program Files/Foxit Software/Foxit Reader/Foxit Reader.exe $@"


the quotes are needed if there are spaces in the path or file names

_________________
Carolina: Recent Repository Additions

Back to top
View user's profile Send private message 
RSH


Joined: 05 Sep 2011
Posts: 2420
Location: Germany

PostPosted: Thu 21 Aug 2014, 01:40    Post subject:  

Code:
In my experience this defaut handling does not always work perfectly for windows applications. For instance, I have a word processor called Atlantis, when I click a specific file associated with it, Atlantis will run but the specific file will not open I have to open it from within Atlantis.

This different behavior of applications for Wine is not dependent specifically on the application, but on the type of the application.

Example:

Audacity is a Cross-Platform-Audio-Editor. So it's code knows how to handle path's like /mnt/sda1. Even the Windows version. Since true Windows applications did never seen any GNU/Linux File System, they can't handle path's starting with /mnt.

Since the beginning of my Forum activities and LazY Puppy development I do own a 300 MB Wine SFS which has Corel Photopaint 8 installed. Since these days I tried to get this to work, to send .cpt files directly to the Wine SFS, executing Photopaint and loading the file. Everything works, except loading the file.

So due to this discussion I did again some work on this -have planned this already long time ago- and do you know what?

I did solve this! I'm able now to send a .cpt file directly into Corel Photopaint 8 to start editing immediately. Even though it doesn't know path's starting with /mnt!

So, here is what I've done:

Created a Script called, corelphotopaint-executor, including the following code:
Code:
#!/bin/bash -a
#------------------------------------------------------------------------------
# Executing Corel Photopaint 8 in Wine and submit a File
# 2014-08-21 RSH for LazY Puppy
#------------------------------------------------------------------------------

SUBMIT="$1"
exec wine "C:\\Corel\\Graphics8\\Programs\photopnt.exe" "C:\\`basename "$SUBMIT"`" >/dev/null

# End

Placed this Script into /usr/local/bin.

From my 2nd Script above, I've replaced this
Code:
   exec wine "$@"
   else
   exec wine "$@"


with this
Code:
   cp -af "$1" "/root/.wine/drive_c/"
   /usr/local/bin/corelphotopaint-executor "$1" >/dev/null
   #rox "/root/.wine/drive_c"
   cp -af -u "/root/.wine/drive_c/`basename "$1"`" "$1"
   rm -f "/root/.wine/drive_c/`basename "$1"`"
   #######################
   else # [ "$bfm" = "" ];
   #######################
   cp -af "$1" "/root/.wine/drive_c/"
   /usr/local/bin/corelphotopaint-executor "$1" >/dev/null
   #rox "/root/.wine/drive_c"
   cp -af -u "/root/.wine/drive_c/`basename "$1"`" "$1"
   rm -f "/root/.wine/drive_c/`basename "$1"`"

I have called this Script, defaultcorelphotoeditor, and put it into /usr/local/bin. Then I've set the default run action of .cpt files to command: /usr/local/bin/defaultcorelphotoeditor "$@"

The whole mystery is to copy the file to /root/.wine/drive_c and to send it to the Wine application from its new location. After exiting the Wine application copying the file back to original (with mode update only, -u) and remove the file at its new location.

That's just all.

Currently this needs to be done for each Wine application separately where such performance would be needed to send a file directly to a Wine application.

I'm a Hacker

(Richard Stallman, RSH)

_________________
LazY Puppy
RSH's DNA
SARA B.
Back to top
View user's profile Send private message 
nic007


Joined: 13 Nov 2011
Posts: 2473
Location: Cradle of Humankind

PostPosted: Thu 21 Aug 2014, 02:26    Post subject:  

RSH wrote:
Code:
In my experience this defaut handling does not always work perfectly for windows applications. For instance, I have a word processor called Atlantis, when I click a specific file associated with it, Atlantis will run but the specific file will not open I have to open it from within Atlantis.

This different behavior of applications for Wine is not dependent specifically on the application, but on the type of the application.

Example:

Audacity is a Cross-Platform-Audio-Editor. So it's code knows how to handle path's like /mnt/sda1. Even the Windows version. Since true Windows applications did never seen any GNU/Linux File System, they can't handle path's starting with /mnt.

Since the beginning of my Forum activities and LazY Puppy development I do own a 300 MB Wine SFS which has Corel Photopaint 8 installed. Since these days I tried to get this to work, to send .cpt files directly to the Wine SFS, executing Photopaint and loading the file. Everything works, except loading the file.

So due to this discussion I did again some work on this -have planned this already long time ago- and do you know what?

I did solve this! I'm able now to send a .cpt file directly into Corel Photopaint 8 to start editing immediately. Even though it doesn't know path's starting with /mnt!

So, here is what I've done:

Created a Script called, corelphotopaint-executor, including the following code:
Code:
#!/bin/bash -a
#------------------------------------------------------------------------------
# Executing Corel Photopaint 8 in Wine and submit a File
# 2014-08-21 RSH for LazY Puppy
#------------------------------------------------------------------------------

SUBMIT="$1"
exec wine "C:\\Corel\\Graphics8\\Programs\photopnt.exe" "C:\\`basename "$SUBMIT"`" >/dev/null

# End

Placed this Script into /usr/local/bin.

From my 2nd Script above, I've replaced this
Code:
   exec wine "$@"
   else
   exec wine "$@"


with this
Code:
   cp -af "$1" "/root/.wine/drive_c/"
   /usr/local/bin/corelphotopaint-executor "$1" >/dev/null
   #rox "/root/.wine/drive_c"
   cp -af -u "/root/.wine/drive_c/`basename "$1"`" "$1"
   rm -f "/root/.wine/drive_c/`basename "$1"`"
   #######################
   else # [ "$bfm" = "" ];
   #######################
   cp -af "$1" "/root/.wine/drive_c/"
   /usr/local/bin/corelphotopaint-executor "$1" >/dev/null
   #rox "/root/.wine/drive_c"
   cp -af -u "/root/.wine/drive_c/`basename "$1"`" "$1"
   rm -f "/root/.wine/drive_c/`basename "$1"`"

I have called this Script, defaultcorelphotoeditor, and put it into /usr/local/bin. Then I've set the default run action of .cpt files to command: /usr/local/bin/defaultcorelphotoeditor "$@"

The whole mystery is to copy the file to /root/.wine/drive_c and to send it to the Wine application from its new location. After exiting the Wine application copying the file back to original (with mode update only, -u) and remove the file at its new location.

That's just all.

Currently this needs to be done for each Wine application separately where such performance would be needed to send a file directly to a Wine application.

I'm a Hacker

(Richard Stallman, RSH)

I only have one program that has this issue. It's a word processor called Atlantis. I run all my windows programs directly from my second partition (sda5) where I have Windows installed. So the exe file for this will be in /mnt/sda5/Program Files/Atlantis/Atlantis.exe. I'm not quite sure I follow your method above but wouldn't it be possible to just add something extra in " set run action to" for the specific file extention?
Back to top
View user's profile Send private message 
RSH


Joined: 05 Sep 2011
Posts: 2420
Location: Germany

PostPosted: Thu 21 Aug 2014, 03:09    Post subject:  

Quote:
I only have one program that has this issue. It's a word processor called Atlantis. I run all my windows programs directly from my second partition (sda5) where I have Windows installed. So the exe file for this will be in /mnt/sda5/Program Files/Atlantis/Atlantis.exe. I'm not quite sure I follow your method above but wouldn't it be possible to just add something extra in " set run action to" for the specific file extention?

I have worked on this again and again since I've joined the Forum, but until today I didn't found any other solution. Only copying the File to /root/.wine/drive_c did work. Just doing a symbolic e.g. will load the file, but saving from Wine program overwrites the symbolic link instead saving to the linked file.

I'm quite sure, from where the Wine program is started doesn't really matter. What matters is a file that contains C:\ or similar in its path. Exceptions are Cross-Platform Applications since the know /mnt.

Just give it a try. If it works -I'm sure, it will- then it's definitely worth the effort.

_________________
LazY Puppy
RSH's DNA
SARA B.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [21 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Beginners Help ( Start Here)
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2427s ][ Queries: 13 (0.0264s) ][ GZIP on ]