radiomanV / TL866

Open source software for TL866
GNU General Public License v2.0
334 stars 79 forks source link

Error running Xgpro.exe using Wine on Linux Mint 18.1 #20

Closed daveho closed 5 years ago

daveho commented 5 years ago

I'm trying to use Xgpro 8.3.3 under Wine on Linux Mint 18.1. I've tried to follow the readme instructions closely. Here's what I did:

echo $WINEARCH
# output is win32
wine tmp/XgproV833_Setup.exe
# change destination folder to C:\Xgpro
# click install
cd .wine/drive_c/Xgpro
cp ~/Downloads/setupapi.dll .
sudo vi /etc/udev/rules.d/51-minipro.rules
# added contents as described in readme
sudo udevadm trigger
cd $HOME
wine .wine/drive_c/Xgpro/Xgpro.exe

The setupapi.dll is the one from the wine/TL866II directory in the repo.

The output of the last command (attempting to run Xgpro.exe) is

err:module:import_dll Library WINUSB.DLL (which is needed by L"Z:\\home\\dhovemey\\.wine\\drive_c\\Xgpro\\Xgpro.exe") not found
err:module:LdrInitializeThunk Main exe initialization for L"Z:\\home\\dhovemey\\.wine\\drive_c\\Xgpro\\Xgpro.exe" failed, status c0000135

I read the discussion in #14, which seemed to indicate that this error was due to Wine being in 64 bit mode. However, even with $WINEARCH set to win32 I still get this error.

I'm guessing I'm doing something stupid—any help would be greatly appreciated.

radiomanV commented 5 years ago

Hi, seems like the setupapi.dll is not loaded at all. Perhaps the issue #10 can help you. Also unninstaling wine and all wine related dependencies and delete the .wine directory followed by a new wine install can help. There is something local there which i don't know what is. By default in a freshly installed Mint even a 64 bit one you only need to install wine and to add the udev rule. That's all you need.

daveho commented 5 years ago

@radiomanV Thank you for the quick response! And thank you for your work supporting Minipro hardware on Linux systems.

I took your advice and completely removed all Wine packages and my $HOME/.wine directory. I then installed winehq-stable stable from the official PPA per the instructions at https://wiki.winehq.org/Ubuntu, ran XgproV833_Setup.exe again, and copied in setupapi.dll. Now Xgpro.exe starts with no issues!

daveho commented 5 years ago

I was able to successfully reflash the firmware on the programmer, and then program and verify a W27C512 EEPROM. So everything appears to be working correctly!

Thanks again!

radiomanV commented 5 years ago

Good! this was something with your wine package. I'm glad you figured out.

artelse commented 5 years ago

Hope you don´t mind adding to this thread. On a new Mint 18.3, I can´t get Xgpro to work, it fails like so:

wine .wine/drive_c/Xgpro/Xgpro.exe 
Dll Loaded.
Found Xgpro v8.33
Base Address = 0x00400000
Code section = 0x00401000,0x0020D400
Open Devices found at 0x004643D0
Close Devices found at  0x004641C0
Usb Handle found at  0x006A8B6C
WinUsb Handle found at  0x006B0198
Devices count found at  0x006AFF50
0009:fixme:font:get_outline_text_metrics failed to read full_nameW for font L"Ani"!
Open devices.
Close devices.
libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/002/021: Permission denied
libusb: error [_get_usbfs_fd] libusb requires write access to USB device nodes.
RegisterDeviceNotifications hWnd=1006E4
002b:fixme:ver:GetCurrentPackageId (0xb3fe8c (nil)): stub
Close devices.
Open devices.
Close devices.
Close devices.
Open devices.
Close devices.
libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/002/023: Permission denied
libusb: error [_get_usbfs_fd] libusb requires write access to USB device nodes.

The Close and Open devices entries are (un)plugging the programmer. When I run as root:

sudo wine .wine/drive_c/Xgpro/Xgpro.exe 
wine: /home/artelse/.wine is not owned by you

Which doesn´t make sense as it is owned by my user.. Any ideas?

Edit: Forgot to say, in the final stage of installing Xgpro, an error popped up:

DPInst.exe not supported on current OS.

This has to do with USB?

zansatsu0 commented 5 years ago

Whenever you run wine with sudo (Google why running wine with sudo isn't necessary, recommended, or safe, btw), it changes the permissions on the .wine directory. You will need to chown -R to correct this.

I suspect you are running as root because you get device permission errors. You will need to Google the proper udev config in order to allow your user to access your usb devices if it's not already set up.

On Fri, Apr 19, 2019, 7:52 PM artelse notifications@github.com wrote:

Hope you don mind adding to this thread. On a new Mint 18.3, I can get Xgpro to work, it fails like so:

wine .wine/drive_c/Xgpro/Xgpro.exe

Dll Loaded.

Found Xgpro v8.33

Base Address = 0x00400000

Code section = 0x00401000,0x0020D400

Open Devices found at 0x004643D0

Close Devices found at 0x004641C0

Usb Handle found at 0x006A8B6C

WinUsb Handle found at 0x006B0198

Devices count found at 0x006AFF50

0009:fixme:font:get_outline_text_metrics failed to read full_nameW for font L"Ani"!

Open devices.

Close devices.

libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/002/021: Permission denied

libusb: error [_get_usbfs_fd] libusb requires write access to USB device nodes.

RegisterDeviceNotifications hWnd=1006E4

002b:fixme:ver:GetCurrentPackageId (0xb3fe8c (nil)): stub

Close devices.

Open devices.

Close devices.

Close devices.

Open devices.

Close devices.

libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/002/023: Permission denied

libusb: error [_get_usbfs_fd] libusb requires write access to USB device nodes.

The Close and Open devices entries are (un)plugging the programmer. When I run as root:

sudo wine .wine/drive_c/Xgpro/Xgpro.exe

wine: /home/artelse/.wine is not owned by you

Which doesn´t make sense as it is owned by my user.. Any ideas?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/radiomanV/TL866/issues/20#issuecomment-485039989, or mute the thread https://github.com/notifications/unsubscribe-auth/AFPC4DDMEUDREJ3KKISZW7DPRJLLBANCNFSM4HDMYJKA .

artelse commented 5 years ago

Thanks for the comment. The issue indeed appeared to be a wrong udev rule. I took it from this blog but is wrong. And had to be sure to be root on the udevadm trigger command. It all works now and reflashed the firmware.