[bt-devel] Status of Windows Builds
Gary Holmlund
gary.holmlund at gmail.com
Fri Oct 9 21:00:03 MST 2009
Greg,
I found out why you and I were having trouble with svg icons on Windows.
The Qt plugins are dynamically linked to the Microsoft libraries
(msvcm90.dll, msvcp90.dll, and msvcr90.dll). A plugin is somewhat like a
application program in that it must dynamically load its own copies of
any dll files that it needs. The plugins were not finding the dll files.
A quick workaround for this is to copy those 3 files into the
plugins/imageformats directory and also copy the
Microsoft.VC90.CRT.manifest there also. But, first you must find the
right versions of these files. This is the subject of the rest of this
email. I also had to set the QT_PLUGIN_PATH to c:\Program
Files\BibleTime\bin\plugins before running BibleTime. We may be able to
fix this with a addLibraryPath() that we talked about.
Look in c:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_*
I have 3 such directories:
x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_d08d0375
x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_6f74963e
x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.4148_x-ww_d495ac4e
Each of these contain the 3 dll files mentioned above. When programs
load they have a "manifest" that specifies which version of the CRT
libraries are used. This manifest can either be embeded inside of the
*.exe file or separately as a *.manifest file. They can also be embeded
inside of dll files. If a dll has an embeded manifest that specifies the
CRT file version, the program manifest cannot be different that this
otherwise multiple versions of the dll files are loaded and cause crashes.
Qt uses embeded manifests in its dll files. This determines which
version of the dll files we must use. You can find this version number
by opening a Qt dll in notepad and searching for "manifest" in the
binary. Look for a line like this:
<assemblyIdentity type="win32" name="Microsoft.VC90.CRT"
version="9.0.21022.8" processorArchitecture="x86"
publicKeyToken="1fc8b3b9a1e18e3b">
You are looking for the numbers "9.0.21022.8". Notice this matches a
directory in Windows/WinSxS above. In that directory are the dll files
we want to use.
Now is where the fun begins. The CMake visual studio build is setup to
embed the manifest into the bibletime.exe and it will probably have a
different version number than the Qt dll files. In fact there is a
defect in Visual Studio that causes the version embeded to be the the
second to latest version rather than the latest. I seem to have lost the
link to this defect, but it was on the Microsoft web site.
I switched the bibletime project to use an external manifest so I can
edit the manifest directly. Change the numbers in the
bibletime.exe.manifest file to match the Qt version. This manifest is
built into c:\bt\bibletime-build/Release (or Debug). It is not
automatically copied to the c:\bt\install\bin dir and should be.
So, the final c:\bt\install\bin dir will have to have 4 files manually
copied into it. bibletime.exe.manifest (with edited version number) and
the correct version of the 3 CRT dll files. You can right click on these
files and select Properties to verify their version. You will also have
to edit the Microsoft.VC90.CRT.manifest file and change the numbers in
it to match the Qt version.
Now the c:\bt\install\bin directory has the correct files, but the
PACKAGE project that builds the installer does not get all of its files
from this directory. After I install BibleTime using the installer, I
had to manually copy the 5 files above into the c:\Program
Files\BibleTime\bin dir. I also have to copy the same files (except
bibletime.exe.manifest) into the plugins\imageformats directory.
I also had to set SWORD_PATH to c:\Documents and Settings\<login
name>\.sword and set QT_PLUGIN_PATH to c:\Program
Files\BibleTime\bin\plugins. I had to manually make the .sword directory
using a Command Prompt window.
Humm, maybe we should consider building Qt and BibleTime statically
linked to the other libraries???
With these several workarounds after installing, I then had a running
BibleTime on my wife's computer that did not have development tools on
it. The svg icons worked. I did see a problem with the information in
the MAG window not always showing correctly.
Gary
PS. If you got this far through the email and want to try to install on
windows and are willing to do the manual fixes after installing, read on.
1. Download and install
http://sourcearchives.com/downloads/bibletime-2.3.0-win32.exe
2. Download and unzip http://sourcearchives.com/downloads/fivefiles.zip
3. Copy the five files into c:\Program Files\BibleTime\bin
4. The extra files for c:\Program
Files\BibleTime\bin\plugins\imageformats\ are already there. Don't worry
about them.
5. Using the control panel set QT_PLUGIN_PATH to c:\Program
Files\BibleTime\bin\plugins
6. Using the control panel set SWORD_PATH to c:\Documents and
Settings\<login name>\.sword
7. Make the .sword directory using the Command Prompt window
8. Try BibleTime from the menus
More information about the bt-devel
mailing list