matiasb / python-unrar

A ctypes wrapper for UnRAR library, plus a rarfile module on top of it.
http://python-unrar.readthedocs.org/en/latest/
GNU General Public License v3.0
74 stars 30 forks source link

DLL import error. Current version on PIP too old #32

Open MysticCoss opened 1 year ago

MysticCoss commented 1 year ago

Hello, the library import in https://github.com/matiasb/python-unrar/blob/ceaf02fb6251270d69a5768daefbf3795653f64a/unrar/unrarlib.py#L44 is 32bit dll and it won't work if python in 64bit. I have to modify it to UnRAR64.dll for it to work.

I suggest a solution for this problem: -Detect architechture (x32 or x64) to import correct library -Create a default path to those libraríe instead of just using MESSY ENVIRONMENT VARIABLE only, which in most case is C:\Program Files (x86)\UnrarDLL for x32 and C:\Program Files (x86)\UnrarDLL\x64 for x64.

And please update the version on PIP.

Thank you very much