From 30caebdaa98fbec1e41a6c1d08651f3dd99a961d Mon Sep 17 00:00:00 2001
From: xezon <4720891+xezon@users.noreply.github.com>
Date: Tue, 22 Apr 2025 18:34:00 +0200
Subject: [PATCH 1/2] [GEN][ZH] Unify code of PATCHGET tool (#746)
---
Generals/Code/Tools/PATCHGET/CHATAPI.CPP | 12 +++++++++---
Generals/Code/Tools/PATCHGET/RESOURCE.H | 18 ++++++++++++++++++
GeneralsMD/Code/Tools/PATCHGET/CHATAPI.CPP | 4 ++++
GeneralsMD/Code/Tools/PATCHGET/debug.cpp | 2 +-
4 files changed, 32 insertions(+), 4 deletions(-)
diff --git a/Generals/Code/Tools/PATCHGET/CHATAPI.CPP b/Generals/Code/Tools/PATCHGET/CHATAPI.CPP
index 66b828e26aa..555ef694009 100644
--- a/Generals/Code/Tools/PATCHGET/CHATAPI.CPP
+++ b/Generals/Code/Tools/PATCHGET/CHATAPI.CPP
@@ -52,6 +52,12 @@ enum EVENT_TYPES
NUM_EVENTS // keep last
};
+#if RTS_GENERALS
+#define GAME_NAME "Command and Conquer Generals"
+#elif RTS_ZEROHOUR
+#define GAME_NAME "Command & Conquer"
+#endif
+
HANDLE Events[NUM_EVENTS];
char g_UpdateString[256]; // for the filename
@@ -173,12 +179,12 @@ static void startOnline( void )
if (cantConnect)
{
- MessageBox(NULL, "Can't Connect", "Command and Conquer Generals", MB_OK);
+ MessageBox(NULL, "Can't Connect", GAME_NAME, MB_OK);
exit(0);
}
else if (queuedDownloads.size())
{
- if (MessageBox(NULL, "Patches Available. Download?", "Command and Conquer Generals", MB_YESNO) == IDYES)
+ if (MessageBox(NULL, "Patches Available. Download?", GAME_NAME, MB_YESNO) == IDYES)
{
DEBUG_LOG(("Downloading patches\n"));
while (queuedDownloads.size())
@@ -222,7 +228,7 @@ static void startOnline( void )
}
else
{
- MessageBox(NULL, "No Patches Available", "Command and Conquer Generals", MB_OK);
+ MessageBox(NULL, "No Patches Available", GAME_NAME, MB_OK);
exit(0);
}
}
diff --git a/Generals/Code/Tools/PATCHGET/RESOURCE.H b/Generals/Code/Tools/PATCHGET/RESOURCE.H
index 78438927140..235adafbc75 100644
--- a/Generals/Code/Tools/PATCHGET/RESOURCE.H
+++ b/Generals/Code/Tools/PATCHGET/RESOURCE.H
@@ -1,3 +1,21 @@
+/*
+** Command & Conquer Generals Zero Hour(tm)
+** Copyright 2025 Electronic Arts Inc.
+**
+** This program is free software: you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation, either version 3 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program. If not, see .
+*/
+
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by Script1.rc
diff --git a/GeneralsMD/Code/Tools/PATCHGET/CHATAPI.CPP b/GeneralsMD/Code/Tools/PATCHGET/CHATAPI.CPP
index 46045047d2a..00906bb1e88 100644
--- a/GeneralsMD/Code/Tools/PATCHGET/CHATAPI.CPP
+++ b/GeneralsMD/Code/Tools/PATCHGET/CHATAPI.CPP
@@ -52,7 +52,11 @@ enum EVENT_TYPES
NUM_EVENTS // keep last
};
+#if RTS_GENERALS
+#define GAME_NAME "Command and Conquer Generals"
+#elif RTS_ZEROHOUR
#define GAME_NAME "Command & Conquer"
+#endif
HANDLE Events[NUM_EVENTS];
diff --git a/GeneralsMD/Code/Tools/PATCHGET/debug.cpp b/GeneralsMD/Code/Tools/PATCHGET/debug.cpp
index 48bf7b95664..64a24880ff5 100644
--- a/GeneralsMD/Code/Tools/PATCHGET/debug.cpp
+++ b/GeneralsMD/Code/Tools/PATCHGET/debug.cpp
@@ -72,7 +72,7 @@ void DebugLog(const char *fmt, ...)
{
va_list va;
va_start( va, fmt );
- _vsnprintf(theBuffer, LARGE_BUFFER, fmt, va );
+ vsnprintf(theBuffer, LARGE_BUFFER, fmt, va );
theBuffer[LARGE_BUFFER-1] = 0;
va_end( va );
From 6acc876a4a03a4eff8a93dc9ff4cc07c442765e5 Mon Sep 17 00:00:00 2001
From: xezon <4720891+xezon@users.noreply.github.com>
Date: Tue, 22 Apr 2025 18:42:52 +0200
Subject: [PATCH 2/2] [CORE] Move PATCHGET tool files to Core (#746)
---
Core/Tools/CMakeLists.txt | 1 +
.../Code => Core}/Tools/PATCHGET/CHATAPI.CPP | 0
.../Code => Core}/Tools/PATCHGET/CHATAPI.H | 0
Core/Tools/PATCHGET/CMakeLists.txt | 39 +
.../Code => Core}/Tools/PATCHGET/COMINIT.CPP | 0
.../Code => Core}/Tools/PATCHGET/COMINIT.H | 0
.../Tools/PATCHGET/DownloadManager.cpp | 0
.../Tools/PATCHGET/DownloadManager.h | 0
.../Code => Core}/Tools/PATCHGET/Generals.ico | Bin
.../Tools/PATCHGET/GeneralsEnglish.bmp | Bin
.../Tools/PATCHGET/GeneralsFrench.bmp | Bin
.../Tools/PATCHGET/GeneralsGerman.bmp | Bin
.../Code => Core}/Tools/PATCHGET/PROCESS.CPP | 0
.../Code => Core}/Tools/PATCHGET/PROCESS.H | 0
.../Code => Core}/Tools/PATCHGET/RESOURCE.H | 0
.../Code => Core}/Tools/PATCHGET/Registry.h | 0
.../Code => Core}/Tools/PATCHGET/SCRIPT1.RC | 0
.../Code => Core}/Tools/PATCHGET/WINBLOWS.CPP | 0
.../Code => Core}/Tools/PATCHGET/WINBLOWS.H | 0
.../Code => Core}/Tools/PATCHGET/WSTYPES.H | 0
.../Code => Core}/Tools/PATCHGET/debug.cpp | 0
.../Code => Core}/Tools/PATCHGET/debug.h | 0
.../Code => Core}/Tools/PATCHGET/registry.cpp | 0
Generals/Code/Tools/PATCHGET/CHATAPI.CPP | 1807 -----------------
Generals/Code/Tools/PATCHGET/CHATAPI.H | 50 -
Generals/Code/Tools/PATCHGET/CMakeLists.txt | 36 +-
Generals/Code/Tools/PATCHGET/COMINIT.CPP | 50 -
Generals/Code/Tools/PATCHGET/COMINIT.H | 39 -
.../Code/Tools/PATCHGET/DownloadManager.cpp | 215 --
.../Code/Tools/PATCHGET/DownloadManager.h | 100 -
Generals/Code/Tools/PATCHGET/PROCESS.CPP | 106 -
Generals/Code/Tools/PATCHGET/PROCESS.H | 46 -
Generals/Code/Tools/PATCHGET/Registry.h | 55 -
Generals/Code/Tools/PATCHGET/WINBLOWS.CPP | 197 --
Generals/Code/Tools/PATCHGET/WINBLOWS.H | 37 -
Generals/Code/Tools/PATCHGET/WSTYPES.H | 74 -
Generals/Code/Tools/PATCHGET/debug.cpp | 118 --
Generals/Code/Tools/PATCHGET/debug.h | 76 -
Generals/Code/Tools/PATCHGET/registry.cpp | 143 --
GeneralsMD/Code/Tools/PATCHGET/CMakeLists.txt | 36 +-
GeneralsMD/Code/Tools/PATCHGET/Generals.ico | Bin 21630 -> 0 bytes
.../Code/Tools/PATCHGET/GeneralsEnglish.bmp | Bin 58 -> 0 bytes
.../Code/Tools/PATCHGET/GeneralsFrench.bmp | Bin 58 -> 0 bytes
.../Code/Tools/PATCHGET/GeneralsGerman.bmp | Bin 58 -> 0 bytes
GeneralsMD/Code/Tools/PATCHGET/RESOURCE.H | 79 -
GeneralsMD/Code/Tools/PATCHGET/SCRIPT1.RC | 669 ------
46 files changed, 44 insertions(+), 3929 deletions(-)
rename {GeneralsMD/Code => Core}/Tools/PATCHGET/CHATAPI.CPP (100%)
rename {GeneralsMD/Code => Core}/Tools/PATCHGET/CHATAPI.H (100%)
create mode 100644 Core/Tools/PATCHGET/CMakeLists.txt
rename {GeneralsMD/Code => Core}/Tools/PATCHGET/COMINIT.CPP (100%)
rename {GeneralsMD/Code => Core}/Tools/PATCHGET/COMINIT.H (100%)
rename {GeneralsMD/Code => Core}/Tools/PATCHGET/DownloadManager.cpp (100%)
rename {GeneralsMD/Code => Core}/Tools/PATCHGET/DownloadManager.h (100%)
rename {Generals/Code => Core}/Tools/PATCHGET/Generals.ico (100%)
rename {Generals/Code => Core}/Tools/PATCHGET/GeneralsEnglish.bmp (100%)
rename {Generals/Code => Core}/Tools/PATCHGET/GeneralsFrench.bmp (100%)
rename {Generals/Code => Core}/Tools/PATCHGET/GeneralsGerman.bmp (100%)
rename {GeneralsMD/Code => Core}/Tools/PATCHGET/PROCESS.CPP (100%)
rename {GeneralsMD/Code => Core}/Tools/PATCHGET/PROCESS.H (100%)
rename {Generals/Code => Core}/Tools/PATCHGET/RESOURCE.H (100%)
rename {GeneralsMD/Code => Core}/Tools/PATCHGET/Registry.h (100%)
rename {Generals/Code => Core}/Tools/PATCHGET/SCRIPT1.RC (100%)
rename {GeneralsMD/Code => Core}/Tools/PATCHGET/WINBLOWS.CPP (100%)
rename {GeneralsMD/Code => Core}/Tools/PATCHGET/WINBLOWS.H (100%)
rename {GeneralsMD/Code => Core}/Tools/PATCHGET/WSTYPES.H (100%)
rename {GeneralsMD/Code => Core}/Tools/PATCHGET/debug.cpp (100%)
rename {GeneralsMD/Code => Core}/Tools/PATCHGET/debug.h (100%)
rename {GeneralsMD/Code => Core}/Tools/PATCHGET/registry.cpp (100%)
delete mode 100644 Generals/Code/Tools/PATCHGET/CHATAPI.CPP
delete mode 100644 Generals/Code/Tools/PATCHGET/CHATAPI.H
delete mode 100644 Generals/Code/Tools/PATCHGET/COMINIT.CPP
delete mode 100644 Generals/Code/Tools/PATCHGET/COMINIT.H
delete mode 100644 Generals/Code/Tools/PATCHGET/DownloadManager.cpp
delete mode 100644 Generals/Code/Tools/PATCHGET/DownloadManager.h
delete mode 100644 Generals/Code/Tools/PATCHGET/PROCESS.CPP
delete mode 100644 Generals/Code/Tools/PATCHGET/PROCESS.H
delete mode 100644 Generals/Code/Tools/PATCHGET/Registry.h
delete mode 100644 Generals/Code/Tools/PATCHGET/WINBLOWS.CPP
delete mode 100644 Generals/Code/Tools/PATCHGET/WINBLOWS.H
delete mode 100644 Generals/Code/Tools/PATCHGET/WSTYPES.H
delete mode 100644 Generals/Code/Tools/PATCHGET/debug.cpp
delete mode 100644 Generals/Code/Tools/PATCHGET/debug.h
delete mode 100644 Generals/Code/Tools/PATCHGET/registry.cpp
delete mode 100644 GeneralsMD/Code/Tools/PATCHGET/Generals.ico
delete mode 100644 GeneralsMD/Code/Tools/PATCHGET/GeneralsEnglish.bmp
delete mode 100644 GeneralsMD/Code/Tools/PATCHGET/GeneralsFrench.bmp
delete mode 100644 GeneralsMD/Code/Tools/PATCHGET/GeneralsGerman.bmp
delete mode 100644 GeneralsMD/Code/Tools/PATCHGET/RESOURCE.H
delete mode 100644 GeneralsMD/Code/Tools/PATCHGET/SCRIPT1.RC
diff --git a/Core/Tools/CMakeLists.txt b/Core/Tools/CMakeLists.txt
index e9be27b8af1..8210a9bcb3b 100644
--- a/Core/Tools/CMakeLists.txt
+++ b/Core/Tools/CMakeLists.txt
@@ -30,4 +30,5 @@ endif()
# Add library interfaces here
if(RTS_BUILD_GENERALS_EXTRAS OR RTS_BUILD_ZEROHOUR_EXTRAS)
add_subdirectory(Autorun)
+ add_subdirectory(PATCHGET)
endif()
diff --git a/GeneralsMD/Code/Tools/PATCHGET/CHATAPI.CPP b/Core/Tools/PATCHGET/CHATAPI.CPP
similarity index 100%
rename from GeneralsMD/Code/Tools/PATCHGET/CHATAPI.CPP
rename to Core/Tools/PATCHGET/CHATAPI.CPP
diff --git a/GeneralsMD/Code/Tools/PATCHGET/CHATAPI.H b/Core/Tools/PATCHGET/CHATAPI.H
similarity index 100%
rename from GeneralsMD/Code/Tools/PATCHGET/CHATAPI.H
rename to Core/Tools/PATCHGET/CHATAPI.H
diff --git a/Core/Tools/PATCHGET/CMakeLists.txt b/Core/Tools/PATCHGET/CMakeLists.txt
new file mode 100644
index 00000000000..dcf86063941
--- /dev/null
+++ b/Core/Tools/PATCHGET/CMakeLists.txt
@@ -0,0 +1,39 @@
+set(PATCHGET_SRC
+ "CHATAPI.CPP"
+ "CHATAPI.H"
+ "COMINIT.CPP"
+ "COMINIT.H"
+ "debug.cpp"
+ "debug.h"
+ "DownloadManager.cpp"
+ "DownloadManager.h"
+ "PROCESS.CPP"
+ "PROCESS.H"
+ "registry.cpp"
+ "Registry.h"
+ "RESOURCE.H"
+ "WINBLOWS.CPP"
+ "WINBLOWS.H"
+ "WSTYPES.H"
+)
+
+add_library(corei_patchgrabber INTERFACE)
+
+target_sources(corei_patchgrabber INTERFACE ${PATCHGET_SRC})
+
+target_link_libraries(corei_patchgrabber INTERFACE
+ comctl32
+ dbghelplib
+ gamespy::gamespy
+ imm32
+ vfw32
+ winmm
+)
+
+target_compile_definitions(corei_patchgrabber INTERFACE
+ $<$:DEBUG_CRASHING>
+)
+
+if(WIN32 OR "${CMAKE_SYSTEM}" MATCHES "Windows")
+ target_sources(corei_patchgrabber INTERFACE SCRIPT1.RC)
+endif()
diff --git a/GeneralsMD/Code/Tools/PATCHGET/COMINIT.CPP b/Core/Tools/PATCHGET/COMINIT.CPP
similarity index 100%
rename from GeneralsMD/Code/Tools/PATCHGET/COMINIT.CPP
rename to Core/Tools/PATCHGET/COMINIT.CPP
diff --git a/GeneralsMD/Code/Tools/PATCHGET/COMINIT.H b/Core/Tools/PATCHGET/COMINIT.H
similarity index 100%
rename from GeneralsMD/Code/Tools/PATCHGET/COMINIT.H
rename to Core/Tools/PATCHGET/COMINIT.H
diff --git a/GeneralsMD/Code/Tools/PATCHGET/DownloadManager.cpp b/Core/Tools/PATCHGET/DownloadManager.cpp
similarity index 100%
rename from GeneralsMD/Code/Tools/PATCHGET/DownloadManager.cpp
rename to Core/Tools/PATCHGET/DownloadManager.cpp
diff --git a/GeneralsMD/Code/Tools/PATCHGET/DownloadManager.h b/Core/Tools/PATCHGET/DownloadManager.h
similarity index 100%
rename from GeneralsMD/Code/Tools/PATCHGET/DownloadManager.h
rename to Core/Tools/PATCHGET/DownloadManager.h
diff --git a/Generals/Code/Tools/PATCHGET/Generals.ico b/Core/Tools/PATCHGET/Generals.ico
similarity index 100%
rename from Generals/Code/Tools/PATCHGET/Generals.ico
rename to Core/Tools/PATCHGET/Generals.ico
diff --git a/Generals/Code/Tools/PATCHGET/GeneralsEnglish.bmp b/Core/Tools/PATCHGET/GeneralsEnglish.bmp
similarity index 100%
rename from Generals/Code/Tools/PATCHGET/GeneralsEnglish.bmp
rename to Core/Tools/PATCHGET/GeneralsEnglish.bmp
diff --git a/Generals/Code/Tools/PATCHGET/GeneralsFrench.bmp b/Core/Tools/PATCHGET/GeneralsFrench.bmp
similarity index 100%
rename from Generals/Code/Tools/PATCHGET/GeneralsFrench.bmp
rename to Core/Tools/PATCHGET/GeneralsFrench.bmp
diff --git a/Generals/Code/Tools/PATCHGET/GeneralsGerman.bmp b/Core/Tools/PATCHGET/GeneralsGerman.bmp
similarity index 100%
rename from Generals/Code/Tools/PATCHGET/GeneralsGerman.bmp
rename to Core/Tools/PATCHGET/GeneralsGerman.bmp
diff --git a/GeneralsMD/Code/Tools/PATCHGET/PROCESS.CPP b/Core/Tools/PATCHGET/PROCESS.CPP
similarity index 100%
rename from GeneralsMD/Code/Tools/PATCHGET/PROCESS.CPP
rename to Core/Tools/PATCHGET/PROCESS.CPP
diff --git a/GeneralsMD/Code/Tools/PATCHGET/PROCESS.H b/Core/Tools/PATCHGET/PROCESS.H
similarity index 100%
rename from GeneralsMD/Code/Tools/PATCHGET/PROCESS.H
rename to Core/Tools/PATCHGET/PROCESS.H
diff --git a/Generals/Code/Tools/PATCHGET/RESOURCE.H b/Core/Tools/PATCHGET/RESOURCE.H
similarity index 100%
rename from Generals/Code/Tools/PATCHGET/RESOURCE.H
rename to Core/Tools/PATCHGET/RESOURCE.H
diff --git a/GeneralsMD/Code/Tools/PATCHGET/Registry.h b/Core/Tools/PATCHGET/Registry.h
similarity index 100%
rename from GeneralsMD/Code/Tools/PATCHGET/Registry.h
rename to Core/Tools/PATCHGET/Registry.h
diff --git a/Generals/Code/Tools/PATCHGET/SCRIPT1.RC b/Core/Tools/PATCHGET/SCRIPT1.RC
similarity index 100%
rename from Generals/Code/Tools/PATCHGET/SCRIPT1.RC
rename to Core/Tools/PATCHGET/SCRIPT1.RC
diff --git a/GeneralsMD/Code/Tools/PATCHGET/WINBLOWS.CPP b/Core/Tools/PATCHGET/WINBLOWS.CPP
similarity index 100%
rename from GeneralsMD/Code/Tools/PATCHGET/WINBLOWS.CPP
rename to Core/Tools/PATCHGET/WINBLOWS.CPP
diff --git a/GeneralsMD/Code/Tools/PATCHGET/WINBLOWS.H b/Core/Tools/PATCHGET/WINBLOWS.H
similarity index 100%
rename from GeneralsMD/Code/Tools/PATCHGET/WINBLOWS.H
rename to Core/Tools/PATCHGET/WINBLOWS.H
diff --git a/GeneralsMD/Code/Tools/PATCHGET/WSTYPES.H b/Core/Tools/PATCHGET/WSTYPES.H
similarity index 100%
rename from GeneralsMD/Code/Tools/PATCHGET/WSTYPES.H
rename to Core/Tools/PATCHGET/WSTYPES.H
diff --git a/GeneralsMD/Code/Tools/PATCHGET/debug.cpp b/Core/Tools/PATCHGET/debug.cpp
similarity index 100%
rename from GeneralsMD/Code/Tools/PATCHGET/debug.cpp
rename to Core/Tools/PATCHGET/debug.cpp
diff --git a/GeneralsMD/Code/Tools/PATCHGET/debug.h b/Core/Tools/PATCHGET/debug.h
similarity index 100%
rename from GeneralsMD/Code/Tools/PATCHGET/debug.h
rename to Core/Tools/PATCHGET/debug.h
diff --git a/GeneralsMD/Code/Tools/PATCHGET/registry.cpp b/Core/Tools/PATCHGET/registry.cpp
similarity index 100%
rename from GeneralsMD/Code/Tools/PATCHGET/registry.cpp
rename to Core/Tools/PATCHGET/registry.cpp
diff --git a/Generals/Code/Tools/PATCHGET/CHATAPI.CPP b/Generals/Code/Tools/PATCHGET/CHATAPI.CPP
deleted file mode 100644
index 555ef694009..00000000000
--- a/Generals/Code/Tools/PATCHGET/CHATAPI.CPP
+++ /dev/null
@@ -1,1807 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-//
-// This module takes care of all the Chat API stuff
-//
-
-#include
-#include "gamespy/ghttp/ghttp.h"
-#include "DownloadManager.h"
-
-#include "CHATAPI.H"
-
-//#include "api/wolapi_i.c" // This should only be in one .cpp file
-#include
-#include
-#include
-#include
-#if defined(_MSC_VER) && _MSC_VER < 1300
-#include
-#endif
-#include "RESOURCE.H"
-#include "WINBLOWS.H"
-#include
-#include "process.h"
-#include "WWDownload/Registry.h"
-#include "WWDownload/urlBuilder.h"
-#include "debug.h"
-
-namespace patchget
-{
-
-enum EVENT_TYPES
-{
- NOUPDATE_EVENT=0, // don't need to update
- ABORT_EVENT,
- NUM_EVENTS // keep last
-};
-
-#if RTS_GENERALS
-#define GAME_NAME "Command and Conquer Generals"
-#elif RTS_ZEROHOUR
-#define GAME_NAME "Command & Conquer"
-#endif
-
-HANDLE Events[NUM_EVENTS];
-
-char g_UpdateString[256]; // for the filename
-char g_DLTimeRem[80];
-char g_DLBytesLeft[80];
-char g_DLBPS[80];
-
-int g_Finished=0;
-
-
-HWND g_DownloadWindow;
-HWND g_ContactWindow;
-HWND g_PrimaryWindow;
-
-static bool checkingForPatch = false;
-static int checksLeft = 0;
-static bool cantConnect = false;
-static std::list queuedDownloads;
-
-BOOL CALLBACK downloadDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam,
- LPARAM lParam );
-
-///////////////////////////////////////////////////////////////////////////////////////
-
-static void startOnline( void );
-
-///////////////////////////////////////////////////////////////////////////////////////
-
-QueuedDownload TheDownload;
-
-class DownloadManagerMunkee : public DownloadManager
-{
-public:
- DownloadManagerMunkee() { }
- virtual HRESULT OnError( int error );
- virtual HRESULT OnEnd();
- virtual HRESULT OnProgressUpdate( int bytesread, int totalsize, int timetaken, int timeleft );
- virtual HRESULT OnStatusUpdate( int status );
- virtual HRESULT downloadFile( std::string server, std::string username, std::string password, std::string file, std::string localfile, std::string regkey, bool tryResume );
-};
-
-///////////////////////////////////////////////////////////////////////////////////////
-
-HRESULT DownloadManagerMunkee::downloadFile( std::string server, std::string username, std::string password, std::string file, std::string localfile, std::string regkey, bool tryResume )
-{
- /*
- if (staticTextFile)
- {
- UnicodeString fileString;
- fileString.translate(file);
- GadgetStaticTextSetText(staticTextFile, fileString);
- }
- */
- return DownloadManager::downloadFile( server, username, password, file, localfile, regkey, tryResume );
-}
-HRESULT DownloadManagerMunkee::OnError( int error )
-{
- HRESULT ret = DownloadManager::OnError( error );
- g_Finished = -1;
- return ret;
-}
-HRESULT DownloadManagerMunkee::OnEnd()
-{
- HRESULT ret = DownloadManager::OnEnd();
- g_Finished = 1;
- return ret;
-}
-HRESULT DownloadManagerMunkee::OnProgressUpdate( int bytesread, int totalsize, int timetaken, int timeleft )
-{
- HRESULT ret = DownloadManager::OnProgressUpdate( bytesread, totalsize, timetaken, timeleft );
-
- SendDlgItemMessage( g_DownloadWindow, IDC_PROGRESS, PBM_SETPOS, (WPARAM)(bytesread * 100) / totalsize, 0 );
- char temp[256];
-
- if( timeleft > 0 )
- {
- //DBGMSG("Bytes read: "<=0 && i start)
- {
- int len = end - start;
- char* tmp = new char[len+1];
- memcpy(tmp, start, len);
- tmp[len] = 0;
-
- tok = tmp;
- delete[] tmp;
-
- base = end;
-
- return true;
- }
- else
- {
- base = tok = "";
- return false;
- }
-}
-
-///////////////////////////////////////////////////////////////////////////////////////
-
-static void queuePatch(bool mandatory, std::string downloadURL)
-{
- // downloadURL is of the form "ftp://ftp.ea.com:user@pass/pub/munkee/bananna.rtp"
- QueuedDownload q;
- bool success = true;
-
- std::string connectionType;
- success = success && nextToken(downloadURL, connectionType, ":");
-
- std::string server;
- success = success && nextToken(downloadURL, server, ":/");
-
- std::string user;
- success = success && nextToken(downloadURL, user, ":@");
-
- std::string pass;
- success = success && nextToken(downloadURL, pass, "@/");
-
- std::string filePath;
- success = success && nextToken(downloadURL, filePath, "");
-
- if (!success && !user.empty())
- {
- // no user/pass combo - move the file into it's proper place
- filePath = user;
- user = ""; // LFeenanEA - Credentials removed as per Security requirements
- pass = "";
- success = true;
- }
-
- std::string fileStr = filePath;
- unsigned int slashPos = filePath.find_last_of('/');
- std::string fileDir = "patches\\";
- std::string fileName = "";
- if (slashPos == filePath.npos)
- {
- fileName = filePath;
- }
- else
- {
- fileName = filePath.substr(slashPos+1);
- }
- fileDir.append(fileName);
-
- DEBUG_LOG(("download URL split: %d [%s] [%s] [%s] [%s] [%s] [%s] [%s]\n",
- success, connectionType.c_str(), server.c_str(), user.c_str(), pass.c_str(),
- filePath.c_str(), fileName.c_str(), fileDir.c_str()));
-
- if (!success)
- return;
-
- q.file = filePath;
- q.localFile = fileDir;
- q.password = pass;
- q.regKey = "";
- q.server = server;
- q.tryResume = true;
- q.userName = user;
-
- std::list::iterator it = queuedDownloads.begin();
- while (it != queuedDownloads.end())
- {
- if (it->localFile == q.localFile)
- return; // don't add it if it exists already (because we can check multiple times)
- ++it;
- }
-
- queuedDownloads.push_back(q);
-}
-
-///////////////////////////////////////////////////////////////////////////////////////
-
-static GHTTPBool patchCheckCallback( GHTTPRequest request, GHTTPResult result, char * buffer, GHTTPByteCount bufferLen, void * param )
-{
- --checksLeft;
- DEBUG_ASSERTCRASH(checksLeft>=0, ("Too many callbacks"));
-
- DEBUG_LOG(("Result=%d, buffer=[%s], len=%d\n", result, buffer, bufferLen));
- if (result != GHTTPSuccess)
- {
- cantConnect = true;
- if (!checksLeft)
- {
- startOnline();
- }
- return GHTTPTrue;
- }
-
- std::string message = buffer;
- std::string line;
- while (nextToken(message, line, "\r\n"))
- {
- std::string type, req, url;
- bool ok = true;
- ok = ok && nextToken(line, type, " ");
- ok = ok && nextToken(line, req, " ");
- ok = ok && nextToken(line, url, " ");
- if (ok && type == "patch")
- {
- DEBUG_LOG(("Saw a patch: %d/[%s]\n", atoi(req.c_str()), url.c_str()));
- queuePatch( atoi(req.c_str()), url );
- }
- else if (ok && type == "server")
- {
- }
- }
-
- if (!checksLeft)
- {
- startOnline();
- }
-
- return GHTTPTrue;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////
-
-static void StartPatchCheck( void )
-{
- checkingForPatch = true;
- std::string gameURL, mapURL;
- std::string configURL, motdURL;
-
- FormatURLFromRegistry(gameURL, mapURL, configURL, motdURL);
-
- std::string proxy;
- if (GetStringFromRegistry("", "Proxy", proxy))
- {
- if (!proxy.empty())
- {
- ghttpSetProxy(proxy.c_str());
- }
- }
-
- // check for a patch first
- checksLeft = 2;
- cantConnect = false;
- ghttpGet(gameURL.c_str(), GHTTPFalse, patchCheckCallback, NULL);
- ghttpGet(mapURL.c_str(), GHTTPFalse, patchCheckCallback, NULL);
-
- DEBUG_LOG(("Started looking for patches at '%s' && '%s'\n", gameURL.c_str(), mapURL.c_str()));
-}
-
-///////////////////////////////////////////////////////////////////////////////////////
-
-
-BOOL CALLBACK downloadDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
-{
- // HRESULT res;
-
- int cmd = LOWORD(wParam);
- switch( uMsg )
- {
- case WM_COMMAND:
- if ( cmd == IDC_DLABORT )
- {
-
- char abort[128];
- char abortdload[256];
- LoadString(Global_instance, TXT_ABORT_DOWNLOAD, abortdload, sizeof(abortdload));
- LoadString(Global_instance, TXT_ABORT, abort, sizeof(abort));
-
- if (MessageBox(g_PrimaryWindow,abortdload,abort,MB_YESNO)==IDYES)
- {
- TheDownloadManager->reset();
-
- EndDialog( hwndDlg, g_Finished );
- DestroyWindow(hwndDlg);
- }
- }
- else
- {
- return FALSE;
- }
- break;
-
- case WM_INITDIALOG:
- //SetupDownload();
-
- SendMessage(hwndDlg, WM_SETICON,(WPARAM)ICON_SMALL,
- (LPARAM)LoadIcon(Global_instance, MAKEINTRESOURCE(IDI_ICON1)));
-
- g_DLTimeRem[0]=0;
- g_DLBytesLeft[0]=0;
- g_DLBPS[0]=0;
-
- //SetDlgItemText( hwndDlg, IDC_DOWNLOADTITLE, g_UpdateString);
- //SetWindowText(hwndDlg, g_UpdateString);
-
- SetDlgItemText( hwndDlg, IDC_TIMEREM, g_DLTimeRem);
- SetDlgItemText( hwndDlg, IDC_BYTESLEFT, g_DLBytesLeft);
- // SetDlgItemText( hwndDlg, IDC_BPS, g_DLBPS );
-
- // Work out the full file name
- //char fullpath[_MAX_PATH];
- //char localfile[_MAX_PATH];
- //sprintf( fullpath, "%s/%s", g_Update->patchpath,g_Update->patchfile);
- //sprintf(localfile,"%s\\%s",g_Update->localpath,g_Update->patchfile);
-
- // Create the directory
- //CreateDirectory((char *)g_Update->localpath, NULL );
-
- TheDownloadManager->downloadFile(TheDownload.server, TheDownload.userName, TheDownload.password,
- TheDownload.file, TheDownload.localFile, TheDownload.regKey, TheDownload.tryResume);
- /*
- res=pDownload->DownloadFile((char *)g_Update->server, (char *)g_Update->login, (char *)g_Update->password,
- fullpath, localfile, APP_REG_KEY);
-
- */
- g_DownloadWindow = hwndDlg;
- g_Finished = 0;
- SetTimer( hwndDlg, 1, 200, NULL ); // was 50
-
- break;
-
- case WM_TIMER:
- DEBUG_LOG(("TIMER\n"));
- if( g_Finished == 0 )
- {
- DEBUG_LOG(("Entering PumpMsgs\n"));
- TheDownloadManager->update();
- /*
- pDownload->PumpMessages();
- */
- DEBUG_LOG(("Done with PumpMsgs\n"));
- if (strlen(g_DLTimeRem))
- SetDlgItemText( hwndDlg, IDC_TIMEREM, g_DLTimeRem );
- if (strlen(g_DLBytesLeft))
- SetDlgItemText( hwndDlg, IDC_BYTESLEFT, g_DLBytesLeft );
- //if (strlen(g_DLBPS))
- // SetDlgItemText( hwndDlg, IDC_BPS, g_DLBPS );
- }
- else
- {
- DEBUG_LOG(("TIMER: Finished\n"));
- EndDialog( hwndDlg, g_Finished );
- DestroyWindow( hwndDlg );
- }
- break;
-
- case WM_DESTROY:
- KillTimer( hwndDlg, 1 );
- //ClosedownDownload();
-
- //DBGMSG("WM_DESTROY");
- break;
-
- case WM_SETFONT:
- return TRUE;
-
- default:
- return FALSE;
- }
- return TRUE;
-}
-
-
-
-DWORD dwChatAdvise;
-DWORD dwDownloadAdvise;
-
-//Update *g_Update;
-
-uint32 g_AppVer=-1;
-
-
-BOOL CALLBACK Download_Dialog_Proc( HWND hwndDlg, UINT uMsg, WPARAM wParam,
- LPARAM lParam );
-
-BOOL CALLBACK Simple_Dialog_Proc( HWND hwndDlg, UINT uMsg, WPARAM wParam,
- LPARAM lParam );
-
-HWND CreatePrimaryWin(void);
-
-char const * Fetch_String(int id);
-
-
-//
-// Create a primary window
-//
-HWND CreatePrimaryWin(void)
-{
- HWND hwnd;
- WNDCLASS wc;
- char name[256];
-
- sprintf(name,Fetch_String(TXT_TITLE));
-
- //DBGMSG("CreatePrimary: "< 8))
- {
- // Launch the process
- SHELLEXECUTEINFO info;
- memset(&info,0,sizeof(info));
- info.cbSize=sizeof(info);
- info.fMask=SEE_MASK_NOCLOSEPROCESS;
- info.hwnd=g_PrimaryWindow;
- info.lpVerb=NULL;
- info.lpFile=regapp;
- info.lpParameters=NULL;
- info.lpDirectory=".";
- info.nShow=SW_SHOW;
- ShellExecuteEx(&info);
-
- // Can't wait infinite or the other process will never create its window
- // Only Bill himself knows why this is happening
- while(1) // Wait for completion
- {
- DispatchEvents();
- if (WaitForSingleObject(info.hProcess,500)!=WAIT_TIMEOUT)
- break;
- }
- }
- RegCloseKey(rKey);
- }
- }
- // OK, done with that crap go on to the task at hand now....
-*/
-
-
- // Find the game version
- g_AppVer = -1;
- if (!GetUnsignedIntFromRegistry("", "Version", g_AppVer))
- {
- MessageBox(g_PrimaryWindow,Fetch_String(TXT_INSTALL_PROBLEM),Fetch_String(TXT_ERROR),MB_OK);
- exit(0);
- }
- // OK, have the current game version now
-
- g_PrimaryWindow=CreatePrimaryWin(); // Create the main window
- DispatchEvents(); // process some win messages
-
- // Popup the "contacting" window
- g_ContactWindow=CreateDialog(Global_instance,MAKEINTRESOURCE(IDD_CONNECTING),g_PrimaryWindow,Simple_Dialog_Proc);
- ShowWindow(g_ContactWindow,SW_SHOWNORMAL);
- SetForegroundWindow(g_ContactWindow);
- DispatchEvents(); // process some win messages
-
-
- // Setup the Westwood Online stuff
- Startup_Chat();
-
- Update_If_Required();
-
- Shutdown_Chat();
-
- return(0);
-}
-
-
-typedef struct SRecord {
- int ID; // ID number of the string resource.
- int TimeStamp; // 'Time' that this string was last requested.
- char String[2048]; // Copy of string resource.
-
- SRecord(void) : ID(-1), TimeStamp(-1) {}
-} SRecord;
-
-
-/***********************************************************************************************
- * Fetch_String -- Fetches a string resource. *
- * *
- * Fetches a string resource and returns a pointer to its text. *
- * *
- * INPUT: id -- The ID number of the string resource to fetch. *
- * *
- * OUTPUT: Returns with a pointer to the actual text of the string resource. *
- * *
- * WARNINGS: none *
- * *
- * HISTORY: *
- * 12/25/1996 JLB : Created. *
- *=============================================================================================*/
-char const * Fetch_String(int id)
-{
- static SRecord _buffers[64];
- static int _time = 0;
-
- /*
- ** Determine if the string ID requested is valid. If not then return an empty string pointer.
- */
- if (id == -1 || id == TXT_NONE) return("");
-
- /*
- ** Adjust the 'time stamp' tracking value. This is an artificial value used merely to track
- ** the relative age of the strings requested.
- */
- _time = _time+1;
-
- /*
- ** Check to see if the requested string has already been fetched into a buffer. If so, then
- ** return a pointer to that string (update the time stamp as well).
- */
- for (int index = 0; index < ARRAY_SIZE(_buffers); index++) {
- if (_buffers[index].ID == id) {
- _buffers[index].TimeStamp = _time;
- return(_buffers[index].String);
- }
- }
-
- /*
- ** Find a suitable buffer to hold the string to be fetched. The buffer should either be
- ** empty or have the oldest fetched string.
- */
- int oldest = -1;
- int oldtime = -1;
- for (int text = 0; text < ARRAY_SIZE(_buffers); text++) {
- if (oldest == -1 || oldtime > _buffers[text].TimeStamp) {
- oldest = text;
- oldtime = _buffers[text].TimeStamp;
- if (oldtime == -1 || _buffers[text].ID == -1) break;
- }
- }
-
- /*
- ** A suitable buffer has been found so fetch the string resource and then return a pointer
- ** to the string.
- */
- char * stringptr = _buffers[oldest].String;
- _buffers[oldest].ID = id;
- _buffers[oldest].TimeStamp = _time;
-
-
- if (LoadString(Global_instance, id, stringptr, sizeof(_buffers[oldest].String)) == 0) {
- return("");
- }
-
- /******
- char resname[32];
- sprintf(resname,"#%d",id);
- HMODULE hmod=GetModuleHandle(NULL);
- HRSRC hrsrc=FindResourceEx(hmod, RT_STRING, MAKEINTRESOURCE(id), LANGID);
- if (hrsrc==0)
- {
- char message_buffer[256];
- FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), &message_buffer[0], 256, NULL );
-
- }
- HGLOBAL resdata=LoadResource(NULL,hrsrc);
- LPVOID vdata=LockResource(resdata);
- strcpy(stringptr,(char *)vdata);
- *********/
-
- stringptr[sizeof(_buffers[oldest].String)-1] = '\0';
- return(stringptr);
-}
-
-
-
-
-void LogMsg(const char *msg)
-{
-#ifdef _DEBUG
- FILE *out=fopen("register.log","a");
- fprintf(out,"%s\n",msg);
- fflush(out);
- fclose(out);
-#endif
-}
-
-
-
-
-void Startup_Chat(void)
-{
- /*
- //////CComObject* g_pChatSink;
- HRESULT hRes;
- g_pChatSink=NULL;
-
- CoCreateInstance(CLSID_Chat, NULL, CLSCTX_INPROC_SERVER,
- IID_IChat, (void**)&pChat);
-
-
- if (pChat==NULL)
- {
- char error[128];
- char apimissing[256];
- LoadString(Global_instance, TXT_API_MISSING, apimissing, sizeof(apimissing));
- LoadString(Global_instance, TXT_ERROR, error, sizeof(error));
- MessageBox(g_PrimaryWindow,apimissing,error,MB_OK);
- exit(-5);
- }
-
- g_pChatSink=new CChatEventSink;
-
- // Get a connection point from the chat class
- IConnectionPoint *pConnectionPoint=NULL;
- IConnectionPointContainer *pContainer=NULL;
-
- dwChatAdvise=0;
- hRes=pChat->QueryInterface(IID_IConnectionPointContainer,(void**)&pContainer);
- _ASSERTE(SUCCEEDED(hRes));
- hRes=pContainer->FindConnectionPoint(IID_IChatEvent,&pConnectionPoint);
- _ASSERTE(SUCCEEDED(hRes));
- hRes=pConnectionPoint->Advise((IChatEvent *)g_pChatSink,&dwChatAdvise);
- _ASSERTE(SUCCEEDED(hRes));
-
-
- pChat->SetAttributeValue("RegPath",APP_REG_KEY);
-
- // ADD pConnectionPoint->Release();
- */
-}
-
-void Shutdown_Chat(void)
-{
- /*
- /////AtlUnadvise(pChat, IID_IChatEvent, dwChatAdvise);
-
- IConnectionPoint *pConnectionPoint=NULL;
- IConnectionPointContainer *pContainer=NULL;
- HRESULT hRes;
-
- hRes=pChat->QueryInterface(IID_IConnectionPointContainer,(void**)&pContainer);
- _ASSERTE(SUCCEEDED(hRes));
- hRes=pContainer->FindConnectionPoint(IID_IChatEvent,&pConnectionPoint);
- _ASSERTE(SUCCEEDED(hRes));
- pConnectionPoint->Unadvise(dwChatAdvise);
-
- pChat->Release();
-
- /////delete(g_pChatSink); This appears to be bad....
- // ADD g_pChatSink->Release();
- // ADD pConnectionPoint->Release();
- // ADD pContainer->Release();
- */
-}
-
-
-
-//
-// Download a patch for the registration client if required
-// This uses the chat API for ver checking and FTP.
-//
-void Update_If_Required(void)
-{
- int retval;
- int i;
- // Create the events
- for (i=0; iRequestServerList(1000,262364,"register","regpas98",15);
- ///pChat->RequestServerList(1000,300,"register","regpas98",15);
-
- pChat->RequestServerList(g_AppSku,g_AppVer,"register","regpas98",40);
-
- while(1)
- {
- pChat->PumpMessages();
- MSG msg;
- while(PeekMessage(&msg,NULL,0,0, PM_REMOVE))
- {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
- retval=WaitForMultipleObjectsEx(NUM_EVENTS,Events,FALSE,50,FALSE);
- if (retval==WAIT_TIMEOUT)
- continue;
- //DBGMSG("An event was set");
- retval-=WAIT_OBJECT_0;
- break;
- }
-
- //DBGMSG("Out of the loop")
-
- if (retval==ABORT_EVENT)
- {
- exit(0);
- }
- else
- {
- //DBGMSG("NO update required");
- }
-
- //DBGMSG("Shutting down");
-
- // close all the event objects
- for (i=0; i(this) ;
- }
- else
- {
- *ppv = NULL;
- return E_NOINTERFACE;
- }
- (reinterpret_cast(*ppv))->AddRef() ;
- return S_OK ;
-}
-
-///////////////////////////////////////////////////////////
-//
-// AddRef
-//
-ULONG __stdcall
-CChatEventSink::AddRef()
-{
- return InterlockedIncrement(&m_cRef) ;
-}
-
-///////////////////////////////////////////////////////////
-//
-// Release
-//
-ULONG __stdcall
-CChatEventSink::Release()
-{
- if (InterlockedDecrement(&m_cRef) == 0)
- {
- delete this ;
- return 0 ;
- }
- return m_cRef;
-}
-
-
-
-
-
-///// DOWNLOAD
-
-CDownloadEventSink::CDownloadEventSink()
-{
- m_cRef=0; // Ref counter
-}
-
-///////////////////////////////////////////////////////////
-//
-// Interface IUnknown Methods
-//
-///////////////////////////////////////////////////////////
-//
-// QueryInterface
-//
-HRESULT __stdcall
-CDownloadEventSink::QueryInterface(const IID& iid, void** ppv)
-{
- if ((iid == IID_IUnknown) ||(iid == IID_IDownloadEvent))
- {
- *ppv = static_cast(this) ;
- }
- else
- {
- *ppv = NULL;
- return E_NOINTERFACE;
- }
- (reinterpret_cast(*ppv))->AddRef() ;
- return S_OK ;
-}
-
-///////////////////////////////////////////////////////////
-//
-// AddRef
-//
-ULONG __stdcall
-CDownloadEventSink::AddRef()
-{
- return InterlockedIncrement(&m_cRef) ;
-}
-
-///////////////////////////////////////////////////////////
-//
-// Release
-//
-ULONG __stdcall
-CDownloadEventSink::Release()
-{
- if (InterlockedDecrement(&m_cRef) == 0)
- {
- delete this ;
- return 0 ;
- }
- return m_cRef;
-}
-
-*/
-
-
-
-
-
-
-//// FTP Download stuff
-
-
-void SetupDownload( void )
-{
- /*
- HRESULT hRes;
-
- g_pDownloadSink=NULL;
-
- CoCreateInstance(CLSID_Download, NULL, CLSCTX_INPROC_SERVER,
- IID_IDownload, (void**)&pDownload);
- _ASSERTE(pDownload);
- g_pDownloadSink=new CDownloadEventSink;
-
- // Get a connection point from the chat class
- IConnectionPoint *pConnectionPoint=NULL;
- IConnectionPointContainer *pContainer=NULL;
- dwDownloadAdvise = 0;
-
- hRes=pDownload->QueryInterface(IID_IConnectionPointContainer,(void**)&pContainer);
- _ASSERTE(SUCCEEDED(hRes));
- hRes=pContainer->FindConnectionPoint(IID_IDownloadEvent,&pConnectionPoint);
- _ASSERTE(SUCCEEDED(hRes));
- hRes=pConnectionPoint->Advise((IDownloadEvent *)g_pDownloadSink,&dwDownloadAdvise);
- _ASSERTE(SUCCEEDED(hRes));
- */
-}
-
-
-
-void ClosedownDownload( void )
-{
-/*
- // AtlUnadvise(pDownload, IID_IDownloadEvent, dwDownloadAdvise);
-
- IConnectionPoint *pConnectionPoint=NULL;
- IConnectionPointContainer *pContainer=NULL;
- HRESULT hRes;
-
- hRes=pDownload->QueryInterface(IID_IConnectionPointContainer,(void**)&pContainer);
- _ASSERTE(SUCCEEDED(hRes));
- hRes=pContainer->FindConnectionPoint(IID_IDownloadEvent,&pConnectionPoint);
- _ASSERTE(SUCCEEDED(hRes));
- pConnectionPoint->Unadvise(dwDownloadAdvise);
-
- pDownload->Release();
-
- //////delete(g_pDownloadSink); This appears to be bad....
-*/
-}
-
-
-
-BOOL CALLBACK Download_Dialog_Proc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
-{
-// char fullpath[ 256 ];
-// char localfile[ 256];
-// HRESULT res;
-
- switch( uMsg )
- {
- case WM_COMMAND:
- switch( LOWORD( wParam ) )
- {
- case IDC_DLABORT:
- {
-
- char abort[128];
- char abortdload[256];
- LoadString(Global_instance, TXT_ABORT_DOWNLOAD, abortdload, sizeof(abortdload));
- LoadString(Global_instance, TXT_ABORT, abort, sizeof(abort));
-
- if (MessageBox(g_PrimaryWindow,abortdload,abort,MB_YESNO)==IDYES)
- {
-/*
- pDownload->Abort();
-*/
- EndDialog( hwndDlg, g_Finished );
- DestroyWindow(hwndDlg);
- }
- }
- break;
-
- default:
- return FALSE;
- }
- break;
-
- case WM_INITDIALOG:
- SetupDownload();
-
- SendMessage(hwndDlg, WM_SETICON,(WPARAM)ICON_SMALL,
- (LPARAM)LoadIcon(Global_instance, MAKEINTRESOURCE(IDI_ICON1)));
-
- g_DLTimeRem[0]=0;
- g_DLBytesLeft[0]=0;
- g_DLBPS[0]=0;
-
- //SetDlgItemText( hwndDlg, IDC_DOWNLOADTITLE, g_UpdateString);
- //SetWindowText(hwndDlg, g_UpdateString);
-
- SetDlgItemText( hwndDlg, IDC_TIMEREM, g_DLTimeRem);
- SetDlgItemText( hwndDlg, IDC_BYTESLEFT, g_DLBytesLeft);
- // SetDlgItemText( hwndDlg, IDC_BPS, g_DLBPS );
-
-/*
- // Work out the full file name
- sprintf( fullpath, "%s/%s", g_Update->patchpath,g_Update->patchfile);
- sprintf(localfile,"%s\\%s",g_Update->localpath,g_Update->patchfile);
-
- // Create the directory
- CreateDirectory((char *)g_Update->localpath, NULL );
-
- res=pDownload->DownloadFile((char *)g_Update->server, (char *)g_Update->login, (char *)g_Update->password,
- fullpath, localfile, APP_REG_KEY);
-
-*/
- g_DownloadWindow = hwndDlg;
- g_Finished = 0;
- SetTimer( hwndDlg, 1, 200, NULL ); // was 50
-
- break;
-
- case WM_TIMER:
- LogMsg("TIMER");
- if( g_Finished == 0 )
- {
- LogMsg("Entering PumpMsgs");
-/*
- pDownload->PumpMessages();
-*/
- LogMsg("Done with PumpMsgs");
- if (strlen(g_DLTimeRem))
- SetDlgItemText( hwndDlg, IDC_TIMEREM, g_DLTimeRem );
- if (strlen(g_DLBytesLeft))
- SetDlgItemText( hwndDlg, IDC_BYTESLEFT, g_DLBytesLeft );
- //if (strlen(g_DLBPS))
- // SetDlgItemText( hwndDlg, IDC_BPS, g_DLBPS );
- }
- else
- {
- LogMsg("TIMER: Finished");
- EndDialog( hwndDlg, g_Finished );
- DestroyWindow( hwndDlg );
- }
- break;
-
- case WM_DESTROY:
- KillTimer( hwndDlg, 1 );
- ClosedownDownload();
-
- //DBGMSG("WM_DESTROY");
- break;
-
- case WM_SETFONT:
- return TRUE;
-
- default:
- return FALSE;
- }
- return TRUE;
-}
-
-
-
-// Whoeee this is an exciting one...
-BOOL CALLBACK Simple_Dialog_Proc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
-{
- switch( uMsg )
- {
- case WM_INITDIALOG:
- return(TRUE);
- break;
- case WM_CLOSE:
- DestroyWindow(hwnd);
- PostQuitMessage(0);
- exit(0);
- break;
- }
- return(FALSE);
-}
-
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CDownloadEventSink
-//////////////////////////////////////////////////////////////////////////////
-
-/*
-
-STDMETHODIMP CDownloadEventSink::OnEnd(void)
-{
- LogMsg("Finished!");
- g_Finished = 1;
- return(S_OK);
-}
-
-STDMETHODIMP CDownloadEventSink::OnError(int error)
-{
- LogMsg("ERROR");
- g_Finished = -1;
- return(S_OK);
-}
-
-
-STDMETHODIMP CDownloadEventSink::OnProgressUpdate(int bytesread, int totalsize,
- int timetaken, int timeleft)
-{
- SendDlgItemMessage( g_DownloadWindow, IDC_PROGRESS, PBM_SETPOS, (WPARAM)(bytesread * 100) / totalsize, 0 );
- char temp[256];
-
- if( timeleft > 0 )
- {
- //DBGMSG("Bytes read: "<next;
- numupdates++;
- }
-
- // Got a list of updates - If an update is required, the user must either
- // patch or quit.
-
- tmp = updates;
-
- LogMsg("Found an update");
-
- // We have a required update
-
- char upreq[256];
- char title[128];
-
- LoadString(Global_instance, TXT_AN_UPGRADE_AVAILABLE, upreq, sizeof(upreq));
- strcat(upreq,"\n");
- LoadString(Global_instance, TXT_DOWNLOAD_NOW, upreq+strlen(upreq), sizeof(upreq));
- LoadString(Global_instance, TXT_UPGRADE_AVAILABLE, title, sizeof(title));
-
- if( MessageBox(g_PrimaryWindow,upreq,title, MB_YESNO ) == IDNO )
- {
- // If they don't want to patch now, just exit...
- //DBGMSG("Must patch to continue, so exit");
- exit(0);
- }
-
- // Do the downloads
- while( tmp != NULL )
- {
- g_Update = tmp;
-
- char dloading[256];
- LoadString(Global_instance, TXT_DOWNLOADING_FILE, dloading, sizeof(dloading));
- sprintf( g_UpdateString, dloading, ++i, numupdates );
-
- LogMsg("Creating Download dialog box");
- //if( (retval=DialogBox(Global_instance, MAKEINTRESOURCE(IDD_DOWNLOAD_DIALOG), g_PrimaryWindow,
- // (DLGPROC)Download_Dialog_Proc)) != 1 )
-
- retval=DialogBox(Global_instance, MAKEINTRESOURCE(IDD_DOWNLOAD_DIALOG), g_PrimaryWindow,(DLGPROC)Download_Dialog_Proc);
-
- if (g_Finished != 1)
- {
- // Download failed
- //DBGMSG("Download failed: "<next;
- }
- // Quit so the launcher can apply the patches
- exit(0);
- return(S_OK); // make silly compiler happy
-}
-
-
-
-
-
-
-STDMETHODIMP CChatEventSink::OnServerError(HRESULT, LPCSTR)
-{
- LogMsg("Server Error");
- return(S_OK);
-}
-
-STDMETHODIMP CChatEventSink::OnMessageOfTheDay(HRESULT, LPCSTR)
-{
- return(S_OK);
-}
-
-
-
-STDMETHODIMP CChatEventSink::OnPrivateAction(HRESULT, User *, LPCSTR)
-{
- return(S_OK);
-}
-
-
-STDMETHODIMP CChatEventSink::OnPublicAction(HRESULT, Channel *, User *, LPCSTR)
-{
- return(S_OK);
-}
-
-
-STDMETHODIMP CChatEventSink::OnPrivateGameOptions(HRESULT, User *, LPCSTR)
-{
- return(S_OK);
-}
-
-
-STDMETHODIMP CChatEventSink::OnPublicGameOptions(HRESULT, Channel *, User *, LPCSTR)
-{
- return(S_OK);
-}
-
-
-STDMETHODIMP CChatEventSink::OnGameStart(HRESULT, Channel *, User *, int)
-{
- return(S_OK);
-}
-
-
-STDMETHODIMP CChatEventSink::OnUserKick(HRESULT, Channel *, User *, User *)
-{
- return(S_OK);
-}
-
-
-STDMETHODIMP CChatEventSink::OnUserIP(HRESULT, User *)
-{
- return(S_OK);
-}
-
-STDMETHODIMP CChatEventSink::OnSquadInfo(HRESULT, unsigned long, Squad *)
-{
- return(S_OK);
-}
-
-*/
-
-} // namespace patchget
diff --git a/Generals/Code/Tools/PATCHGET/CHATAPI.H b/Generals/Code/Tools/PATCHGET/CHATAPI.H
deleted file mode 100644
index dd54a9de251..00000000000
--- a/Generals/Code/Tools/PATCHGET/CHATAPI.H
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-#ifndef CHATAPI_HEADER
-#define CHATAPI_HEADER
-
-#include "COMINIT.H"
-#include
-#include
-#include
-#include
-#include
-#include
-
-/**********************************************************************
-** This macro serves as a general way to determine the number of elements
-** within an array.
-*/
-#define ARRAY_SIZE(x) int(sizeof(x)/sizeof(x[0]))
-#define size_of(typ,id) sizeof(((typ*)0)->id)
-
-namespace patchget
-{
-
-int main(int argc, char *argv[]);
-
-void Startup_Chat(void);
-void Shutdown_Chat(void);
-void Update_If_Required(void);
-
-char const * Fetch_String(int id);
-
-} // namespace patchget
-
-#endif
diff --git a/Generals/Code/Tools/PATCHGET/CMakeLists.txt b/Generals/Code/Tools/PATCHGET/CMakeLists.txt
index 645d5ad246a..281b4ec5126 100644
--- a/Generals/Code/Tools/PATCHGET/CMakeLists.txt
+++ b/Generals/Code/Tools/PATCHGET/CMakeLists.txt
@@ -1,45 +1,13 @@
-set(PATCHGET_SRC
- "CHATAPI.CPP"
- "CHATAPI.H"
- "COMINIT.CPP"
- "COMINIT.H"
- "debug.cpp"
- "debug.h"
- "DownloadManager.cpp"
- "DownloadManager.h"
- "PROCESS.CPP"
- "PROCESS.H"
- "registry.cpp"
- "Registry.h"
- "RESOURCE.H"
- "WINBLOWS.CPP"
- "WINBLOWS.H"
- "WSTYPES.H"
-)
-
macro(setup_patchgrabber appname)
add_executable(${appname} WIN32)
- target_sources(${appname} PRIVATE ${PATCHGET_SRC})
+
target_link_libraries(${appname} PRIVATE
- comctl32
- dbghelplib
+ corei_patchgrabber
g_gameengine
g_gameenginedevice
g_wwvegas
- gamespy::gamespy
gi_always
- imm32
- vfw32
- winmm
)
-
- target_compile_definitions(${appname} PRIVATE
- $<$:DEBUG_CRASHING>
- )
-
- if(WIN32 OR "${CMAKE_SYSTEM}" MATCHES "Windows")
- target_sources(${appname} PRIVATE SCRIPT1.RC)
- endif()
endmacro()
setup_patchgrabber(g_patchgrabber_en)
diff --git a/Generals/Code/Tools/PATCHGET/COMINIT.CPP b/Generals/Code/Tools/PATCHGET/COMINIT.CPP
deleted file mode 100644
index 797ed73fa19..00000000000
--- a/Generals/Code/Tools/PATCHGET/COMINIT.CPP
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-//
-// If you link with this it will automatically call the COM initialization stuff
-//
-#include "COMINIT.H"
-#include
-#include
-#include
-#include
-
-namespace patchget
-{
-
-ComInit::ComInit()
-{
- HRESULT hRes = CoInitialize(NULL);
- if (SUCCEEDED(hRes)==FALSE)
- {
- MessageBox(NULL,"Can't initialize COM?!?!","Error:",MB_OK);
- exit(0);
- }
-}
-
-
-ComInit::~ComInit()
-{
- CoUninitialize();
-}
-
-// Creating this instance will setup all COM stuff & do cleanup on program exit
-ComInit Global_COM_Initializer;
-
-} // namespace patchget
diff --git a/Generals/Code/Tools/PATCHGET/COMINIT.H b/Generals/Code/Tools/PATCHGET/COMINIT.H
deleted file mode 100644
index f87ef8746a7..00000000000
--- a/Generals/Code/Tools/PATCHGET/COMINIT.H
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-#ifndef COMINIT_HEADER
-#define COMINIT_HEADER
-
-namespace patchget
-{
-
-//
-// Link with this to automatically initialize COM at startup
-// - See cominit.cpp for more info
-//
-
-class ComInit
-{
- public:
- ComInit();
- ~ComInit();
-};
-
-} // namespace patchget
-
-#endif
diff --git a/Generals/Code/Tools/PATCHGET/DownloadManager.cpp b/Generals/Code/Tools/PATCHGET/DownloadManager.cpp
deleted file mode 100644
index fa6dea64f8d..00000000000
--- a/Generals/Code/Tools/PATCHGET/DownloadManager.cpp
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-// FILE: DownloadManager.cpp //////////////////////////////////////////////////////
-// Generals download manager code
-// Author: Matthew D. Campbell, July 2002
-
-#include "debug.h"
-#include "CHATAPI.H"
-#include "DownloadManager.h"
-#include "RESOURCE.H"
-
-namespace patchget
-{
-
-DownloadManager *TheDownloadManager = NULL;
-
-DownloadManager::DownloadManager()
-{
- m_download = new CDownload(this);
- m_wasError = m_sawEnd = false;
- m_statusString = Fetch_String(FTP_StatusIdle);
-
- // ----- Initialize Winsock -----
- m_winsockInit = true;
- WORD verReq = MAKEWORD(2, 2);
- WSADATA wsadata;
-
- int err = WSAStartup(verReq, &wsadata);
- if (err != 0)
- {
- m_winsockInit = false;
- }
- else
- {
- if ((LOBYTE(wsadata.wVersion) != 2) || (HIBYTE(wsadata.wVersion) !=2))
- {
- WSACleanup();
- m_winsockInit = false;
- }
- }
-
-}
-
-DownloadManager::~DownloadManager()
-{
- delete m_download;
- if (m_winsockInit)
- {
- WSACleanup();
- m_winsockInit = false;
- }
-}
-
-void DownloadManager::init( void )
-{
-}
-
-void DownloadManager::reset( void )
-{
-}
-
-HRESULT DownloadManager::update( void )
-{
- return m_download->PumpMessages();
-}
-
-HRESULT DownloadManager::downloadFile( std::string server, std::string username, std::string password, std::string file, std::string localfile, std::string regkey, bool tryResume )
-{
- return m_download->DownloadFile( server.c_str(), username.c_str(), password.c_str(), file.c_str(), localfile.c_str(), regkey.c_str(), tryResume );
-}
-
-void DownloadManager::queueFileForDownload( std::string server, std::string username, std::string password, std::string file, std::string localfile, std::string regkey, bool tryResume )
-{
- QueuedDownload q;
- q.file = file;
- q.localFile = localfile;
- q.password = password;
- q.regKey = regkey;
- q.server = server;
- q.tryResume = tryResume;
- q.userName = username;
-
- m_queuedDownloads.push_back(q);
-}
-
-HRESULT DownloadManager::downloadNextQueuedFile( void )
-{
- QueuedDownload q;
- std::list::iterator it = m_queuedDownloads.begin();
- if (it != m_queuedDownloads.end())
- {
- q = *it;
- m_queuedDownloads.pop_front();
- m_wasError = m_sawEnd = false;
- return downloadFile( q.server, q.userName, q.password, q.file, q.localFile, q.regKey, q.tryResume );
- }
- else
- {
- DEBUG_CRASH(("Starting non-existent download!"));
- return S_OK;
- }
-}
-
-std::string DownloadManager::getLastLocalFile( void )
-{
- char buf[256] = "";
- m_download->GetLastLocalFile(buf, 256);
- return buf;
-}
-
-HRESULT DownloadManager::OnError( int error )
-{
- m_wasError = true;
- std::string s = Fetch_String(FTP_UnknownError);
- switch (error)
- {
- case DOWNLOADEVENT_NOSUCHSERVER:
- s = Fetch_String(FTP_NoSuchServer);
- break;
- case DOWNLOADEVENT_COULDNOTCONNECT:
- s = Fetch_String(FTP_CouldNotConnect);
- break;
- case DOWNLOADEVENT_LOGINFAILED:
- s = Fetch_String(FTP_LoginFailed);
- break;
- case DOWNLOADEVENT_NOSUCHFILE:
- s = Fetch_String(FTP_NoSuchFile);
- break;
- case DOWNLOADEVENT_LOCALFILEOPENFAILED:
- s = Fetch_String(FTP_LocalFileOpenFailed);
- break;
- case DOWNLOADEVENT_TCPERROR:
- s = Fetch_String(FTP_TCPError);
- break;
- case DOWNLOADEVENT_DISCONNECTERROR:
- s = Fetch_String(FTP_DisconnectError);
- break;
- }
- m_errorString = s;
- DEBUG_LOG(("DownloadManager::OnError(): %s(%d)\n", s.c_str(), error));
- return S_OK;
-}
-
-HRESULT DownloadManager::OnEnd()
-{
- m_sawEnd = true;
- DEBUG_LOG(("DownloadManager::OnEnd()\n"));
- return S_OK;
-}
-
-HRESULT DownloadManager::OnQueryResume()
-{
- DEBUG_LOG(("DownloadManager::OnQueryResume()\n"));
- //return DOWNLOADEVENT_DONOTRESUME;
- return DOWNLOADEVENT_RESUME;
-}
-
-HRESULT DownloadManager::OnProgressUpdate( int bytesread, int totalsize, int timetaken, int timeleft )
-{
- DEBUG_LOG(("DownloadManager::OnProgressUpdate(): %d/%d %d/%d\n", bytesread, totalsize, timetaken, timeleft));
- return S_OK;
-}
-
-HRESULT DownloadManager::OnStatusUpdate( int status )
-{
- std::string s = Fetch_String(FTP_StatusNone);
- switch (status)
- {
- case DOWNLOADSTATUS_CONNECTING:
- s = Fetch_String(FTP_StatusConnecting);
- break;
- case DOWNLOADSTATUS_LOGGINGIN:
- s = Fetch_String(FTP_StatusLoggingIn);
- break;
- case DOWNLOADSTATUS_FINDINGFILE:
- s = Fetch_String(FTP_StatusFindingFile);
- break;
- case DOWNLOADSTATUS_QUERYINGRESUME:
- s = Fetch_String(FTP_StatusQueryingResume);
- break;
- case DOWNLOADSTATUS_DOWNLOADING:
- s = Fetch_String(FTP_StatusDownloading);
- break;
- case DOWNLOADSTATUS_DISCONNECTING:
- s = Fetch_String(FTP_StatusDisconnecting);
- break;
- case DOWNLOADSTATUS_FINISHING:
- s = Fetch_String(FTP_StatusFinishing);
- break;
- case DOWNLOADSTATUS_DONE:
- s = Fetch_String(FTP_StatusDone);
- break;
- }
- m_statusString = s;
- DEBUG_LOG(("DownloadManager::OnStatusUpdate(): %s(%d)\n", s.c_str(), status));
- return S_OK;
-}
-
-} // namespace patchget
diff --git a/Generals/Code/Tools/PATCHGET/DownloadManager.h b/Generals/Code/Tools/PATCHGET/DownloadManager.h
deleted file mode 100644
index e82cc956a74..00000000000
--- a/Generals/Code/Tools/PATCHGET/DownloadManager.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-// FILE: DownloadManager.h //////////////////////////////////////////////////////
-// Generals download class definitions
-// Author: Matthew D. Campbell, July 2002
-
-#pragma once
-
-#ifndef __DOWNLOADMANAGER_H__
-#define __DOWNLOADMANAGER_H__
-
-#include "WWDownload/downloaddefs.h"
-#include "WWDownload/Download.h"
-#include
-#include
-
-class CDownload;
-
-namespace patchget
-{
-
-class QueuedDownload
-{
-public:
- std::string server;
- std::string userName;
- std::string password;
- std::string file;
- std::string localFile;
- std::string regKey;
- bool tryResume;
-};
-
-/////////////////////////////////////////////////////////////////////////////
-// DownloadManager
-
-class DownloadManager : public IDownload
-{
-public:
- DownloadManager();
- virtual ~DownloadManager();
-
-public:
- void init( void );
- HRESULT update( void );
- void reset( void );
-
- virtual HRESULT OnError( int error );
- virtual HRESULT OnEnd();
- virtual HRESULT OnQueryResume();
- virtual HRESULT OnProgressUpdate( int bytesread, int totalsize, int timetaken, int timeleft );
- virtual HRESULT OnStatusUpdate( int status );
-
- virtual HRESULT downloadFile( std::string server, std::string username, std::string password, std::string file, std::string localfile, std::string regkey, bool tryResume );
- std::string getLastLocalFile( void );
-
- bool isDone( void ) { return m_sawEnd || m_wasError; }
- bool isOk( void ) { return m_sawEnd; }
- bool wasError( void ) { return m_wasError; }
-
- std::string getStatusString( void ) { return m_statusString; }
- std::string getErrorString( void ) { return m_errorString; }
-
- void queueFileForDownload( std::string server, std::string username, std::string password, std::string file, std::string localfile, std::string regkey, bool tryResume );
- bool isFileQueuedForDownload( void ) { return !m_queuedDownloads.empty(); }
- HRESULT downloadNextQueuedFile( void );
-
-private:
- bool m_winsockInit;
- CDownload *m_download;
- bool m_wasError;
- bool m_sawEnd;
- std::string m_errorString;
- std::string m_statusString;
-
-protected:
- std::list m_queuedDownloads;
-};
-
-extern DownloadManager *TheDownloadManager;
-
-} // namespace patchget
-
-#endif // __DOWNLOADMANAGER_H__
diff --git a/Generals/Code/Tools/PATCHGET/PROCESS.CPP b/Generals/Code/Tools/PATCHGET/PROCESS.CPP
deleted file mode 100644
index 8a5fbf7ec0a..00000000000
--- a/Generals/Code/Tools/PATCHGET/PROCESS.CPP
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-#include "process.h"
-
-namespace patchget
-{
-
-Process::Process()
-{
- directory[0]=0;
- command[0]=0;
- args[0]=0;
- hProcess=NULL;
- hThread=NULL;
-}
-
-// Create a process
-bit8 Create_Process(Process &process)
-{
- int retval;
- STARTUPINFO si;
- PROCESS_INFORMATION piProcess;
- ZeroMemory(&si,sizeof(si));
- si.cb=sizeof(si);
-
- char cmdargs[513];
- memset(cmdargs,0,513);
- strcpy(cmdargs,process.command);
- strcat(cmdargs,process.args);
-
- retval=CreateProcess(NULL,cmdargs,NULL,NULL,FALSE, 0 ,NULL, NULL/*process.directory*/,&si,&piProcess);
-
- process.hProcess=piProcess.hProcess;
- process.hThread=piProcess.hThread;
- return(TRUE);
-}
-
-//
-// Wait for a process to complete, and fill in the exit code
-//
-bit8 Wait_Process(Process &process, DWORD *exit_code)
-{
- DWORD retval;
- retval=WaitForSingleObject(process.hProcess,INFINITE);
- if (exit_code != NULL)
- *exit_code=-1;
- if (retval==WAIT_OBJECT_0) // process exited
- {
- if (exit_code != NULL)
- GetExitCodeProcess(process.hProcess,exit_code);
- return(TRUE);
- }
- else // can this happen?
- return(FALSE);
-}
-
-/*******************
-//
-// Get the process to run from the config object
-//
-bit8 Read_Process_Info(ConfigFile &config,OUT Process &info)
-{
-
- Wstring procinfo;
- if (config.getString("RUN",procinfo)==FALSE)
- {
- DBGMSG("Couldn't read the RUN line");
- return(FALSE);
- }
- int offset=0;
- Wstring dir;
- Wstring executable;
- Wstring args;
- offset=procinfo.getToken(offset," ",dir);
- offset=procinfo.getToken(offset," ",executable);
- args=procinfo;
- args.remove(0,offset);
-
- ///
- ///
- DBGMSG("RUN: EXE = "<.
-*/
-
-// Registry.h
-// Simple interface for storing/retreiving registry values
-// Author: Matthew D. Campbell, December 2001
-
-#pragma once
-
-#ifndef __REGISTRY_H__
-#define __REGISTRY_H__
-
-#include
-
-namespace patchget
-{
-
-/**
- * Get a string from the registry
- */
-bool GetStringFromRegistry(std::string path, std::string key, std::string& val);
-
-/**
- * Get an unsigned int from the registry
- */
-bool GetUnsignedIntFromRegistry(std::string path, std::string key, unsigned int& val);
-
-/**
- * Store a string in the registry - returns true on success
- */
-bool SetStringInRegistry(std::string path, std::string key, std::string val);
-
-/**
- * Store an unsigned int in the registry - returns true on success
- */
-bool SetUnsignedIntInRegistry(std::string path, std::string key, unsigned int val);
-
-} // namespace patchget
-
-#endif // __REGISTRY_H__
diff --git a/Generals/Code/Tools/PATCHGET/WINBLOWS.CPP b/Generals/Code/Tools/PATCHGET/WINBLOWS.CPP
deleted file mode 100644
index 2978f523b50..00000000000
--- a/Generals/Code/Tools/PATCHGET/WINBLOWS.CPP
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-#define WIN32_LEAN_AND_MEAN
-#include
-#include
-#include
-#include
-#include
-
-#include "WINBLOWS.H"
-#include "CHATAPI.H"
-
-
-// TheSuperHackers @fix xezon 13/03/2025 Fix debug linker errors by
-// adding "patchget" namespaces and these globals here.
-// just to satisfy the game libraries we link to
-HINSTANCE ApplicationHInstance = NULL; ///< our application instance
-HWND ApplicationHWnd = NULL;
-const char *g_strFile = "data\\Generals.str";
-const char *g_csfFile = "data\\%s\\Generals.csf";
-const char *gAppPrefix = "patchget_"; // prefix to the debug log.
-
-
-HINSTANCE Global_instance;
-LPSTR Global_commandline;
-int Global_commandshow;
-
-
-/*
- * WinMain - initialization, message loop
- */
-int PASCAL WinMain( HINSTANCE instance, HINSTANCE, char *command_line, int command_show)
-{
- //////MSG msg;
-
- Global_instance = instance;
- Global_commandline = command_line;
- Global_commandshow = command_show;
-
- int argc;
- char *argv[64];
-
- char path_to_exe[512];
- GetModuleFileName(instance,(char *)&path_to_exe,512);
- argc=1;
- argv[0]=path_to_exe;
-
-
- int command_scan=0;
- char command_char;
- do
- {
- /*
- ** Scan for non-space character on command line
- */
- do
- {
- command_char = *( command_line+command_scan++ );
- } while ( command_char==' ' );
-
- if ( command_char!=0 && command_char != 13 )
- {
- argv[argc++]=command_line+command_scan-1;
-
- /*
- ** Scan for space character on command line
- */
- do
- {
- command_char = *( command_line+command_scan++ );
- } while ( command_char!=' ' && command_char != 0 && command_char!=13);
- *( command_line+command_scan-1 ) = 0;
- }
-
- } while ( command_char != 0 && command_char != 13 && argc<20 );
-
- return(patchget::main(argc,argv));
-
-} /* WinMain */
-
-
-int Print_WM(UINT message,char *out)
-{
- switch(message)
- {
- case WM_NULL:
- sprintf(out,"WM_NULL");
- break;
- case WM_CREATE:
- sprintf(out,"WM_CREATE");
- break;
- case WM_DESTROY:
- sprintf(out,"WM_DESTROY");
- break;
- case WM_CANCELMODE:
- sprintf(out,"WM_CANCELMODE");
- break;
- case WM_ERASEBKGND:
- sprintf(out,"WM_ERASEBKGND");
- break;
- case WM_GETTEXT:
- sprintf(out,"WM_GETTEXT");
- break;
- case WM_QUERYOPEN:
- sprintf(out,"WM_QUERYOPEN");
- break;
- case WM_MOVE:
- sprintf(out,"WM_MOVE");
- break;
- case WM_SIZE:
- sprintf(out,"WM_SIZE");
- break;
- case WM_ACTIVATE:
- sprintf(out,"WM_ACTIVATE");
- break;
- case WM_SETFOCUS:
- sprintf(out,"WM_SETFOCUS");
- break;
- case WM_KILLFOCUS:
- sprintf(out,"WM_KILLFOCUS");
- break;
- case WM_ENABLE:
- sprintf(out,"WM_ENABLE");
- break;
- case WM_SETREDRAW:
- sprintf(out,"WM_REDRAW");
- break;
- case WM_PAINT:
- sprintf(out,"WM_PAINT");
- break;
- case WM_CLOSE:
- sprintf(out,"WM_CLOSE");
- break;
- case WM_QUIT:
- sprintf(out,"WM_QUIT");
- break;
- case WM_ACTIVATEAPP:
- sprintf(out,"WM_ACTIVATEAPP");
- break;
- case WM_SETCURSOR:
- sprintf(out,"WM_SETCURSOR");
- break;
- case WM_KEYDOWN:
- sprintf(out,"WM_KEYDOWN");
- break;
- case WM_MOUSEMOVE:
- sprintf(out,"WM_MOUSEMOVE");
- break;
- case WM_WINDOWPOSCHANGING:
- sprintf(out,"WM_WINDOWPOSCHANGING");
- break;
- case WM_WINDOWPOSCHANGED:
- sprintf(out,"WM_WINDOWPOSCHANGED");
- break;
- case WM_DISPLAYCHANGE:
- sprintf(out,"WM_DISPLAYCHANGE");
- break;
- case WM_NCPAINT:
- sprintf(out,"WM_NCPAINT");
- break;
- case WM_PALETTEISCHANGING:
- sprintf(out,"WM_PALETTEISCHANGING");
- break;
- case WM_PALETTECHANGED:
- sprintf(out,"WM_PALETTECHANGED");
- break;
- case WM_NCACTIVATE:
- sprintf(out,"WM_NCACTIVATE");
- break;
- case WM_NCCALCSIZE:
- sprintf(out,"WM_NCCALCSIZE");
- break;
- case WM_SYSCOMMAND:
- sprintf(out,"WM_SYSCOMMAND");
- break;
- default:
- sprintf(out,"? UNKNOWN ?");
- return(-1);
- }
- return(0);
-}
diff --git a/Generals/Code/Tools/PATCHGET/WINBLOWS.H b/Generals/Code/Tools/PATCHGET/WINBLOWS.H
deleted file mode 100644
index d6a842e1b13..00000000000
--- a/Generals/Code/Tools/PATCHGET/WINBLOWS.H
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-#ifndef WINBLOWS_HEADER
-#define WINBLOWS_HEADER
-
-#define WIN32_LEAN_AND_MEAN
-#include
-#include
-#include
-
-#include"WSTYPES.H"
-
- extern HINSTANCE Global_instance;
- extern LPSTR Global_commandline;
- extern int Global_commandshow;
-
- extern int main(int argc, char *argv[]);
-
- int Print_WM(UINT wm,char *out);
-
-#endif
diff --git a/Generals/Code/Tools/PATCHGET/WSTYPES.H b/Generals/Code/Tools/PATCHGET/WSTYPES.H
deleted file mode 100644
index 6ab69ba0c03..00000000000
--- a/Generals/Code/Tools/PATCHGET/WSTYPES.H
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-/****************************************************************************\
-* C O N F I D E N T I A L --- W E S T W O O D S T U D I O S *
-******************************************************************************
-Project Name:
-File Name : wstypes.h
-Author : Neal Kettler
-Start Date : June 3, 1997
-Last Update : June 17, 1997
-
-Standard type definitions for the sake of portability and readability.
-\***************************************************************************/
-
-#ifndef WTYPES_HEADER
-#define WTYPES_HEADER
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-
-//These are used for readability purposes mostly, when a method takes a
-// pointer or reference these help specify what will happen to the data
-// that is sent in.
-#define IN
-#define OUT
-#define INOUT
-
-typedef char bit8;
-
-
-typedef char sint8;
-typedef unsigned char uint8;
-typedef signed short int sint16;
-typedef unsigned short int uint16;
-typedef signed int sint32;
-typedef unsigned int uint32;
-
-
-#define MAX_BIT8 0x1
-#define MAX_UINT32 0xFFFFFFFF
-#define MAX_UINT16 0xFFFF
-#define MAX_UINT8 0xFF
-#define MAX_SINT32 0x7FFFFFFF
-#define MAX_SINT16 0x7FFF
-#define MAX_SINT8 0x7F
-
-#ifdef _WIN32
-#define strncasecmp _strnicmp
-#define strcasecmp _stricmp
-#endif
-
-#endif
diff --git a/Generals/Code/Tools/PATCHGET/debug.cpp b/Generals/Code/Tools/PATCHGET/debug.cpp
deleted file mode 100644
index 00714e8db70..00000000000
--- a/Generals/Code/Tools/PATCHGET/debug.cpp
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-// FILE: debug.cpp ////////////////////////////////////////////////////////
-// Minmal debug info
-// Author: Matthew D. Campbell, Sept 2002
-
-#include
-#include "debug.h"
-#include
-#include
-
-namespace patchget
-{
-
-char* TheCurrentIgnoreCrashPtr;
-
-#define LARGE_BUFFER 8192
-static char theBuffer[ LARGE_BUFFER ]; // make it big to avoid weird overflow bugs in debug mode
-
-static int doCrashBox(const char *buffer, bool logResult)
-{
- int result;
-
- result = ::MessageBox(NULL, buffer, "Assertion Failure", MB_ABORTRETRYIGNORE|MB_APPLMODAL|MB_ICONWARNING);
-
- switch(result)
- {
- case IDABORT:
-#ifdef DEBUG_LOGGING
- if (logResult)
- DebugLog("[Abort]\n");
-#endif
- _exit(1);
- break;
- case IDRETRY:
-#ifdef DEBUG_LOGGING
- if (logResult)
- DebugLog("[Retry]\n");
-#endif
- ::DebugBreak();
- break;
- case IDIGNORE:
-#ifdef DEBUG_LOGGING
- // do nothing, just keep going
- if (logResult)
- DebugLog("[Ignore]\n");
-#endif
- break;
- }
- return result;
-}
-
-#if defined(DEBUG) || defined(DEBUG_LOGGING)
-
-void DebugLog(const char *fmt, ...)
-{
- va_list va;
- va_start( va, fmt );
- vsnprintf(theBuffer, LARGE_BUFFER, fmt, va );
- theBuffer[LARGE_BUFFER-1] = 0;
- va_end( va );
-
- OutputDebugString(theBuffer);
- printf( "%s", theBuffer );
-}
-
-#endif // defined(DEBUG) || defined(DEBUG_LOGGING)
-
-#ifdef DEBUG_CRASHING
-
-void DebugCrash(const char *format, ...)
-{
- theBuffer[0] = 0;
- strcat(theBuffer, "ASSERTION FAILURE: ");
-
- va_list arg;
- va_start(arg, format);
- vsprintf(theBuffer + strlen(theBuffer), format, arg);
- va_end(arg);
-
- if (strlen(theBuffer) >= sizeof(theBuffer))
- ::MessageBox(NULL, "String too long for debug buffers", "", MB_OK|MB_APPLMODAL);
-
- OutputDebugString(theBuffer);
- printf( "%s", theBuffer );
-
- strcat(theBuffer, "\n\nAbort->exception; Retry->debugger; Ignore->continue\n");
-
- int result = doCrashBox(theBuffer, true);
-
- if (result == IDIGNORE && TheCurrentIgnoreCrashPtr != NULL)
- {
- int yn;
- yn = ::MessageBox(NULL, "Ignore this crash from now on?", "", MB_YESNO|MB_APPLMODAL);
- if (yn == IDYES)
- *TheCurrentIgnoreCrashPtr = 1;
- }
-}
-
-#endif
-
-} // namespace patchget
diff --git a/Generals/Code/Tools/PATCHGET/debug.h b/Generals/Code/Tools/PATCHGET/debug.h
deleted file mode 100644
index fed78bb1555..00000000000
--- a/Generals/Code/Tools/PATCHGET/debug.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-// FILE: debug.h //////////////////////////////////////////////////////////////
-// Minimal debug info
-// Author: Matthew D. Campbell, Sept 2002
-
-#ifndef __DEBUG_H__
-#define __DEBUG_H__
-
-namespace patchget
-{
-
-#if defined(DEBUG) || defined(DEBUG_LOGGING)
-
-void DebugLog( const char *fmt, ... );
-#define DEBUG_LOG(x) DebugLog x
-
-#else // DEBUG
-
-#define DEBUG_LOG(x) {}
-
-#endif // DEBUG
-
-
-#ifdef DEBUG_CRASHING
-
- extern void DebugCrash(const char *format, ...);
-
- /*
- Yeah, it's a sleazy global, since we can't reasonably add
- any args to DebugCrash due to the varargs nature of it.
- We'll just let it slide in this case...
- */
- extern char* TheCurrentIgnoreCrashPtr;
-
- #define DEBUG_CRASH(m) \
- do { \
- { \
- static char ignoreCrash = 0; \
- if (!ignoreCrash) { \
- TheCurrentIgnoreCrashPtr = &ignoreCrash; \
- DebugCrash m ; \
- TheCurrentIgnoreCrashPtr = NULL; \
- } \
- } \
- } while (0)
-
- #define DEBUG_ASSERTCRASH(c, m) do { { if (!(c)) DEBUG_CRASH(m); } } while (0)
-
-#else
-
- #define DEBUG_CRASH(m) ((void)0)
- #define DEBUG_ASSERTCRASH(c, m) ((void)0)
-
-#endif
-
-} // namespace patchget
-
-#endif // __DEBUG_H__
-
diff --git a/Generals/Code/Tools/PATCHGET/registry.cpp b/Generals/Code/Tools/PATCHGET/registry.cpp
deleted file mode 100644
index 1a60c8c913b..00000000000
--- a/Generals/Code/Tools/PATCHGET/registry.cpp
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
-** Command & Conquer Generals(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-// Registry.cpp
-// Simple interface for storing/retreiving registry values
-// Author: Matthew D. Campbell, December 2001
-
-#include
-
-#define WIN32_LEAN_AND_MEAN
-#include
-
-#include "Registry.h"
-
-namespace patchget
-{
-
-bool getStringFromRegistry(HKEY root, std::string path, std::string key, std::string& val)
-{
- HKEY handle;
- unsigned char buffer[256];
- unsigned long size = 256;
- unsigned long type;
- int returnValue;
-
- if ((returnValue = RegOpenKeyEx( root, path.c_str(), 0, KEY_ALL_ACCESS, &handle )) == ERROR_SUCCESS)
- {
- returnValue = RegQueryValueEx(handle, key.c_str(), NULL, &type, (unsigned char *) &buffer, &size);
- RegCloseKey( handle );
- }
-
- if (returnValue == ERROR_SUCCESS)
- {
- val = (char *)buffer;
- return true;
- }
-
- return false;
-}
-
-bool getUnsignedIntFromRegistry(HKEY root, std::string path, std::string key, unsigned int& val)
-{
- HKEY handle;
- unsigned long buffer;
- unsigned long size = sizeof(buffer);
- unsigned long type;
- int returnValue;
-
- if ((returnValue = RegOpenKeyEx( root, path.c_str(), 0, KEY_ALL_ACCESS, &handle )) == ERROR_SUCCESS)
- {
- returnValue = RegQueryValueEx(handle, key.c_str(), NULL, &type, (unsigned char *) &buffer, &size);
- RegCloseKey( handle );
- }
-
- if (returnValue == ERROR_SUCCESS)
- {
- val = buffer;
- return true;
- }
-
- return false;
-}
-
-bool setStringInRegistry( HKEY root, std::string path, std::string key, std::string val)
-{
- HKEY handle;
- unsigned long type;
- unsigned long returnValue;
- int size;
- char lpClass[] = "REG_NONE";
-
- if ((returnValue = RegCreateKeyEx( root, path.c_str(), 0, lpClass, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &handle, NULL )) == ERROR_SUCCESS)
- {
- type = REG_SZ;
- size = val.length()+1;
- returnValue = RegSetValueEx(handle, key.c_str(), 0, type, (unsigned char *)val.c_str(), size);
- RegCloseKey( handle );
- }
-
- return (returnValue == ERROR_SUCCESS);
-}
-
-bool setUnsignedIntInRegistry( HKEY root, std::string path, std::string key, unsigned int val)
-{
- HKEY handle;
- unsigned long type;
- unsigned long returnValue;
- int size;
- char lpClass[] = "REG_NONE";
-
- if ((returnValue = RegCreateKeyEx( root, path.c_str(), 0, lpClass, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &handle, NULL )) == ERROR_SUCCESS)
- {
- type = REG_DWORD;
- size = 4;
- returnValue = RegSetValueEx(handle, key.c_str(), 0, type, (unsigned char *)&val, size);
- RegCloseKey( handle );
- }
-
- return (returnValue == ERROR_SUCCESS);
-}
-
-bool GetStringFromRegistry(std::string path, std::string key, std::string& val)
-{
- std::string fullPath = "SOFTWARE\\Electronic Arts\\EA Games\\Generals";
-
- fullPath.append(path);
- if (getStringFromRegistry(HKEY_LOCAL_MACHINE, fullPath.c_str(), key.c_str(), val))
- {
- return true;
- }
-
- return getStringFromRegistry(HKEY_CURRENT_USER, fullPath.c_str(), key.c_str(), val);
-}
-
-bool GetUnsignedIntFromRegistry(std::string path, std::string key, unsigned int& val)
-{
- std::string fullPath = "SOFTWARE\\Electronic Arts\\EA Games\\Generals";
-
- fullPath.append(path);
- if (getUnsignedIntFromRegistry(HKEY_LOCAL_MACHINE, fullPath.c_str(), key.c_str(), val))
- {
- return true;
- }
-
- return getUnsignedIntFromRegistry(HKEY_CURRENT_USER, fullPath.c_str(), key.c_str(), val);
-}
-
-} // namespace patchget
diff --git a/GeneralsMD/Code/Tools/PATCHGET/CMakeLists.txt b/GeneralsMD/Code/Tools/PATCHGET/CMakeLists.txt
index 9d4f2dde506..e7a9744c6af 100644
--- a/GeneralsMD/Code/Tools/PATCHGET/CMakeLists.txt
+++ b/GeneralsMD/Code/Tools/PATCHGET/CMakeLists.txt
@@ -1,32 +1,8 @@
-set(PATCHGET_SRC
- "CHATAPI.CPP"
- "CHATAPI.H"
- "COMINIT.CPP"
- "COMINIT.H"
- "debug.cpp"
- "debug.h"
- "DownloadManager.cpp"
- "DownloadManager.h"
- "PROCESS.CPP"
- "PROCESS.H"
- "registry.cpp"
- "Registry.h"
- "RESOURCE.H"
- "WINBLOWS.CPP"
- "WINBLOWS.H"
- "WSTYPES.H"
-)
-
macro(setup_patchgrabber appname)
add_executable(${appname} WIN32)
- target_sources(${appname} PRIVATE ${PATCHGET_SRC})
+
target_link_libraries(${appname} PRIVATE
- comctl32
- dbghelplib
- gamespy::gamespy
- imm32
- vfw32
- winmm
+ corei_patchgrabber
z_debug
z_gameengine
z_gameenginedevice
@@ -34,14 +10,6 @@ macro(setup_patchgrabber appname)
z_wwvegas
zi_always
)
-
- target_compile_definitions(${appname} PRIVATE
- $<$:DEBUG_CRASHING>
- )
-
- if(WIN32 OR "${CMAKE_SYSTEM}" MATCHES "Windows")
- target_sources(${appname} PRIVATE SCRIPT1.RC)
- endif()
endmacro()
setup_patchgrabber(z_patchgrabber_en)
diff --git a/GeneralsMD/Code/Tools/PATCHGET/Generals.ico b/GeneralsMD/Code/Tools/PATCHGET/Generals.ico
deleted file mode 100644
index 9112002400e2b62e066b396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ary patch
literal 0
HcmV?d00001
literal 58
fcmZ?rwPJt(Ga#h_#Eft(0hV9^lc>c1|Nj{PN|ppf
diff --git a/GeneralsMD/Code/Tools/PATCHGET/GeneralsFrench.bmp b/GeneralsMD/Code/Tools/PATCHGET/GeneralsFrench.bmp
deleted file mode 100644
index b26c0eb8cd047a78af4484cfe480ae7167c933dd..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 58
fcmZ?rwPJt(Ga#h_#Eft(0hV9^lc>c1|Nj{PN|ppf
diff --git a/GeneralsMD/Code/Tools/PATCHGET/GeneralsGerman.bmp b/GeneralsMD/Code/Tools/PATCHGET/GeneralsGerman.bmp
deleted file mode 100644
index b26c0eb8cd047a78af4484cfe480ae7167c933dd..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 58
fcmZ?rwPJt(Ga#h_#Eft(0hV9^lc>c1|Nj{PN|ppf
diff --git a/GeneralsMD/Code/Tools/PATCHGET/RESOURCE.H b/GeneralsMD/Code/Tools/PATCHGET/RESOURCE.H
deleted file mode 100644
index 235adafbc75..00000000000
--- a/GeneralsMD/Code/Tools/PATCHGET/RESOURCE.H
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
-** Command & Conquer Generals Zero Hour(tm)
-** Copyright 2025 Electronic Arts Inc.
-**
-** This program is free software: you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation, either version 3 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program. If not, see .
-*/
-
-//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// Used by Script1.rc
-//
-#define TXT_ABORT_DOWNLOAD 1
-#define TXT_ABORT 2
-#define TXT_TIME_REMAIN 3
-#define TXT_BYTES_READ 4
-#define TXT_BPS 5
-#define TXT_CANT_CONTACT 6
-#define TXT_ERROR 7
-#define TXT_AN_UPGRADE_AVAILABLE 8
-#define TXT_DOWNLOAD_NOW 9
-#define TXT_DOWNLOADING_FILE 10
-#define TXT_NONE 11
-#define TXT_UPGRADE_AVAILABLE 12
-#define TXT_NO_PATCHES 13
-#define TXT_AUTO_UPDATE 14
-#define TXT_CONNECTING 15
-#define TXT_INSTALL_PROBLEM 16
-#define TXT_API_MISSING 17
-#define TXT_TITLE 18
-#define TXT_REGNOW 19
-#define FTP_StatusIdle 20
-#define FTP_UnknownError 21
-#define FTP_NoSuchServer 22
-#define FTP_CouldNotConnect 23
-#define FTP_LoginFailed 24
-#define FTP_NoSuchFile 25
-#define FTP_LocalFileOpenFailed 26
-#define FTP_TCPError 27
-#define FTP_DisconnectError 28
-#define FTP_StatusNone 29
-#define FTP_StatusConnecting 30
-#define FTP_StatusLoggingIn 31
-#define FTP_StatusFindingFile 32
-#define FTP_StatusQueryingResume 33
-#define FTP_StatusDownloading 34
-#define FTP_StatusFinishing 35
-#define FTP_StatusDone 36
-#define FTP_StatusDisconnecting 37
-#define IDD_CONNECTING 101
-#define IDD_DOWNLOAD_DIALOG 102
-#define IDB_BITMAP1 103
-#define IDB_BITMAP 103
-#define IDI_ICON1 104
-#define IDC_TIMEREM 1001
-#define IDC_BYTESLEFT 1002
-#define IDC_DLABORT 1004
-#define IDC_PROGRESS 1005
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 112
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1006
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
diff --git a/GeneralsMD/Code/Tools/PATCHGET/SCRIPT1.RC b/GeneralsMD/Code/Tools/PATCHGET/SCRIPT1.RC
deleted file mode 100644
index 70f78550b12..00000000000
--- a/GeneralsMD/Code/Tools/PATCHGET/SCRIPT1.RC
+++ /dev/null
@@ -1,669 +0,0 @@
-//Microsoft Developer Studio generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// German (Germany) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)
-#ifdef _WIN32
-LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_CONNECTING DIALOG DISCARDABLE 0, 0, 117, 20
-STYLE DS_ABSALIGN | DS_CENTER | WS_POPUP | WS_THICKFRAME
-FONT 18, "MS Sans Serif"
-BEGIN
- CTEXT "Verbinde mit EA",IDC_STATIC,12,4,93,12,SS_CENTERIMAGE
-END
-
-IDD_DOWNLOAD_DIALOG DIALOG DISCARDABLE 0, 0, 290, 143
-STYLE DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Downloading Patch"
-FONT 8, "MS Sans Serif"
-BEGIN
- PUSHBUTTON "Cancel",IDC_DLABORT,113,122,63,14
- LTEXT "",IDC_TIMEREM,158,83,125,11
- LTEXT "",IDC_BYTESLEFT,7,83,119,11
- CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER,7,
- 99,276,16
- CONTROL 103,IDC_STATIC,"Static",SS_BITMAP | SS_REALSIZEIMAGE |
- SS_SUNKEN,30,7,229,70
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO DISCARDABLE
-BEGIN
- IDD_CONNECTING, DIALOG
- BEGIN
- LEFTMARGIN, 5
- RIGHTMARGIN, 112
- TOPMARGIN, 4
- BOTTOMMARGIN, 16
- END
-
- IDD_DOWNLOAD_DIALOG, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 283
- TOPMARGIN, 7
- BOTTOMMARGIN, 136
- END
-END
-#endif // APSTUDIO_INVOKED
-
-
-#ifndef _MAC
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,1
- PRODUCTVERSION 1,0,0,1
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x40004L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040704b0"
- BEGIN
- VALUE "Comments", "\0"
- VALUE "CompanyName", "Electronic Arts\0"
- VALUE "FileDescription", "patchgrabber\0"
- VALUE "FileVersion", "1, 0, 0, 1\0"
- VALUE "InternalName", "patchgrabber\0"
- VALUE "LegalCopyright", "Copyright � 2002\0"
- VALUE "LegalTrademarks", "\0"
- VALUE "OriginalFilename", "patchgrabber.exe\0"
- VALUE "PrivateBuild", "\0"
- VALUE "ProductName", "Electronic Arts patchgrabber\0"
- VALUE "ProductVersion", "1, 0, 0, 1\0"
- VALUE "SpecialBuild", "\0"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x407, 1200
- END
-END
-
-#endif // !_MAC
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Bitmap
-//
-
-IDB_BITMAP BITMAP DISCARDABLE "GeneralsGerman.bmp"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDI_ICON1 ICON DISCARDABLE "Generals.ico"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE DISCARDABLE
-BEGIN
- TXT_ABORT_DOWNLOAD "Sind Sie sicher, da� Sie das Download abbrechen m�chten?"
- TXT_ABORT "Abbrechen"
- TXT_TIME_REMAIN "Verbleibende Zeit: %d:%02d"
- TXT_BYTES_READ "Gelesene Bytes: %d von %d"
- TXT_BPS "Bytes pro Sekunde: %d"
- TXT_CANT_CONTACT "Verbindung zum Electronic Arts-Update-Server konnte nicht hergestellt werden."
- TXT_ERROR "Fehler"
- TXT_AN_UPGRADE_AVAILABLE "Ein Upgrade ist verf�gbar."
- TXT_DOWNLOAD_NOW "M�chten Sie es jetzt herunterladen?"
- TXT_DOWNLOADING_FILE "Datei %d von %d wird heruntergeladen ..."
- TXT_NONE """"""
- TXT_UPGRADE_AVAILABLE "Upgrade verf�gbar"
- TXT_NO_PATCHES "F�r dieses Produkt gibt es z.Z. kein Patch."
- TXT_AUTO_UPDATE "Auto-Update:"
- TXT_CONNECTING "Verbinde ..."
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- TXT_INSTALL_PROBLEM "Das Spiel ist nicht korrekt installiert. M�glicherweise m�ssen Sie erneut installieren."
- TXT_TITLE "Electronic Arts Auto-Patch"
- TXT_REGNOW "M�chten Sie sich bei Generals Online registrieren?"
-END
-
-#endif // German (Germany) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_CONNECTING DIALOG DISCARDABLE 0, 0, 117, 21
-STYLE DS_ABSALIGN | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU |
- WS_THICKFRAME
-FONT 18, "MS Sans Serif"
-BEGIN
- CTEXT "Connecting to EA",IDC_STATIC,5,4,107,13,SS_CENTERIMAGE
-END
-
-IDD_DOWNLOAD_DIALOG DIALOG DISCARDABLE 0, 0, 290, 143
-STYLE DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Downloading Patch"
-FONT 8, "MS Sans Serif"
-BEGIN
- PUSHBUTTON "Cancel",IDC_DLABORT,113,122,63,14
- LTEXT "",IDC_TIMEREM,158,83,125,11
- LTEXT "",IDC_BYTESLEFT,7,83,119,11
- CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER,7,
- 99,276,16
- CONTROL 103,IDC_STATIC,"Static",SS_BITMAP | SS_REALSIZEIMAGE |
- SS_SUNKEN,30,7,229,70
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO DISCARDABLE
-BEGIN
- IDD_CONNECTING, DIALOG
- BEGIN
- LEFTMARGIN, 5
- RIGHTMARGIN, 112
- TOPMARGIN, 4
- BOTTOMMARGIN, 17
- END
-
- IDD_DOWNLOAD_DIALOG, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 283
- TOPMARGIN, 7
- BOTTOMMARGIN, 136
- END
-END
-#endif // APSTUDIO_INVOKED
-
-
-#ifndef _MAC
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,1
- PRODUCTVERSION 1,0,0,1
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x40004L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0"
- BEGIN
- VALUE "Comments", "\0"
- VALUE "CompanyName", "Electronic Arts\0"
- VALUE "FileDescription", "patchgrabber\0"
- VALUE "FileVersion", "1, 0, 0, 1\0"
- VALUE "InternalName", "patchgrabber\0"
- VALUE "LegalCopyright", "Copyright � 2002\0"
- VALUE "LegalTrademarks", "\0"
- VALUE "OriginalFilename", "patchgrabber.exe\0"
- VALUE "PrivateBuild", "\0"
- VALUE "ProductName", "Electronic Arts patchgrabber\0"
- VALUE "ProductVersion", "1, 0, 0, 1\0"
- VALUE "SpecialBuild", "\0"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
-END
-
-#endif // !_MAC
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Bitmap
-//
-
-IDB_BITMAP BITMAP DISCARDABLE "GeneralsEnglish.bmp"
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE DISCARDABLE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE DISCARDABLE
-BEGIN
- "#include ""afxres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE DISCARDABLE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDI_ICON1 ICON DISCARDABLE "Generals.ico"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE DISCARDABLE
-BEGIN
- TXT_ABORT_DOWNLOAD "Are you sure you want to abort the download?"
- TXT_ABORT "Abort"
- TXT_TIME_REMAIN "Time Remaining: %d:%02d"
- TXT_BYTES_READ "Bytes Read: %d of %d"
- TXT_BPS "Bytes Per Second: %d"
- TXT_CANT_CONTACT "Unable to contact the Electronic Arts update server."
- TXT_ERROR "Error"
- TXT_AN_UPGRADE_AVAILABLE "There is an upgrade available."
- TXT_DOWNLOAD_NOW "Would you like to download it now?"
- TXT_DOWNLOADING_FILE "Downloading file %d of %d..."
- TXT_NONE """"""
- TXT_UPGRADE_AVAILABLE "Upgrade Available"
- TXT_NO_PATCHES "There aren't any patches for this product right now."
- TXT_AUTO_UPDATE "Auto-Update:"
- TXT_CONNECTING "Connecting..."
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- TXT_INSTALL_PROBLEM "The game does not appear to be installed properly. You may need to re-install."
- TXT_TITLE "Electronic Arts Auto-Patch"
- TXT_REGNOW "Would you like to register with Generals Online?"
- FTP_StatusIdle "Idle"
- FTP_UnknownError "Unknown Error"
- FTP_NoSuchServer "Server not found"
- FTP_CouldNotConnect "Could not connect"
- FTP_LoginFailed "Login failed"
- FTP_NoSuchFile "File not found"
- FTP_LocalFileOpenFailed "Could not write the file to disk"
- FTP_TCPError "Network Error"
- FTP_DisconnectError "Connection to server was lost."
- FTP_StatusNone "Idle"
- FTP_StatusConnecting "Connecting..."
- FTP_StatusLoggingIn "Logging in..."
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- FTP_StatusFindingFile "Finding file..."
- FTP_StatusQueryingResume "Attempting to resume download..."
- FTP_StatusDownloading "Downloading..."
- FTP_StatusFinishing "Finishing..."
- FTP_StatusDone "Done."
- FTP_StatusDisconnecting "Disconnecting..."
-END
-
-#endif // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-/////////////////////////////////////////////////////////////////////////////
-// French (France) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
-#ifdef _WIN32
-LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_CONNECTING DIALOG DISCARDABLE 0, 0, 117, 20
-STYLE DS_ABSALIGN | DS_CENTER | WS_POPUP | WS_THICKFRAME
-FONT 18, "MS Sans Serif"
-BEGIN
- CTEXT "Connexion � EA",IDC_STATIC,12,4,93,12,SS_CENTERIMAGE
-END
-
-IDD_DOWNLOAD_DIALOG DIALOG DISCARDABLE 0, 0, 290, 143
-STYLE DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Downloading Patch"
-FONT 8, "MS Sans Serif"
-BEGIN
- PUSHBUTTON "Cancel",IDC_DLABORT,113,122,63,14
- LTEXT "",IDC_TIMEREM,158,83,125,11
- LTEXT "",IDC_BYTESLEFT,7,83,119,11
- CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER,7,
- 99,276,16
- CONTROL 103,IDC_STATIC,"Static",SS_BITMAP | SS_REALSIZEIMAGE |
- SS_SUNKEN,30,7,229,70
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO DISCARDABLE
-BEGIN
- IDD_CONNECTING, DIALOG
- BEGIN
- LEFTMARGIN, 5
- RIGHTMARGIN, 112
- TOPMARGIN, 4
- BOTTOMMARGIN, 16
- END
-
- IDD_DOWNLOAD_DIALOG, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 283
- TOPMARGIN, 7
- BOTTOMMARGIN, 136
- END
-END
-#endif // APSTUDIO_INVOKED
-
-
-#ifndef _MAC
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,1
- PRODUCTVERSION 1,0,0,1
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x40004L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040c04b0"
- BEGIN
- VALUE "Comments", "\0"
- VALUE "CompanyName", "Electronic Arts\0"
- VALUE "FileDescription", "patchgrabber\0"
- VALUE "FileVersion", "1, 0, 0, 1\0"
- VALUE "InternalName", "patchgrabber\0"
- VALUE "LegalCopyright", "Copyright � 2002\0"
- VALUE "LegalTrademarks", "\0"
- VALUE "OriginalFilename", "patchgrabber.exe\0"
- VALUE "PrivateBuild", "\0"
- VALUE "ProductName", "Electronic Arts patchgrabber\0"
- VALUE "ProductVersion", "1, 0, 0, 1\0"
- VALUE "SpecialBuild", "\0"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x40c, 1200
- END
-END
-
-#endif // !_MAC
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Bitmap
-//
-
-IDB_BITMAP BITMAP DISCARDABLE "GeneralsFrench.bmp"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDI_ICON1 ICON DISCARDABLE "Generals.ico"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE DISCARDABLE
-BEGIN
- TXT_ABORT_DOWNLOAD "Confirmer abandon du t�l�chargement ?"
- TXT_ABORT "Abandon"
- TXT_TIME_REMAIN "Temps restant : %d:%02d"
- TXT_BYTES_READ "Octets lus : %d sur %d"
- TXT_BPS "Octets/seconde : %d"
- TXT_CANT_CONTACT "La connexion au serveur de mise � jour de Electronic Arts a �chou�."
- TXT_ERROR "Erreur"
- TXT_AN_UPGRADE_AVAILABLE "Une mise � jour est disponible."
- TXT_DOWNLOAD_NOW "Voulez-vous la t�l�charger maintenant ?"
- TXT_DOWNLOADING_FILE "T�l�chargement du fichier %d sur %d..."
- TXT_NONE """"""
- TXT_UPGRADE_AVAILABLE "Mise � jour disponible"
- TXT_NO_PATCHES "Aucun patch n'est disponible pour ce produit."
- TXT_AUTO_UPDATE "Mise � jour automatique :"
- TXT_CONNECTING "Connexion..."
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- TXT_INSTALL_PROBLEM "L'installation du jeu a �chou�. Il est pr�f�rable de recommencer l'op�ration."
- TXT_TITLE "Patch automatique de Electronic Arts"
- TXT_REGNOW "Voulez-vous vous inscrire � Generals Online ?"
-END
-
-#endif // French (France) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-/////////////////////////////////////////////////////////////////////////////
-// Spanish (Modern) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ESN)
-#ifdef _WIN32
-LANGUAGE LANG_SPANISH, SUBLANG_SPANISH_MODERN
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_CONNECTING DIALOG DISCARDABLE 0, 0, 117, 20
-STYLE DS_ABSALIGN | DS_CENTER | WS_POPUP | WS_THICKFRAME
-FONT 18, "MS Sans Serif"
-BEGIN
- CTEXT "Connectando con EA",IDD_CONNECTING,12,4,93,12,
- SS_CENTERIMAGE
-END
-
-IDD_DOWNLOAD_DIALOG DIALOG DISCARDABLE 0, 0, 290, 143
-STYLE DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Descargando Parche"
-FONT 8, "MS Sans Serif"
-BEGIN
- PUSHBUTTON "Cancelar",IDC_DLABORT,113,122,63,14
- LTEXT "",IDC_TIMEREM,158,83,125,11
- LTEXT "",IDC_BYTESLEFT,7,83,119,11
- CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER,7,
- 99,276,16
- CONTROL 103,IDC_STATIC,"Static",SS_BITMAP | SS_REALSIZEIMAGE |
- SS_SUNKEN,30,7,229,70
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO DISCARDABLE
-BEGIN
- IDD_CONNECTING, DIALOG
- BEGIN
- LEFTMARGIN, 5
- RIGHTMARGIN, 112
- TOPMARGIN, 4
- BOTTOMMARGIN, 16
- END
-
- IDD_DOWNLOAD_DIALOG, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 283
- TOPMARGIN, 7
- BOTTOMMARGIN, 136
- END
-END
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Bitmap
-//
-
-IDB_BITMAP BITMAP DISCARDABLE "GeneralsEnglish.bmp"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDI_ICON1 ICON DISCARDABLE "Generals.ico"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE DISCARDABLE
-BEGIN
- TXT_ABORT_DOWNLOAD "�Seguro que quieres abortar la descarga?"
- TXT_ABORT "Abortar"
- TXT_TIME_REMAIN "Tiempo Restante: %d:%02d"
- TXT_BYTES_READ "Bytes Le�dos: %d of %d"
- TXT_BPS "Bytes Por Segundo: %d"
- TXT_CANT_CONTACT "No se puede contactar con el servidor de actualizaciones de Electronic Arts."
- TXT_ERROR "Error"
- TXT_AN_UPGRADE_AVAILABLE "Hay una actualizaci�n disponible."
- TXT_DOWNLOAD_NOW "�Quieres descargarla ahora?"
- TXT_DOWNLOADING_FILE "Descargando el archivo %d de %d..."
- TXT_NONE """"""
- TXT_UPGRADE_AVAILABLE "Actualizaci�n Disponible"
- TXT_NO_PATCHES "No hay parches disponibles para este producto."
- TXT_AUTO_UPDATE "Auto-Actualizaci�n:"
- TXT_CONNECTING "Conectando..."
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- TXT_INSTALL_PROBLEM "El juego parece no estar correctamente instalado. Puedes necesitar reinstalarlo."
- TXT_TITLE "Auto-Parche Electronic Arts"
- TXT_REGNOW "�Quieres registrarte a trav�s de Generals Online?"
-END
-
-#endif // Spanish (Modern) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-