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

Commit

Permalink
Fix windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
stevschmid committed Mar 7, 2017
1 parent a6710a8 commit c635c09
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Hearthstone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions src/HearthstoneCardDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion track-o-bot.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c635c09

Please sign in to comment.