summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Rimpo <jeremy.rimpo@servermonkey.com>2018-01-05 23:15:07 -0600
committerGitHub <noreply@github.com>2018-01-05 23:15:07 -0600
commitd2c5ed352dd1c0aac0478ca6d0e8cb121adc1b51 (patch)
tree726989f1fd414bfe4574ac9d0deb3e2785219a04 /src
parentd2f90e6a761da3742789ce25779fe176e2a11aaf (diff)
parent71995f03434be1a7f8b9877089af1bda24e8720b (diff)
Merge pull request #195 from erasmux/dev
Cleaner openssl deployment and add diagnostics for openssl loading
Diffstat (limited to 'src')
-rw-r--r--src/dlls.manifest.qt548
-rw-r--r--src/main.cpp36
2 files changed, 53 insertions, 31 deletions
diff --git a/src/dlls.manifest.qt5 b/src/dlls.manifest.qt5
index 2a3cfeb0..924512d9 100644
--- a/src/dlls.manifest.qt5
+++ b/src/dlls.manifest.qt5
@@ -1,28 +1,26 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
- <assemblyIdentity type="win32" name="dlls" version="1.0.0.0" processorArchitecture="x86"/>
- <file name="7z.dll"/>
- <file name="archive.dll"/>
- <file name="d3dcompiler_47.dll"/>
- <file name="libeay32.dll"/>
- <file name="libEGL.dll"/>
- <file name="libGLESV2.dll"/>
- <file name="liblz4.dll"/>
- <file name="opengl32sw.dll"/>
- <file name="Qt5Core.dll"/>
- <file name="Qt5Gui.dll"/>
- <file name="Qt5Network.dll"/>
- <file name="Qt5Positioning.dll"/>
- <file name="Qt5PrintSupport.dll"/>
- <file name="Qt5Qml.dll"/>
- <file name="Qt5Quick.dll"/>
- <file name="Qt5QuickWidgets.dll"/>
- <file name="Qt5WebChannel.dll"/>
- <file name="Qt5SerialPort.dll"/>
- <file name="Qt5Svg.dll"/>
- <file name="Qt5WebEngineCore.dll"/>
- <file name="Qt5WebEngineWidgets.dll"/>
- <file name="Qt5Widgets.dll"/>
- <file name="Qt5WinExtras.dll"/>
- <file name="ssleay32.dll"/>
+ <assemblyIdentity type="win32" name="dlls" version="1.0.0.0" processorArchitecture="x86"/>
+ <file name="7z.dll"/>
+ <file name="archive.dll"/>
+ <file name="d3dcompiler_47.dll"/>
+ <file name="libEGL.dll"/>
+ <file name="libGLESV2.dll"/>
+ <file name="liblz4.dll"/>
+ <file name="opengl32sw.dll"/>
+ <file name="Qt5Core.dll"/>
+ <file name="Qt5Gui.dll"/>
+ <file name="Qt5Network.dll"/>
+ <file name="Qt5Positioning.dll"/>
+ <file name="Qt5PrintSupport.dll"/>
+ <file name="Qt5Qml.dll"/>
+ <file name="Qt5Quick.dll"/>
+ <file name="Qt5QuickWidgets.dll"/>
+ <file name="Qt5WebChannel.dll"/>
+ <file name="Qt5SerialPort.dll"/>
+ <file name="Qt5Svg.dll"/>
+ <file name="Qt5WebEngineCore.dll"/>
+ <file name="Qt5WebEngineWidgets.dll"/>
+ <file name="Qt5Widgets.dll"/>
+ <file name="Qt5WinExtras.dll"/>
</assembly> \ No newline at end of file
diff --git a/src/main.cpp b/src/main.cpp
index 3e02a4a7..c64e2d8d 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -419,6 +419,29 @@ void setupPath()
::SetEnvironmentVariableW(L"PATH", newPath.c_str());
}
+static void preloadSsl()
+{
+ QString appPath = QDir::toNativeSeparators(QCoreApplication::applicationDirPath());
+ if (GetModuleHandleA("libeay32.dll"))
+ qWarning("libeay32.dll already loaded?!");
+ else {
+ QString libeay32 = appPath + "\\libeay32.dll";
+ if (!QFile::exists(libeay32))
+ qWarning("libeay32.dll not found: %s", qPrintable(libeay32));
+ else if (!LoadLibraryW(libeay32.toStdWString().c_str()))
+ qWarning("failed to load: %s, %d", qPrintable(libeay32), GetLastError());
+ }
+ if (GetModuleHandleA("ssleay32.dll"))
+ qWarning("ssleay32.dll already loaded?!");
+ else {
+ QString ssleay32 = appPath + "\\ssleay32.dll";
+ if (!QFile::exists(ssleay32))
+ qWarning("ssleay32.dll not found: %s", qPrintable(ssleay32));
+ else if (!LoadLibraryW(ssleay32.toStdWString().c_str()))
+ qWarning("failed to load: %s, %d", qPrintable(ssleay32), GetLastError());
+ }
+}
+
static QString getVersionDisplayString()
{
VS_FIXEDFILEINFO version = GetFileVersion(ToWString(QApplication::applicationFilePath()));
@@ -442,6 +465,13 @@ int runApplication(MOApplication &application, SingleInstance &instance,
#endif
);
+#if !defined(QT_NO_SSL)
+ preloadSsl();
+ qDebug("ssl support: %d", QSslSocket::supportsSsl());
+#else
+ qDebug("non-ssl build");
+#endif
+
QString dataPath = application.property("dataPath").toString();
qDebug("data path: %s", qPrintable(dataPath));
@@ -618,12 +648,6 @@ int main(int argc, char *argv[])
setupPath();
- #if !defined(QT_NO_SSL)
- qDebug("ssl support: %d", QSslSocket::supportsSsl());
- #else
- qDebug("non-ssl build");
- #endif
-
bool forcePrimary = false;
if (arguments.contains("update")) {
arguments.removeAll("update");