I'm not a windows expert and always find it tedious to fix Windows related bugs, but let's see what I can do. Did you use the bitmessagemain.spec file in the packages\pyinstaller directory or did you run it on bitmessagemain.py? The spec file contains a lot of fine tuning and fixes.

The most commonly occuring error I encountered with pyinstaller were missing MSVC libraries. That's one of the reasons why I manually recompile everything against MSVC 2008 or where necessary 2010. Sometimes I use mingw, but at the moment I managed to get everything working with MSVC so I try to avoid mingw because that is just another layer of problems (the C PoW should cleanly build against mingw thought).

Try to manually add the missing msvcr dlls, edit the spec file and just after the translations directory section, add

a.binaries.append(('msvcr120.dll', 'C:\\WINDOWS\\system32\\msvcr120.dll', 'BINARY'))

or whichever versions of msvc you have and wherever they are. Pyinstaller seems to auto-bundle older versions where required.

Which pyinstaller version did you use? I've had problems with some older 2.x versions. With 3.x. all was fine, latest tests I did yesterday were with 3.3.

Did you build the C PoW with MSVC or mingw? Against which version of openssl did you link it? Another problem could be that the correct openssl library version is missing (Qt needs one, and the C PoW may need another, python also needs one but on Windows that one is statically linked with python so it's usually not a problem). This is the reason why I rebuild QT. People with more experience told me that this may not be necessary, but I haven't been able to figure out how to fix it without rebuilding. Just make sure to include a compatible version. The official QT binary is linked against 0.9.8something, and 1.1.x API isn't fully backwards compatible (1.0.2 should be). So maybe uninstall openssl 1.1.x and do the builds again? The C PoW will link against 1.1.x and is backwards compatible up to 0.9.8b I believe, so maybe you linked the C PoW against 1.1.0 and didn't bundle the 1.1.0 libraries. If that's the problem, rebuilding it with 1.0.2 and bundling the 1.0.2 libraries (libeay32.dll) should solve the issue.

Also, you may have to manually rename the C PoW DLL, it should be bitmsghash32.dll for 32bit python, and bitmsghash64.dll for 64bit python. The scripts don't do that automatically. The deciding factor here isn't whether your windows installation is 32 or 64 bit, but your python installation. The safest way to detect this is to run a python instance and type

import python
ctypes.sizeof(ctypes.c_voidp)

It will be 4 for 32bit and 8 for 64bit.

Hope that helps

Peter Surda
Bitmessage core developer

> Hello Peter
>
>
> Thanks for your response.
>
> I have attempted to build Bitmessage in a XP VM (latest SP3).
>
>
>
> I am able to run Bitmessage from Python 2.7 interpreter.
>
> I have followed the instructions with Pyinstaller and replicating
> the
> commandline from the wiki, but now I have another issue.
>
>
> When running Bitmessagemain.exe the program exits with an error.
>
> In XP VM, I get the error:
> "C:\bitmessagetest\bitmessagemain.exe is not a valid Win32
> application"
>
> When running the same bitmessagemain.exe in Windows 8.1 X64, I get
> another
> error:
> "Fatal Error!
> Failed to execute script bitmessagemain"
>
>
>
> In Windows 8.1 X64 Under Roaming, I can see a folderPyBitmessage.
>
> The program apparently generates keys.dat along with other proper
> Bitmessage
> files before exiting.
>
> I can replicate the behavior by  killing the process, deleting the
> folder
> and restarting Bitmessagemain.exe.
>
> I always get the same error, but debug.log give some clues:
>
>
> ---
> Most probably this dynlib/dll was not found when the application was
> frozen.
> Most probably this dynlib/dll was not found when the application was
> frozen.
> ---
> ---
>
> Strangely, I get farther in Windows 8.1 X64 than in my old XP X86
> VM.