Miranda NG Official Community Forum

Forum for English speaking Miranda NG users => Support/Help => Topic started by: TheQL on 11 04 2020, 19:29:02

Title: (DB?) plugins not loaded via Wine
Post by: TheQL on 11 04 2020, 19:29:02
Hi there,

a long time ago I packaged Miranda IM into a Wine bottle. For ICQ WIM I need to migrate to Miranda NG, but I don't manage to get it running via Wine on my Mac.
I followed your instructions on https://wiki.miranda-ng.org/index.php?title=Miranda_unter_Wine - but once I run Miranda the profile manager starts and all I can do is click on exit. Apparently it doesn't see dbx_mdbx.dll - and maybe no plugins at all.

mirandaboot.ini doesn't let me specify a plugin directory, so I assume it should just load all plugins from "Plugins". Something must be going wrong.

Before I tried that I actually ran Winebottler and used the installer, this sort of worked, but when I wanted to start the resulting .app it just opened, configured the bottle and then closed without any kind of error message. It was then when I followed your guide manually to run into this problem.

P.S.: Just tried to use Winebottler with an old installer (Miranda_IM_(32bit)_v0.10.51.exe) - that just works and I can create a new profile just fine.
Title: Re: (DB?) plugins not loaded via Wine
Post by: dartraiden on 11 04 2020, 21:10:17
Use 64-bit version of Miranda NG and use dbx_sqlite, because dbx_mdbx does not work under Wine and dbx_mmap is read only driver.

We will think about 32-bit Miranda under Wine when we deal with dbx_mdbx, because dbx_sqlite is very buggy, so dbx_mdbx is our priority target
Title: Re: (DB?) plugins not loaded via Wine
Post by: TheQL on 11 04 2020, 21:17:29
Hi there,

thanks for your reply. After your suggestion I have manually added dbx_sqlite to the plugins dir, but it still doesn't show any available driver. It is still the 32-bit installation from above, though. XP 64-Bit was weird, so I think I should go for Windows 7 64-Bit? If so, the wiki page should probably be updated.

Anyway, I would have liked to use my old Miranda IM profile as it holds decades of message history... Seems that isn't possible... Has there ever been an ICQ WIM plugin for the old Miranda?

EDIT: Just tried Winebottler with XP 64-Bit - it just crashed. Not using installer, but just copying the directory over (incl. sqlite db driver). Exact same settings, but with 32-bit archive (+ sqlite db driver) and XP 32 it starts, with no DB plugin, of course.
Title: Re: (DB?) plugins not loaded via Wine
Post by: dartraiden on 11 04 2020, 21:48:22
Wiki page is outdated and should be rewritten completely.

Since you want to import history from Miranda IM, you probably need a virtual machine with Windows (7 or 10). Сonverting a profile from IM to NG format requires several steps, no one tested all of them under the Wine

1) use VirtualBox/VMWare with Win 7 or newer
2) use our manual for migrating IM profile to NG format (https://wiki.miranda-ng.org/index.php?title=Installation_and_update#Upgrading_Miranda_IM_to_Miranda_NG):
- run your old IM profile in Miranda IM and check that it is in MMAP format
- if yes, put IM Updater to Miranda IM installation and restart Miranda IM
- IM Updater transform Miranda IM to Miranda NG 0.94.9
- check for updates manually until you get the latest stable 0.95.11. Your profile will be converted to MDBX format. All history and contacts must be preserved. You can connect to ICQ if you want (please read this (https://wiki.miranda-ng.org/index.php?title=Plugin:ICQ#Rejected_password) and this (https://forum.miranda-ng.org/index.php?topic=5623.0) before. Pay attention to "Why do some contacts in the contact list become faint when I first log in with a new protocol?" section).

we do not test IM Updater under Wine so all previous steps should be performed under Windows

3) now you get working NG under Windows. But dbx_mdbx cannot work under Wine. So you need:
- change update channel from stable to dev and perform update (because there is no stable dbx_sqlite)
- install dbx_sqlite plugin (via our PluginUpdater)
- create new SQLITE database
- import all contacts, history and settings from MDBX db to SQLITE db (Main menu → Import)

this step should be performed under Windows because dbx_mdbx does not work under Wine

4) use this SQLITE db under Wine
Title: Re: (DB?) plugins not loaded via Wine
Post by: TheQL on 11 04 2020, 21:50:49
Thanks again. I might consider this, but first I need to see that I somehow get Miranda NG running at all. I have edited my above comment to show some of the steps I tried, none of them were successful as of now.
Title: Re: (DB?) plugins not loaded via Wine
Post by: dartraiden on 11 04 2020, 21:59:24
If dbx_sqlite crashes under Wine, there is no way to start the Miranda...

so we have 3 problems
1) 32-bit db drivers cannot start under Wine
this is the lesser problem, since a 32-bit dbx_sqlite would also crash as 64-bit, and a 32-bit mdbx would not work

2) dbx_sqlite crashes under Wine
we hear about this problem for the first time

3) dbx_mdbx does not work under Wine, because some functions are missing in Wine code and we need to create some hacks...

I think that (3) will be fixed faster than others, but I don’t know anything about the timing, the main developer of Miranda is very busy in real life now
Title: Re: (DB?) plugins not loaded via Wine
Post by: TheQL on 11 04 2020, 22:02:42
I actually don't think it's the sqlite driver that crashes under 64-Bit. It crashes regardless if it's there or not. I can try some more stuff and come back to you.

Any recommended settings, regarding Windows version? XP-64? Win7-64? Any other winetricks I need to run? Use the installer or just the 7z archive?
Title: Re: (DB?) plugins not loaded via Wine
Post by: dartraiden on 11 04 2020, 22:05:18
XP 64 is piece of shit, so Win7 64.
Installer is not neccessary, use 7z (it's portable)
Title: Re: (DB?) plugins not loaded via Wine
Post by: dartraiden on 11 04 2020, 22:06:02
Strange... I tested sqlite under Wine in late 2019
I try to find commit which broke it
Title: Re: (DB?) plugins not loaded via Wine
Post by: TheQL on 11 04 2020, 22:15:00
XP 64 is piece of shit, so Win7 64.
Installer is not neccessary, use 7z (it's portable)

Ok, I will follow the guide once more with Win7 64. But with Winebottler it doesn't work, I know that already. Although XP 32-Bit works with the exact same settings, at least the profile manager starts. Not even that worked with any of my 64-bit tests.
Title: Re: (DB?) plugins not loaded via Wine
Post by: TheQL on 11 04 2020, 22:32:09
I have made very small progress...

I have followed the guide, but selected Windows 7 and used the 64-Bit 7z archive.
I have added the sqlite dll as usual, but that doesn't show. Funny enough though, I can create a new profile now. But it doesn't actually load, probably because the dbx_mdbx really doesn't work, but at least I can select it.
Title: Re: (DB?) plugins not loaded via Wine
Post by: dartraiden on 12 04 2020, 00:36:38
Yes. mdbx cannot increase db size due to some missing functions in Wine
I will test sqlite tomorrow, maybe I can find commit causing a crash and at least roll it back
Title: Re: (DB?) plugins not loaded via Wine
Post by: TheQL on 12 04 2020, 00:43:00
I appreciate your effort. But I don't really understand why I cannot even select the sqlite DB on first run. If you figure out if and how it works, please let me know. I might still be doing something wrong!
Title: Re: (DB?) plugins not loaded via Wine
Post by: dartraiden on 12 04 2020, 00:45:25
Quote
I cannot even select the sqlite DB

= Miranda cannot load this db driver for some reason

Maybe plugin and Miranda core are coming from various builds...
Stable Miranda cannot load dev plugins and vice versa.
Quote
Stable work of Miranda NG is guaranteed within the same build, i.e., all plugins of the same compilation are compatible with the core while two adjacent builds can be completely incompatible.

Even 2 various dev builds (for example tomorrow and yesterday) can be incompatible
Title: Re: (DB?) plugins not loaded via Wine
Post by: TheQL on 12 04 2020, 12:38:37
Makes sense, I am using the stable Miranda NG release and got the plugin from here: https://wiki.miranda-ng.org/index.php?title=Plugin:Dbx_sqlite/de
But on this page there is no sqlite plugin: https://wiki.miranda-ng.org/index.php?title=Download
Title: Re: (DB?) plugins not loaded via Wine
Post by: dartraiden on 12 04 2020, 13:12:50
Thanks, fixed (https://wiki.miranda-ng.org/index.php?title=Download&type=revision&diff=36447&oldid=33717).
Title: Re: (DB?) plugins not loaded via Wine
Post by: TheQL on 14 04 2020, 12:59:12
Update:

Using both, the development build and plugin I got to select the sqlite driver and create a new profile. The main application window did not show, though.

I have a memdump in CrashLog and the console output. I'll post/attach both, not sure if you're interested in it.

Thanks for your assistance so far!

Code: [Select]
~/.wines/miranda/drive_c/Miranda_NG # ./Miranda.sh
0010:fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0)
0010:fixme:msvcrt:_configure_wide_argv (1) stub
0010:fixme:msvcrt:_initialize_wide_environment stub
0012:err:ole:marshal_object couldn't get IPSFactory buffer for interface {00000131-0000-0000-c000-000000000046}
0012:err:ole:marshal_object couldn't get IPSFactory buffer for interface {6d5140c1-7436-11ce-8034-00aa006009fa}
0012:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hres=0x80004002
0012:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, 80004002
0012:err:ole:get_local_server_stream Failed: 80004002
0010:err:winediag:SECUR32_initNTLMSP ntlm_auth was not found or is outdated. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution.
0010:fixme:uxtheme:BufferedPaintInit Stub ()
0010:err:ole:CoGetClassObject class {56fdf344-fd6d-11d0-958a-006097c9a090} not registered
0010:err:ole:CoGetClassObject class {56fdf344-fd6d-11d0-958a-006097c9a090} not registered
0010:err:ole:create_server class {56fdf344-fd6d-11d0-958a-006097c9a090} not registered
0010:fixme:ole:CoGetClassObject CLSCTX_REMOTE_SERVER not supported
0010:err:ole:CoGetClassObject no class object {56fdf344-fd6d-11d0-958a-006097c9a090} could be created for context 0x17
0010:fixme:dwmapi:DwmIsCompositionEnabled 0x22ea50
0010:fixme:ntdll:NtLockFile I/O completion on lock not implemented yet
0010:fixme:msg:pack_message msg 14 (WM_ERASEBKGND) not supported yet
0010:fixme:uxtheme:BufferedPaintInit Stub ()
0010:err:ole:CoGetClassObject class {56fdf344-fd6d-11d0-958a-006097c9a090} not registered
0010:err:ole:CoGetClassObject class {56fdf344-fd6d-11d0-958a-006097c9a090} not registered
0010:err:ole:create_server class {56fdf344-fd6d-11d0-958a-006097c9a090} not registered
0010:fixme:ole:CoGetClassObject CLSCTX_REMOTE_SERVER not supported
0010:err:ole:CoGetClassObject no class object {56fdf344-fd6d-11d0-958a-006097c9a090} could be created for context 0x17
0010:err:ole:CoGetClassObject class {56fdf344-fd6d-11d0-958a-006097c9a090} not registered
0010:err:ole:CoGetClassObject class {56fdf344-fd6d-11d0-958a-006097c9a090} not registered
0010:err:ole:create_server class {56fdf344-fd6d-11d0-958a-006097c9a090} not registered
0010:fixme:ole:CoGetClassObject CLSCTX_REMOTE_SERVER not supported
0010:err:ole:CoGetClassObject no class object {56fdf344-fd6d-11d0-958a-006097c9a090} could be created for context 0x17
0010:err:ole:marshal_object couldn't get IPSFactory buffer for interface {00000131-0000-0000-c000-000000000046}
0010:err:ole:marshal_object couldn't get IPSFactory buffer for interface {00000122-0000-0000-c000-000000000046}
0010:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hres=0x80004002
0010:err:ole:CoMarshalInterface Failed to marshal the interface {00000122-0000-0000-c000-000000000046}, 80004002

This error got me wondering if the dll registration of secur32.dll worked.
Code: [Select]
0010:err:winediag:SECUR32_initNTLMSP ntlm_auth was not found or is outdated
Then I noticed I had configured all the dll exceptions but I had forgotten to copy the dlls to windows/system32. D'oh, that supposedly cannot work! So on with a new attempt, see below.
Title: Re: (DB?) plugins not loaded via Wine
Post by: TheQL on 14 04 2020, 13:01:24
So, although my results with winebottler all failed I created another config with its help and grabbed the Win7-64 dlls from it's bottle and copied them to my manually created setup. The result is totally different.

The profile manager doesn't even show anymore. This is the new error:

Code: [Select]
/.wines/miranda/drive_c/Miranda_NG # ./Miranda.sh
0010:fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0)
0010:fixme:msvcrt:_configure_wide_argv (1) stub
0010:fixme:msvcrt:_initialize_wide_environment stub
0010:err:seh:setup_exception stack overflow 2288 bytes in thread 0010 eip 000000007bc41179 esp 0000000000130d20 stack 0x130000-0x131000-0x230000

As no profile can be created there is also no further CrashLog or memdump.
Title: Re: (DB?) plugins not loaded via Wine
Post by: TheQL on 14 04 2020, 13:30:29
Ok, so apparently, when adding or removing or changing the dlls you need to run winecfg again.

There seem to be some other mismatches in my setup. Winebottler allows me to select either Win7 or 7-64 - running winecfg on my commandline only offers Windows 7 as an option.

I have now copied the dlls and ran winecfg when using just "Win 7" in winebottler, this yields yet another result:
Code: [Select]
~/.wines/miranda/drive_c/Miranda_NG # ./Miranda.sh
0010:fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0)
0010:fixme:msvcrt:_configure_wide_argv (1) stub
0010:fixme:msvcrt:_initialize_wide_environment stub
0010:err:module:import_dll Loading library Secur32.dll (which is needed by L"C:\\Miranda_NG\\libs\\mir_app.mir") failed (error c000007b).
0012:err:ole:marshal_object couldn't get IPSFactory buffer for interface {00000131-0000-0000-c000-000000000046}
0012:err:ole:marshal_object couldn't get IPSFactory buffer for interface {6d5140c1-7436-11ce-8034-00aa006009fa}
0012:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hres=0x80004002
0012:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, 80004002
0012:err:ole:get_local_server_stream Failed: 80004002

On top of that a Window appears stating "mir_app.mir cannot be loaded".
Title: Re: (DB?) plugins not loaded via Wine
Post by: TheQL on 20 04 2020, 08:16:44
So this has lost a little drive. I can see it is not totally relevant, but if you improve your sqlite plugin and/or enable the mdbx for Wine maybe update your installation procedures. Also I actually like Winebottler, but as it's not standard I can't expect you to include that in your documentation. Thanks for your help!
Title: Re: (DB?) plugins not loaded via Wine
Post by: dartraiden on 20 04 2020, 17:24:06
We have plans to fix dbx_mdbx, but we don’t have time yet...

I will completely rewrite the instructions on the wiki, I will try to deal with Winebottler, although I have never used it
Title: Re: (DB?) plugins not loaded via Wine
Post by: TheQL on 21 04 2020, 09:08:15
Thanks! I guess the Winebottler developer would also assist and add a preset for Miranda.
Title: Re: (DB?) plugins not loaded via Wine
Post by: dartraiden on 09 02 2021, 17:45:11
Just tested on Ubuntu 20.10 + wine-staging + Miranda x64. All OK.
It does not work on wine-stable or wine-devel. Also Miranda x32 does not work too.

It's recommended to use dbx_sqlite database driver, not dbx_mdbx.