Skip to content
This repository was archived by the owner on Oct 19, 2021. It is now read-only.

Commit c635c09

Browse files
committed
Fix windows build
1 parent a6710a8 commit c635c09

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/Hearthstone.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ QString Hearthstone::DetectRegion() const {
324324

325325
#ifdef Q_OS_WIN
326326
// http://stackoverflow.com/questions/940707/how-do-i-programatically-get-the-version-of-a-dll-or-exe-file
327-
int Win32ExtractBuildFromPE( const char *szVersionFile ) {
327+
int Win32ExtractBuildFromPE( const wchar_t *szVersionFile ) {
328328
int build = 0;
329329
DWORD verHandle = NULL;
330330
UINT size = 0;
@@ -335,7 +335,7 @@ int Win32ExtractBuildFromPE( const char *szVersionFile ) {
335335
LPSTR verData = new char[ verSize ];
336336

337337
if( GetFileVersionInfo( szVersionFile, verHandle, verSize, verData) ) {
338-
if( VerQueryValue( verData, "\\", (VOID FAR* FAR*)&lpBuffer, &size ) ) {
338+
if( VerQueryValue( verData, L"\\", (VOID FAR* FAR*)&lpBuffer, &size ) ) {
339339
if( size ) {
340340
VS_FIXEDFILEINFO *verInfo = (VS_FIXEDFILEINFO *)lpBuffer;
341341

@@ -371,7 +371,7 @@ int Hearthstone::DetectBuild() const {
371371
}
372372
#elif defined Q_OS_WIN
373373
buildPath = QString( "%1/Hearthstone.exe" ).arg( hsPath );
374-
build = Win32ExtractBuildFromPE( buildPath.c_str() );
374+
build = Win32ExtractBuildFromPE( buildPath.toStdWString().c_str() );
375375
#endif
376376
}
377377
return build;

src/HearthstoneCardDB.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ void HearthstoneCardDB::CardsJsonReply() {
8282

8383
DBG( "Downloaded cards.json %d bytes", jsonData.size() );
8484

85+
QString dirPath = QFileInfo( CardsJsonLocalPath() ).absolutePath();
86+
if( !QFile::exists( dirPath ) ) {
87+
QDir dir;
88+
dir.mkpath( dirPath );
89+
}
90+
8591
QFile file( CardsJsonLocalPath() );
8692
file.open( QIODevice::WriteOnly );
8793
file.write( jsonData );

track-o-bot.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ win32 {
110110

111111
DEFINES += _CRT_SECURE_NO_WARNINGS
112112

113-
LIBS += user32.lib Gdi32.lib shell32.lib
113+
LIBS += user32.lib Gdi32.lib shell32.lib version.lib
114114
LIBS += -L../WinSparkle/Release
115115

116116
QMAKE_PRE_LINK = ruby dist/win/patch_rc.rb

0 commit comments

Comments
 (0)