diff --git a/src/Hearthstone.cpp b/src/Hearthstone.cpp index da9fa76..3a8999d 100644 --- a/src/Hearthstone.cpp +++ b/src/Hearthstone.cpp @@ -324,7 +324,7 @@ QString Hearthstone::DetectRegion() const { #ifdef Q_OS_WIN // http://stackoverflow.com/questions/940707/how-do-i-programatically-get-the-version-of-a-dll-or-exe-file -int Win32ExtractBuildFromPE( const char *szVersionFile ) { +int Win32ExtractBuildFromPE( const wchar_t *szVersionFile ) { int build = 0; DWORD verHandle = NULL; UINT size = 0; @@ -335,7 +335,7 @@ int Win32ExtractBuildFromPE( const char *szVersionFile ) { LPSTR verData = new char[ verSize ]; if( GetFileVersionInfo( szVersionFile, verHandle, verSize, verData) ) { - if( VerQueryValue( verData, "\\", (VOID FAR* FAR*)&lpBuffer, &size ) ) { + if( VerQueryValue( verData, L"\\", (VOID FAR* FAR*)&lpBuffer, &size ) ) { if( size ) { VS_FIXEDFILEINFO *verInfo = (VS_FIXEDFILEINFO *)lpBuffer; @@ -371,7 +371,7 @@ int Hearthstone::DetectBuild() const { } #elif defined Q_OS_WIN buildPath = QString( "%1/Hearthstone.exe" ).arg( hsPath ); - build = Win32ExtractBuildFromPE( buildPath.c_str() ); + build = Win32ExtractBuildFromPE( buildPath.toStdWString().c_str() ); #endif } return build; diff --git a/src/HearthstoneCardDB.cpp b/src/HearthstoneCardDB.cpp index f1954f9..745ee47 100644 --- a/src/HearthstoneCardDB.cpp +++ b/src/HearthstoneCardDB.cpp @@ -82,6 +82,12 @@ void HearthstoneCardDB::CardsJsonReply() { DBG( "Downloaded cards.json %d bytes", jsonData.size() ); + QString dirPath = QFileInfo( CardsJsonLocalPath() ).absolutePath(); + if( !QFile::exists( dirPath ) ) { + QDir dir; + dir.mkpath( dirPath ); + } + QFile file( CardsJsonLocalPath() ); file.open( QIODevice::WriteOnly ); file.write( jsonData ); diff --git a/track-o-bot.pro b/track-o-bot.pro index 680aa16..3307d5b 100644 --- a/track-o-bot.pro +++ b/track-o-bot.pro @@ -110,7 +110,7 @@ win32 { DEFINES += _CRT_SECURE_NO_WARNINGS - LIBS += user32.lib Gdi32.lib shell32.lib + LIBS += user32.lib Gdi32.lib shell32.lib version.lib LIBS += -L../WinSparkle/Release QMAKE_PRE_LINK = ruby dist/win/patch_rc.rb