Wine 32bit prefix doesn't print

Questions about Wine on Linux
Locked
kaimon
Level 2
Level 2
Posts: 21
Joined: Fri May 20, 2016 3:50 pm

Wine 32bit prefix doesn't print

Post by kaimon »

OS debian stretch 64bit, CUPS installed, printing to PDF or network works flawlessly under linux.

I have a 32bit wine prefix originally created with POL under debian8 which I need to get to work with debian9 because I can't reinstall the Win program. The prefix works ok, just printing (network and cups pdf) doesn't work. I need to figure out where to adapt the printer settings.
Wine docs say that you need to configure printers in the spool section of .winerc but I can't find a file of that name on my system. I can find the old printer information stored in win.ini and in 2 reg files in ~/.wine/ and in the prefix folder. I'm guessing I need to change that information in the prefix folder but I was not successful up to now. Or maybe change the conf in the ~/.wine folder? Or both? Which ppd-files need to be where? It seems that the prefix had no ppd-files and the setting was "generic" .. strange. There were ppd files in ~/.wine though. But copying all of this did not work out.

Error messages using CUPS-PDF (wine crashes):

Code: Select all

wine: cannot find L"C:\\windows\\system32\\plugplay.exe"
fixme:storage:create_storagefile Storage share mode not implemented.
fixme:shell:IPersistFile_fnSaveCompleted (0xde8198)->(L"C:\\users\\ ...")
fixme:psdrv:PSDRV_ExtEscape QUERYESCSUPPORT(7) - not supported.
fixme:font:WineEngCreateFontInstance Untranslated charset 255
...
fixme:winspool:SetJobW Ignoring everything other than document title
fixme:font:WineEngCreateFontInstance Untranslated charset 255
...
fixme:psdrv:PSDRV_EndPage Already ended a page?
lpr: Generic-CUPS-PDF-Printer: unknown printer
The error messages using the network printer are the same except the last line. Wine does not crash but nothing prints.

Why is the system trying to adress the cups printer as lpr? Maybe there's also a 32bit library missing on the system. In a newly created 32bit prefix I can see that wine does not pick up cups, just lpr - while in 64bit cups is picked up. libcups2:i386 is installed but is there another one I might be missing?
User avatar
dimesio
Moderator
Moderator
Posts: 13204
Joined: Tue Mar 25, 2008 10:30 pm

Re: Wine 32bit prefix doesn't print

Post by dimesio »

kaimon wrote:Wine docs say that you need to configure printers in the spool section of .winerc
Where on earth are you seeing that on this site? The current User's Guide certainly doesn't say that. https://wiki.winehq.org/Wine_User%27s_Guide#Printers

The most common reason for printing not working is failure to install the needed 32 bit CUPS libs on a 64 bit system. You shouldn't need to configure anything.
kaimon
Level 2
Level 2
Posts: 21
Joined: Fri May 20, 2016 3:50 pm

Re: Wine 32bit prefix doesn't print

Post by kaimon »

Where on earth are you seeing that on this site?
I don't remember where I got that from. It might have been old.
I can't figure out which 32bit lib might be missing. libcups2:i386 is the only one I can find and that one is installed.
You shouldn't need to configure anything.
Even if the prefix was installed on a different system? There is definitely printer information stored in the prefix and the old printers from the previous system still show up in the print dialog. The printer configuration is obviously wrong.
kaimon
Level 2
Level 2
Posts: 21
Joined: Fri May 20, 2016 3:50 pm

Re: Wine 32bit prefix doesn't print

Post by kaimon »

I now managed to create a new prefix that prints correctly. So missing 32 bit CUPS libs is obviously not the problem.

Just the old prefix still doesn't print.
I copied the correct drivers into .../drive_c/windows/system32/spool/drivers/ of the defunct prefix and edited user.reg and system.reg to reflect those changes. i used the files of the working prefix as templates. But somewhere it is still trying to adress the non existent lpr printer.

Code: Select all

wine: cannot find L"C:\\windows\\system32\\plugplay.exe"
fixme:storage:create_storagefile Storage share mode not implemented.
fixme:richedit:ME_HandleMessage EM_SETMARGINS: stub
fixme:shell:IPersistFile_fnSaveCompleted (0xda8778)->(L"C:\\users\\xxx\\Recent\\1NK16.XLS (28).lnk")
fixme:richedit:ME_HandleMessage EM_SETMARGINS: stub
fixme:richedit:ME_HandleMessage EM_SETMARGINS: stub
fixme:psdrv:PSDRV_ExtEscape QUERYESCSUPPORT(7) - not supported.
fixme:font:WineEngCreateFontInstance Untranslated charset 255
...
fixme:winspool:SetJobW Ignoring everything other than document title
...
fixme:psdrv:PSDRV_EndPage Already ended a page?
fixme:psdrv:PSDRV_ExtEscape QUERYESCSUPPORT(7) - not supported.
fixme:winspool:SetJobW Ignoring everything other than document title
....
fixme:psdrv:PSDRV_EndPage Already ended a page?
lpr: Generic-CUPS-PDF-Printer: unknown printer
I really need this prefix to work again. Where else can I find printer configuration in the prefix?
kaimon
Level 2
Level 2
Posts: 21
Joined: Fri May 20, 2016 3:50 pm

Re: Wine 32bit prefix doesn't print

Post by kaimon »

But somewhere it is still trying to adress the non existent lpr printer.
Scratch that. It just can't find the correct printer and prints into nirwana.
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Wine 32bit prefix doesn't print

Post by Bob Wya »

kaimon wrote:
But somewhere it is still trying to adress the non existent lpr printer.
Scratch that. It just can't find the correct printer and prints into nirwana.
I love that band - Nirwana - real good... :lol:

What's the output from:

Code: Select all

export WINEDEBUG=+winspool
wineboot -u
for your broken WINEPREFIX?

Also what version of Wine are you using?

Ta
Bob
kaimon
Level 2
Level 2
Posts: 21
Joined: Fri May 20, 2016 3:50 pm

Re: Wine 32bit prefix doesn't print

Post by kaimon »

Thank you very much for coming back to me. This is driving me nuts for months now.

For that MS Office 2000 installation I used wine 1.3.12 which was the recommendation at the time (several years back) - and later versions did not work. I'm administering my wine versions with POL so I'm not really sure where to enter your commands.
CD'ing into the directory of the broken prefix and entering your commands there results in a complete hangup after export WINEDEBUG=+winspool. I had to ^C. The next command results in:

Code: Select all

$ wineboot -u
trace:winspool:load_cups 0x7cc8a788: libcups.so.2 loaded
trace:winspool:WINSPOOL_EnumPrintersW Found 3 printers
trace:winspool:WINSPOOL_EnumPrintersW Printer 0 is L"Generic-CUPS-PDF-Printer"
trace:winspool:WINSPOOL_EnumPrintersW Printer 1 is L"MFC7360N"
trace:winspool:WINSPOOL_EnumPrintersW Printer 2 is L"PDF"
trace:winspool:WINSPOOL_EnumPrintersW Found 3 printers
trace:winspool:WINSPOOL_EnumPrintersW Printer 0 is L"Generic-CUPS-PDF-Printer"
trace:winspool:WINSPOOL_GetStringFromReg L"Name": L"Generic-CUPS-PDF-Printer"
trace:winspool:WINSPOOL_GetStringFromReg L"Port": L"CUPS:Generic-CUPS-PDF-Printer"
trace:winspool:WINSPOOL_EnumPrintersW Printer 1 is L"MFC7360N"
trace:winspool:WINSPOOL_GetStringFromReg L"Name": L"MFC7360N"
trace:winspool:WINSPOOL_GetStringFromReg L"Port": L"CUPS:MFC7360N"
trace:winspool:WINSPOOL_EnumPrintersW Printer 2 is L"PDF"
trace:winspool:WINSPOOL_GetStringFromReg L"Name": L"PDF"
trace:winspool:WINSPOOL_GetStringFromReg L"Port": L"CUPS:PDF"
trace:winspool:CUPS_LoadPrinters Found 3 CUPS printers:
trace:winspool:CUPS_LoadPrinters Printer 0: L"Generic-CUPS-PDF-Printer". printer_type 82f04c
trace:winspool:CUPS_LoadPrinters Printer already exists
trace:winspool:SetDefaultPrinterW (L"Generic-CUPS-PDF-Printer")
trace:winspool:SetDefaultPrinterW set device to L"Generic-CUPS-PDF-Printer,wineps.drv,CUPS:Generic-CUPS-PDF-Printer"
trace:winspool:CUPS_LoadPrinters Printer 1: L"MFC7360N". printer_type 801004
trace:winspool:CUPS_LoadPrinters Printer already exists
trace:winspool:CUPS_LoadPrinters Printer 2: L"PDF". printer_type 80f04c
trace:winspool:CUPS_LoadPrinters Printer already exists
trace:winspool:WINSPOOL_EnumPrintersW Found 3 printers
trace:winspool:WINSPOOL_EnumPrintersW Printer 0 is L"Generic-CUPS-PDF-Printer"
trace:winspool:WINSPOOL_EnumPrintersW Printer 1 is L"MFC7360N"
trace:winspool:WINSPOOL_EnumPrintersW Printer 2 is L"PDF"
trace:winspool:WINSPOOL_EnumPrintersW Found 3 printers
trace:winspool:WINSPOOL_EnumPrintersW Printer 0 is L"Generic-CUPS-PDF-Printer"
trace:winspool:WINSPOOL_GetStringFromReg L"Name": L"Generic-CUPS-PDF-Printer"
trace:winspool:WINSPOOL_GetStringFromReg L"Port": L"CUPS:Generic-CUPS-PDF-Printer"
trace:winspool:WINSPOOL_EnumPrintersW Printer 1 is L"MFC7360N"
trace:winspool:WINSPOOL_GetStringFromReg L"Name": L"MFC7360N"
trace:winspool:WINSPOOL_GetStringFromReg L"Port": L"CUPS:MFC7360N"
trace:winspool:WINSPOOL_EnumPrintersW Printer 2 is L"PDF"
trace:winspool:WINSPOOL_GetStringFromReg L"Name": L"PDF"
trace:winspool:WINSPOOL_GetStringFromReg L"Port": L"CUPS:PDF"
trace:winspool:load_cups 0x7caf4698: libcups.so.2 loaded
trace:winspool:WINSPOOL_LoadSystemPrinters Init already done
trace:winspool:load_cups 0x7c4dd630: libcups.so.2 loaded
trace:winspool:WINSPOOL_LoadSystemPrinters Init already done
Could not load wine-gecko. HTML rendering will be disabled.
wine: configuration in '/home/..../.wine' has been updated.
This looks correct but I'm not sure whether the directory ~/.wine is even read by my wine install. Anyway, the debug messages changed:

Code: Select all

wine: cannot find L"C:\\windows\\system32\\plugplay.exe"
fixme:storage:create_storagefile Storage share mode not implemented.
fixme:shell:IPersistFile_fnSaveCompleted (0xde8a38)->(L"C:\\users\\...\\Recent\\...")
fixme:psdrv:PSDRV_ExtEscape QUERYESCSUPPORT(7) - not supported.
....
fixme:psdrv:PSDRV_ExtEscape QUERYESCSUPPORT(25) - not supported.
fixme:winspool:SetJobW Ignoring everything other than document title
fixme:font:WineEngCreateFontInstance Untranslated charset 255
...
fixme:psdrv:PSDRV_EndPage Already ended a page?
lpr: connect: No such file or directory
Is lpd daemon running?
jobs queued, but cannot start daemon.
I've tried to eliminate every mention of an lp driver in the configs because I don't have a lineprinter. I have no idea about the relation in between cups and lpr, but shouldn't it call cups?
kaimon
Level 2
Level 2
Posts: 21
Joined: Fri May 20, 2016 3:50 pm

Re: Wine 32bit prefix doesn't print

Post by kaimon »

I really had to print something today so I decided to reanimate my old Jessie system - and guess what, printing works. So the prefix is not really broken, it just doesn't want to play nice with stretch. Although I'm using the same hardware stretch probably has a different printer allocation. That's what I need to adjust in the profile.
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Wine 32bit prefix doesn't print

Post by Bob Wya »

kaimon wrote:Thank you very much for coming back to me. This is driving me nuts for months now.

For that MS Office 2000 installation I used wine 1.3.12 which was the recommendation at the time (several years back) - and later versions did not work.

...
Really just start with a clean WINEPREFIX - setup with a supported version of Wine e.g. 3.0-rc2.
Especially if the prefix origins are that ancient...
Alternatively keep tearing your hair out trying to fix the issue... It's your time. :lol:

A lot of those error messages are not coming from Wine... E.g.

Code: Select all

Is lpd daemon running?
looks like cups-related errors... Hopefully this is just to due to a broken WINEPREFIX.

Bob
kaimon
Level 2
Level 2
Posts: 21
Joined: Fri May 20, 2016 3:50 pm

Re: Wine 32bit prefix doesn't print

Post by kaimon »

Start with a clean wine prefix - how would I then copy over the existing Office Installation? This is impossible, isn't it? Problem is: I have lost the office install media! So I can't start fresh.

The prefix is not broken, just the daemon and the printers might be "at another place" in stretch than it is in jessie ... and wine doesn't pick up the change.
User avatar
dimesio
Moderator
Moderator
Posts: 13204
Joined: Tue Mar 25, 2008 10:30 pm

Re: Wine 32bit prefix doesn't print

Post by dimesio »

For that MS Office 2000 installation I used wine 1.3.12 which was the recommendation at the time (several years back) - and later versions did not work. I'm administering my wine versions with POL so I'm not really sure where to enter your commands
POL has a long history of applying unnecessary and sometimes harmful overrides in their scripts, as well as generally failing to update them when needed. It isn't supported here, and the standard advice given when a user has problems with anything installed with it is to reinstall in plain Wine.

I can point out one mistake you made:
CD'ing into the directory of the broken prefix and entering your commands there results in a complete hangup after export
POL scripts install things to a non-standard wineprefix, and simply CDing to the wineprefix is not enough to use it; you have to specify the WINEPREFIX in the command line, or Wine will use ~/.wine, which is what happened when you did it. https://wiki.winehq.org/FAQ#Can_I_store ... 2F.wine.3F
kaimon
Level 2
Level 2
Posts: 21
Joined: Fri May 20, 2016 3:50 pm

Re: Wine 32bit prefix doesn't print

Post by kaimon »

Since I had no idea where and how exactly to specify the WINEPREFIX I grudgingly continued to use Jessie for printing.
But after learning a bit more about linux I came back to your advice and correctly guessed how to do it:

Code: Select all

env WINEPREFIX=~/.PlayOnLinux/wineprefix/Office2000 WINEDEBUG=+winspool
wineboot -u
After several failed tries I figured out: No WINEPREFIX for wineboot -u.
And guess what? It worked. Wine found the correct printers. Thanks to your remark dimesio, I can finally print again. Thank you very much.
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Wine 32bit prefix doesn't print

Post by Bob Wya »

kaimon wrote:correctly guessed how to do it ...
I would suggest you don't "guess" anything and just read the standard Wine documentation.
See: WineHQ FAQ: 6.5 Wineprefixes.
Especially since you appeared to have "guessed" wrongly. :roll:

That should be:

Code: Select all

env WINEPREFIX=~/.PlayOnLinux/wineprefix/Office2000 WINEDEBUG=+winspool wineboot -u
So I would suggest you also read the man page for env:

Code: Select all

man env
Because you are using it incorrectly as well.

Bob
kaimon
Level 2
Level 2
Posts: 21
Joined: Fri May 20, 2016 3:50 pm

Re: Wine 32bit prefix doesn't print

Post by kaimon »

I'm sorry if I don't meet your expectations. I *have* read the FAQ you quoted. Several times actually. It did not give me any answers. wineboot is not even mentioned, neither there nor in the User's Guide. It is mentioned in the wiki but not with the debug or prefix syntax. Also "man env" doesn't tell me anything useful. It might talk to you but not to me. I'm probably too dumb. Sorry again.

There's absolutely no need to "roll eyes" at people who know less than you do. Also "RTFM" has never helped anybody. Especially if the user obviously doesn't have the level of knowledge needed to understand the manual.

I'm just glad that the wine prefix works again. Thanks again everybody for the help.
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Wine 32bit prefix doesn't print

Post by Bob Wya »

@kaimon

Thanks for calling me out. Yes, I was being a dick there. Sorry 'bout that. :oops:

I do actually agree, the Wine end-user documentation is pretty awful... :cry:

Btw technically you don't need to use:

Code: Select all

wineboot -u
The first wine command you call, will create a new WINEPREFIX.
wineboot is always called, when wine is first invoked on a WINEPREFIX (whether new or a pre-existing one).

So I often create a new WINEPREFIX with:

Code: Select all

winetricks isolate_home
which will create a WINEPREFIX without any symbolic links to your user's HOME folder (which I find very annoying).

winetricks calls:

Code: Select all

wine --version
(and makes some other wine test calls). The side effect of this is to create the new WINEPREFIX.

There are a tonne of little wine builtin programs, that aren't very well documented.

Probably the most useful ones (IMHO) are:

Code: Select all

wine cmd # Windows terminal / execute bat batch scripts, etc. (CLI)
wine control # Wines equivalent of the Windows Control panel (GUI)
wine eject # Eject a disc from the specified optical drive (CLI)
winepath # mangle Windows <-> Unix paths (CLI)
wine reg # registry editor (CLI)
wine taskmgr # same as Windows task manager utility (GUI)
wine uninstaller # global program installer / uninstaller (GUI)
winefile # alternative Wine file manager (GUI)
All the best,
Bob
Locked