Running a .exe file which uses a parameter file used to work

Questions about Wine on Linux
Locked
soundgeek
Level 2
Level 2
Posts: 20
Joined: Sun Mar 08, 2015 9:39 am

Running a .exe file which uses a parameter file used to work

Post by soundgeek »

I run 32 bit Wine 1.7.55 on Ubuntu 14.04 on a 64 bit PC.

I used to launch CARDFILE.EXE with the parameter file CONTACTS.CRD via a .desktop file. It stopped working for no apparent reason. This is the .desktop file file:

Code: Select all

[Desktop Entry]
Name=Contacts File
Comment=Opens contacts.crd in Cardfile.exe
Exec=wine start "C:\\Program Files\\Cardfile\\CARDFILE.EXE CONTACTS.CRD"
Terminal=False
Type=Application
Icon=/usr/share/icons/contacts.png
CONTACTS.CRD is in the same directory as CARDFILE.EXE.

Currently the .desktop launches nothing.

If I remove the reference to CONTACTS.CRD, it will then launch CARDFILE.EXE and I can use Open to select the C:\Program Files\Cardfile\CONTACTS.CRD.

Why should it not be able to automatically open the parameter file on launching any more?
Perhaps an update to WINE has introduced a bug?
How can I fix it so that CARDFILE opens the parameter file automatically again?
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Running a .exe file which uses a parameter file used to

Post by Bob Wya »

The .desktop entry you posted has a broken working path - hence why it doesn't work. In fact I would be highly surprised if it ever worked properly under Wine...

Try...

Code: Select all

[Desktop Entry]
Name=Contacts File
Comment=Opens contacts.crd in Cardfile.exe
Exec=env WINEPREFIX="${HOME}/.wine" wine "C:\\Program Files\\Cardfile\\CARDFILE.EXE" "CONTACTS.CRD"
Terminal=False
Type=Application
Path="${HOME}/.wine/drive_c/Program Files/Cardfile"
Icon=/usr/share/icons/contacts.png
You have to set your Unix working path so that your Windows application gets launched as though you did (manually):

Code: Select all

cd "${HOME}/.wine/drive_c/Program Files/Cardfile"
wine CARDFILE.EXE CONTACTS.CRD
I've added in an env variable for WINEPREFIX to illustrate how you would create a .desktop file for a WINEPREFIX other than the default path (${HOME}/.wine)

Bob
soundgeek
Level 2
Level 2
Posts: 20
Joined: Sun Mar 08, 2015 9:39 am

Re: Running a .exe file which uses a parameter file used to

Post by soundgeek »

Thanks for responding on this Bob:)

Surprisingly, this did used to work. It worked for a long time & then one day, it worked no more. I consulted the FAQ file when I wrote the desktop file & I recall following advice that would allow the parameter file to be found. I think this was the bit I followed in FAQ 6.4:
You need to use wine start if you specify a full path, because that allows Wine to set the working directory for the program if it needs it. You can also use double quotes, but you need two backslashes instead of one:

wine start "C:\\Games\\Tron\\tron.exe"
I tried your desktop file & it failed to find the directory, so something did not work; I don't understand why.

I tried your manual launching in your second piece of code and it worked fine. I'm puzzled!
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Running a .exe file which uses a parameter file used to

Post by Bob Wya »

soundgeek wrote:Thanks for responding on this Bob:)

I tried your desktop file & it failed to find the directory, so something did not work; I don't understand why.

I tried your manual launching in your second piece of code and it worked fine. I'm puzzled!
Hi ya,

You just have to work methodically through all the things that could go wrong :shock: 8)

Test - leaving the path off the executable... That could be confusing things (because of the CONTACTS.CRD parameter). So try:

Code: Select all

[Desktop Entry]
Name=Contacts File
Comment=Opens contacts.crd in Cardfile.exe
Exec=env WINEPREFIX="${HOME}/.wine" wine "CARDFILE.EXE" "CONTACTS.CRD"
Terminal=False
Type=Application
Path="${HOME}/.wine/drive_c/Program Files/Cardfile"
Icon=/usr/share/icons/contacts.png
The Path variable should set the Wine working path to C:\Program Files\Cardfile\ anyway...

What is the exact error message you are getting? A Screenshot or something like that would be useful...

Where are you trying to run the .desktop file from? If it's not in a subdirectory of:

Code: Select all

"${HOME}/.local/share/applications/"
or

Code: Select all

/usr/share/applications/
It will need to be executable by your user...

Code: Select all

chmod +x *.desktop
What is the result from (run as your normal user):

Code: Select all

which wine
env | grep WINE
whoami
'ls' -ahl "${HOME}/.wine/drive_c/Program Files"
locale
You can post all that output "in-line" (with

Code: Select all

 bracketing obviously) - it should be quite short...

Probably just something minor - as you can run the program manually from a terminal  8) 

Bob
soundgeek
Level 2
Level 2
Posts: 20
Joined: Sun Mar 08, 2015 9:39 am

Re: Running a .exe file which uses a parameter file used to

Post by soundgeek »

As I said, when I executed from a terminal, the application launched & executed the parameter file. I just tried it again & the application launched as before, but I noticed an error in the terminal box which I didn't notice before.

cd "${HOME}/.wine/drive_c/Program Files/Cardfile"
wine CARDFILE.EXE CONTACTS.CRD

resulted in this error message:

Code: Select all

gray@Eastbed-Linux:~/.wine/drive_c/Program Files/Cardfile$ wine CARDFILE.EXE CONTACTS.CRD
fixme:service:scmdatabase_autostart_services Auto-start service L"PGPmemlock" failed to start: 2
p11-kit: couldn't load module: /usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: /usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: cannot open shared object file: No such file or directory
fixme:ole:OleRegisterClientDoc16 (Cardfile,C:\Program Files\Cardfile\CONTACTS.CRD,...): stub
I wonder if this is causing a problem when I launch from the .desktop file?
soundgeek
Level 2
Level 2
Posts: 20
Joined: Sun Mar 08, 2015 9:39 am

Re: Running a .exe file which uses a parameter file used to

Post by soundgeek »

Bob Wya wrote: What is the result from (run as your normal user):

Code: Select all

which wine
env | grep WINE
whoami
'ls' -ahl "${HOME}/.wine/drive_c/Program Files"
locale
You can post all that output "in-line" (with code bracketing obviously) - it should be quite short...

Probably just something minor - as you can run the program manually from a terminal 8)

Bob
I got this Bob:

Code: Select all

gray@Eastbed-Linux:/$ which wine
/usr/bin/wine
gray@Eastbed-Linux:/$ env | grep WINE
gray@Eastbed-Linux:/$ whoami
gray
gray@Eastbed-Linux:/$ 'ls' -ahl "${HOME}/.wine/drive_c/Program Files"
total 36K
drwxrwxr-x  8 gray gray 4.0K Feb 13 12:56 .
drwxrwxr-x 10 gray gray 4.0K Feb 27 14:32 ..
drwx------  2 gray gray 4.0K Feb 27 14:32 Cardfile
drwxrwxr-x  3 gray gray 4.0K Mar 25  2015 Common Files
drwxrwxr-x 21 gray gray 4.0K Jan 13 11:28 GJV2000
drwxrwxr-x  2 gray gray 4.0K Mar 25  2015 Internet Explorer
drwx------  2 gray gray 4.0K Feb 13 12:53 Spider
-rw-rw-r--  1 gray gray  168 Nov 30 19:04 VideoServerE_v1063.exe
drwxrwxr-x  2 gray gray 4.0K Jan 20 12:38 Windows Media Player
gray@Eastbed-Linux:/$ locale
LANG=en_GB.UTF-8
LANGUAGE=en_GB:en
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=
gray@Eastbed-Linux:/$ 
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Running a .exe file which uses a parameter file used to

Post by Bob Wya »

Well don't ask me!"! Some errors are important - some will not cause any (user visible) problems and can basically be ignored. But say your application isn't working...

You need the 32-bit version of libgnome-keyring-common (or whatever Debian/ Ubuntu packages this as).

You didn't mention your CARDFILE program is a Win16 (NE) application. That might be introducing some further complications - just be glad it works at all - IMHO!!

Do you get any other console output or are you being selective in what you post?

Your setup configuration looks basically sound btw.

Bob
soundgeek
Level 2
Level 2
Posts: 20
Joined: Sun Mar 08, 2015 9:39 am

Re: Running a .exe file which uses a parameter file used to

Post by soundgeek »

Bob Wya wrote:Well don't ask me!"! Some errors are important - some will not cause any (user visible) problems and can basically be ignored. But say your application isn't working...
Well, the application is working, it is just the automatic loading of the parameter file which isn't. This used to work too, but one day it just stopped. Even with all the error messages, it still launches fine. It just won't load the parameter file anymore.
Bob Wya wrote: You need the 32-bit version of libgnome-keyring-common (or whatever Debian/ Ubuntu packages this as).
Bob
Ok. I'll look for that.
Bob Wya wrote: You didn't mention your CARDFILE program is a Win16 (NE) application. That might be introducing some further complications - just be glad it works at all - IMHO!!

Do you get any other console output or are you being selective in what you post?

Your setup configuration looks basically sound btw.

Bob
Yes, CARDFILE is an old application. Win7 refused to run it. I was delighted when it worked on Wine/Linux. I've just discovered that the old windows Spider game program works too, so that will delight my partner! :)

That's all the console output.

Thanks for your help Bob. I'm trying to leave windows behind, but keep a few applications running.
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Running a .exe file which uses a parameter file used to

Post by Bob Wya »

soundgeek wrote:
Bob Wya wrote:Well don't ask me!"! Some errors are important - some will not cause any (user visible) problems and can basically be ignored. But say your application isn't working...
Well, the application is working, it is just the automatic loading of the parameter file which isn't. This used to work too, but one day it just stopped. Even with all the error messages, it still launches fine. It just won't load the parameter file anymore.

Yes, CARDFILE is an old application. Win7 refused to run it. I was delighted when it worked on Wine/Linux. I've just discovered that the old windows Spider game program works too, so that will delight my partner! :)

That's all the console output.

Thanks for your help Bob. I'm trying to leave windows behind, but keep a few applications running.
Well I was only half joking - it was on the cards at one point - till there was a public outcry... :lol:

Sorry if I couldn't sort out the automatic parameter loading... That's a puzzler I must say... You could of course file a bug report against that. Especially if you're no longer able to load the parameter/file from both a .desktop file or when manually launching the application in a shell... Could be a Wine regression! :cry:

Bob
User avatar
dimesio
Moderator
Moderator
Posts: 13373
Joined: Tue Mar 25, 2008 10:30 pm

Re: Running a .exe file which uses a parameter file used to

Post by dimesio »

Check the filetype associations on your system: are CRD files associated with CARDFILE.EXE?
soundgeek
Level 2
Level 2
Posts: 20
Joined: Sun Mar 08, 2015 9:39 am

Re: Running a .exe file which uses a parameter file used to

Post by soundgeek »

Bob Wya wrote: You need the 32-bit version of libgnome-keyring-common (or whatever Debian/ Ubuntu packages this as).
Bob
I installed libgnome-keyring0:i386 via the Ubuntu Software Centre and also
sudo apt-get install libp11-kit-gnome-keyring:i386 (via Term)

Now, when I do
wine CARDFILE.EXE CONTACTS.CRD
in term, CARDFILE launches & opens CONTACTS.CRD, but I get:

Code: Select all

fixme:service:scmdatabase_autostart_services Auto-start service L"PGPmemlock" failed to start: 2
fixme:ole:OleRegisterClientDoc16 (Cardfile,C:\Program Files\Cardfile\CONTACTS.CRD,...): stub
when it launches and

Code: Select all

fixme:ole:OleEnumObjects16 (1, 1257:3506): stub
fixme:ole:OleEnumObjects16 (1, 1257:371e): stub
fixme:ole:OleRevokeClientDoc16 (1): stub
so I don't get the key-ring errors now, just Ole. So some improvement! :)
soundgeek
Level 2
Level 2
Posts: 20
Joined: Sun Mar 08, 2015 9:39 am

Re: Running a .exe file which uses a parameter file used to

Post by soundgeek »

dimesio wrote:Check the filetype associations on your system: are CRD files associated with CARDFILE.EXE?
I confess, I don't know how to do this.

I deliberately put both the application, CARDFILE.EXE and the parameter file and its type explicitly, CONTACTS.CRD, in the hope that no filetype look-up would be necessary. It used to work from a .desktop file!
User avatar
dimesio
Moderator
Moderator
Posts: 13373
Joined: Tue Mar 25, 2008 10:30 pm

Re: Running a .exe file which uses a parameter file used to

Post by dimesio »

Looking back through this thread, you haven't mentioned trying a .desktop file using both wine start and a path statement. If that's the case, try that.
soundgeek
Level 2
Level 2
Posts: 20
Joined: Sun Mar 08, 2015 9:39 am

Re: Running a .exe file which uses a parameter file used to

Post by soundgeek »

dimesio wrote:Looking back through this thread, you haven't mentioned trying a .desktop file using both wine start and a path statement. If that's the case, try that.
As advised above, in the .desktop file I tried:
Path="${HOME}/.wine/drive_c/Program Files/Cardfile"
and got a message that the path had not worked.

Then I amended the file to look like this, with a full unix path & no double-quotes:

Code: Select all

[Desktop Entry]
Name=Contacts File
Comment=Opens contacts.crd in Cardfile.exe
Exec=wine "CARDFILE.EXE" "CONTACTS.CRD"
Terminal=False
Type=Application
Path=/home/gray/.wine/drive_c/Program Files/Cardfile 
Icon=/usr/share/icons/contacts.png
and it worked!
Last edited by soundgeek on Thu Mar 03, 2016 8:34 am, edited 2 times in total.
soundgeek
Level 2
Level 2
Posts: 20
Joined: Sun Mar 08, 2015 9:39 am

Re: Running a .exe file which uses a parameter file used to

Post by soundgeek »

Now I also find that this advice (from FAQ/manual?) works again...
You need to use wine start if you specify a full path, because that allows Wine to set the working directory for the program if it needs it. You can also use double quotes, but you need two backslashes instead of one:

wine start "C:\\Games\\Tron\\tron.exe"
... as this .desktop file also works, in the style that originally worked for me, without the Path statement:

Code: Select all

[Desktop Entry]
Name=Contacts-crd File
Comment=Opens contacts.crd in Cardfile.exe
Exec=wine start "C:\\Program Files\\Cardfile\\CARDFILE.EXE" "CONTACTS.CRD"
Terminal=False
Type=Application
Icon=/usr/share/icons/contacts.png
So I am happy, but completely confused!

Maybe doing this...
I installed libgnome-keyring0:i386 via the Ubuntu Software Centre and also
sudo apt-get install libp11-kit-gnome-keyring:i386 (via Term)
... fixed something?
soundgeek
Level 2
Level 2
Posts: 20
Joined: Sun Mar 08, 2015 9:39 am

Re: Running a .exe file which uses a parameter file used to

Post by soundgeek »

Many thanks dimesio & Bob Wya for all your help & guidance.

I'm not sure whether I should raise a bug?
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Running a .exe file which uses a parameter file used to

Post by Bob Wya »

soundgeek wrote:Many thanks dimesio & Bob Wya for all your help & guidance.

I'm not sure whether I should raise a bug?
I don't think our (shared) inability, to use Wine correctly, is a good enough reason for raising a bug... :lol:

I was going to suggest your current solution (honest) - but I guess didn't wander to start wandering off into the weeds too much! Tonnes of solutions - with only minor variants - might start getting annoying after a while!

Just out of interest does this work?? :idea:

Code: Select all

[Desktop Entry]
Name=Contacts-crd File
Comment=Opens contacts.crd in Cardfile.exe
Exec=wine "C:\\Program Files\\Cardfile\\CARDFILE.EXE" "C:\\Program Files\\Cardfile\\CONTACTS.CRD"
Terminal=False
Type=Application
Path=/home/gray/.wine/drive_c/Program Files/Cardfile
Icon=/usr/share/icons/contacts.png
The start command will give Wine more context to the command being executed (kind off like xdg-open in Linux does or running a Windows command from the start menu). Hence my thought that maybe it's still a path issue at fault... So maybe your application is simply looking for the supplied parameter file in the wrong directory (a default place like your %userprofile%\Documents directory say)?? Just a thought?!! 8)

Glad you got things working again!! It's really great to hear that Wine still supports these old 16-bit applications (especially when MS doesn't)... 8)

Bob
soundgeek
Level 2
Level 2
Posts: 20
Joined: Sun Mar 08, 2015 9:39 am

Re: Running a .exe file which uses a parameter file used to

Post by soundgeek »

I don't think our (shared) inability, to use Wine correctly, is a good enough reason for raising a bug... :lol:
Ha-ha!
Just out of interest does this work?? :idea:

Code: Select all

[Desktop Entry]
Name=Contacts-crd File
Comment=Opens contacts.crd in Cardfile.exe
Exec=wine "C:\\Program Files\\Cardfile\\CARDFILE.EXE" "C:\\Program Files\\Cardfile\\CONTACTS.CRD"
Terminal=False
Type=Application
Path=/home/gray/.wine/drive_c/Program Files/Cardfile
Icon=/usr/share/icons/contacts.png
That launches the application & when I click Open in the application, it has the right directory & CONTACTS.CRD is visible, but it didn't open it.

I couldn't get a path with $HOME in it to work.

The dusting of snow has melted & it's cloudy, but sunny here in Sheffield, UK :)
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Running a .exe file which uses a parameter file used to

Post by Bob Wya »

soundgeek wrote:

Code: Select all

[Desktop Entry]
Name=Contacts-crd File
Comment=Opens contacts.crd in Cardfile.exe
Exec=wine "C:\\Program Files\\Cardfile\\CARDFILE.EXE" "C:\\Program Files\\Cardfile\\CONTACTS.CRD"
Terminal=False
Type=Application
Path=/home/gray/.wine/drive_c/Program Files/Cardfile
Icon=/usr/share/icons/contacts.png
That launches the application & when I click Open in the application, it has the right directory & CONTACTS.CRD is visible, but it didn't open it.

I couldn't get a path with $HOME in it to work.

The dusting of snow has melted & it's cloudy, but sunny here in Sheffield, UK :)
So your homework is... Fire up a Windows 98 VM... Run your application from a DOS shell and see what the behaviour is! Using the the command above... I bet you it does exactly the same (your contacts file is not loaded)... i.e. it's not a bug in Wine - it's just as busted as Windows(TM)! :o

The ${HOME} thingy was more of a "convenient placeholder". I guess it might work in some Desktop Environments - depends what env variables they pass on to launched applications...

We've hardly had any snow down here in Cambridge this winter - certainly not recently - plenty of rain though... 8)
Locked