Initial commit of Command & Conquer Renegade source code.

This commit is contained in:
LFeenanEA
2025-02-27 16:39:46 +00:00
parent 74ab8fa5e0
commit 58ed459113
4918 changed files with 1366710 additions and 0 deletions

View File

@@ -0,0 +1,143 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/CardSelectionDialog.cpp $ *
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 11/09/01 1:07p $*
* *
* $Revision:: 3 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// Includes.
#include "CardSelectionDialog.h"
#include "ErrorHandler.h"
#include "ListCtrl.h"
#include "MessageBox.h"
#include "RDDesc.h"
#include "Translator.h"
/***********************************************************************************************
* CardSelectionDialogClass::On_Init_Dialog -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void CardSelectionDialogClass::On_Init_Dialog (void)
{
ListCtrlClass *listctrl;
int e;
listctrl = Get_Dlg_Item (IDC_CARD_SELECTION_LIST)->As_ListCtrlClass();
listctrl->Add_Column (L"", 1.0f, Vector3 (1.0f, 1.0f, 1.0f));
e = 0;
for (int d = 0; d < WW3D::Get_Render_Device_Count(); d++) {
listctrl->Insert_Entry (e, WideStringClass (WW3D::Get_Render_Device_Name (d)));
e++;
}
listctrl->Set_Curr_Sel (0);
MenuDialogClass::On_Init_Dialog();
// Show message to indicate that the user's last video card selection was unsuccessful?
if (ShowMessage) {
MessageBoxClass::Do_Dialog (TxWideStringClass (IDS_WARNING), TxWideStringClass (IDS_CANNOT_INITIALIZE_THIS_D3D_DEVICE), MessageBoxClass::MESSAGE_BOX_TYPE_OK, this);
}
}
/***********************************************************************************************
* CardSelectionDialogClass::Callback -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void CardSelectionDialogClass::Callback (int id, PopupDialogClass *popup)
{
switch (id) {
case IDC_BUTTON_YES:
CancelApplication = true;
End_Dialog();
break;
default:
break;
}
}
/***********************************************************************************************
* CardSelectionDialogClass::On_Command -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void CardSelectionDialogClass::On_Command (int ctrl_id, int message_id, DWORD param)
{
switch (ctrl_id)
{
case IDCANCEL:
MessageBoxClass::Do_Dialog (TxWideStringClass (IDS_EXIT_SETUP), TxWideStringClass (IDS_PROMPT_EXIT_SETUP), MessageBoxClass::MESSAGE_BOX_TYPE_YES_NO, this);
return;
case IDOK:
{
ListCtrlClass *listctrl;
listctrl = Get_Dlg_Item (IDC_CARD_SELECTION_LIST)->As_ListCtrlClass();
CardSelection = listctrl->Get_Curr_Sel();
End_Dialog();
}
default:
break;
}
MenuDialogClass::On_Command (ctrl_id, message_id, param);
}

View File

@@ -0,0 +1,70 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/CardSelectionDialog.h $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 11/08/01 10:57p $*
* *
* $Revision:: 3 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef _CARD_SELECTION_DIALOG_H
#define _CARD_SELECTION_DIALOG_H
// Includes.
#include "MenuDialog.h"
#include "Resource.h"
#include "MessageBox.h"
#include "WW3D.h"
// Classes.
class CardSelectionDialogClass : public CallbackMenuDialogClass
{
public:
CardSelectionDialogClass (bool showmessage) : CallbackMenuDialogClass (IDD_DIALOG_CARD_SELECTION), CardSelection (-1), CancelApplication (false), ShowMessage (showmessage) {}
~CardSelectionDialogClass() {}
void On_Command (int ctrl_id, int message_id, DWORD param);
void Callback (int id, PopupDialogClass *popup);
int Get_Card_Count() {return (WW3D::Get_Render_Device_Count());}
int Get_Card_Selection() {return (CardSelection);}
bool Cancel_Application() {return (CancelApplication);}
protected:
void On_Init_Dialog (void);
int CardSelection;
bool CancelApplication;
bool ShowMessage;
};
#endif // _CARD_SELECTION_DIALOG_H

View File

@@ -0,0 +1,47 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/CodeControl.h $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 1/14/02 9:27p $*
* *
* $Revision:: 5 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef _CODE_CONTROL_H
#define _CODE_CONTROL_H
// Code controlling defines.
// NOTE: Set ALL of the following defines to zero in the final release build.
#define USE_QA_SERIAL_NOS 0 // Use a set of nos. for QA testing (as opposed to serial nos. for general release).
#define PERMIT_INSTALL_FROM_NETWORK 0 // Let users install from any drive (if -N is on command line).
#define VERBOSE_ERROR_MESSAGES 0 // Add filename and line no. to fatal error messages.
#endif // _CODE_CONTROL_H

View File

@@ -0,0 +1,591 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/CopyDialog.cpp $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 1/12/02 7:32p $*
* *
* $Revision:: 15 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// Includes.
#include "CopyDialog.h"
#include "AssetMgr.h"
#include "Camera.h"
#include "DialogControl.h"
#include "DialogMgr.h"
#include "DialogText.h"
#include "ErrorHandler.h"
#include "Hanim.h"
#include "Installer.h"
#include "Light.h"
#include "MenuBackdrop.h"
#include "Resource.h"
#include "Scene.h"
#include "Translator.h"
#include "ViewerCtrl.h"
#include "Ww3D.h"
#include "WWAudio.h"
// Defines.
#define MODEL_COUNT 13
#define MODEL_DISPLAY_TIME 22000 // Display time for each model (in milliseconds).
// Static data.
static const char *_ModelNames [MODEL_COUNT] = {"C_AG_GDI_MG",
"C_AG_GDI_MGO",
"C_AG_NOD_MG",
"C_AG_GDI_LOCKE",
"C_AG_NOD_SAKU",
"IGM_PIST",
"IGM_SNIP",
"IGM_C4-R",
"VDC_GDI_HUMVEE",
"V_GDI_MEDTNK",
"V_NOD_TURRET",
"V_GDI_ORCA",
"ENC_GPWR"
};
static const char *_AnimNames [MODEL_COUNT] = {"S_A_HUMAN.H_A_A0A1",
"S_A_HUMAN.H_A_A0B1",
"S_A_HUMAN.H_A_A0A1",
"S_A_HUMAN.H_A_A0B1",
"S_B_HUMAN.H_B_A0A0_13",
"",
"",
"",
"",
"",
"",
"V_GDI_ORCA.V_GDI_ORCA",
""
};
static const int _ModelHeadings [MODEL_COUNT] = {IDS_GDI_SOLDIER_HEADING,
IDS_GDI_OFFICER_HEADING,
IDS_NOD_SOLDIER_HEADING,
IDS_LOCKE_HEADING,
IDS_SAKURA_HEADING,
IDS_PISTOL_HEADING,
IDS_SNIPER_RIFLE_HEADING,
IDS_REMOTE_C4_HEADING,
IDS_GDI_HUMM_VEE_HEADING,
IDS_GDI_MEDIUM_TANK_HEADING,
IDS_NOD_TURRET_HEADING,
IDS_GDI_ORCA_HEADING,
IDS_GDI_POWER_PLANT_HEADING
};
static const int _ModelDescriptions [MODEL_COUNT] = {IDS_GDI_SOLDIER_DESCRIPTION,
IDS_GDI_OFFICER_DESCRIPTION,
IDS_NOD_SOLDIER_DESCRIPTION,
IDS_LOCKE_DESCRIPTION,
IDS_SAKURA_DESCRIPTION,
IDS_PISTOL_DESCRIPTION,
IDS_SNIPER_RIFLE_DESCRIPTION,
IDS_REMOTE_C4_DESCRIPTION,
IDS_GDI_HUMM_VEE_DESCRIPTION,
IDS_GDI_MEDIUM_TANK_DESCRIPTION,
IDS_NOD_TURRET_DESCRIPTION,
IDS_GDI_ORCA_DESCRIPTION,
IDS_GDI_POWER_PLANT_DESCRIPTION
};
/***********************************************************************************************
* CopyDialogClass::CopyDialogClass -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
CopyDialogClass::CopyDialogClass()
: InstallMenuDialogClass (IDD_DIALOG_COPY),
SupplementalModel (NULL),
ProgressBarModel (NULL),
ProgressBarAnim (NULL),
CurrentModel (0),
CountdownTimer (NULL),
FlashTimer (NULL),
FileSystemErrorPopup (NULL),
AddedModels (false)
{
}
/***********************************************************************************************
* CopyDialogClass::On_Init_Dialog -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void CopyDialogClass::On_Init_Dialog (void)
{
WideStringClass sourcepath;
ViewerCtrlClass *viewercontrol = Get_Dlg_Item (IDC_COPY_VIEWER)->As_ViewerCtrlClass();
// Disable the OK button until copying is complete.
Enable_Dlg_Item (IDOK, false);
// Configure the W3D elements.
viewercontrol->Set_Background_Visible (false);
Add_Models();
// Start the copy thread.
CopyThread = new CopyThreadClass (_Installer.Get_Total_Size (false));
CopyThread->Execute();
CountdownTimer = new CDTimerClass <SafeTimerClass> (MODEL_DISPLAY_TIME);
InstallMenuDialogClass::On_Init_Dialog();
}
/***********************************************************************************************
* CopyDialogClass::On_Activate -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void CopyDialogClass::On_Activate (bool onoff)
{
if (onoff) {
AIL_set_preference (DIG_DS_MIX_FRAGMENT_CNT, 64);
AIL_serve();
} else {
AIL_set_preference (DIG_DS_MIX_FRAGMENT_CNT, 8);
}
InstallMenuDialogClass::On_Activate (onoff);
}
/***********************************************************************************************
* CopyDialogClass::On_Frame_Update -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void CopyDialogClass::On_Frame_Update (void)
{
WideStringClass statusmessage;
DialogTextClass *statustext1, *statustext2;
// Set both status lines with the status message. By default, use the small text for display.
CopyThread->Get_Status_Message (statusmessage);
statustext1 = Get_Dlg_Item (IDC_COPY_STATUS1)->As_DialogTextClass();
statustext2 = Get_Dlg_Item (IDC_COPY_STATUS2)->As_DialogTextClass();
// Update the copy status.
switch (CopyThread->Get_Status()) {
case CopyThreadClass::STATUS_OK:
{
float fraction, framecount;
char percentagestring [10];
Add_Models();
// Advance to next model if timer has 'gone off'.
if (CountdownTimer->Value() == 0) {
CurrentModel = (CurrentModel + 1) % MODEL_COUNT;
Set_Model (CurrentModel);
delete CountdownTimer;
CountdownTimer = new CDTimerClass <SafeTimerClass> (MODEL_DISPLAY_TIME);
}
// Update the progress bar.
statustext1->Set_Text (statusmessage);
statustext2->Set_Text (L"");
framecount = ProgressBarModel->Peek_Animation()->Get_Num_Frames();
fraction = CopyThread->Get_Fraction_Complete();
ProgressBarModel->Set_Animation (ProgressBarAnim, fraction * (framecount - 1), RenderObjClass::ANIM_MODE_MANUAL);
percentagestring [sizeof (percentagestring) - 1] = '\0';
_snprintf (percentagestring, sizeof (percentagestring) - 1, "%u%%", (unsigned) (fraction * 100.0f));
Set_Dlg_Item_Text (IDC_COPY_PERCENTAGE, WideStringClass (percentagestring));
break;
}
case CopyThreadClass::STATUS_ERROR:
FileSystemErrorPopup = MessageBoxClass::Create_Dialog (TxWideStringClass (IDS_APPLICATION_ERROR), TxWideStringClass (IDS_FILE_SYSTEM_ERROR), MessageBoxClass::MESSAGE_BOX_TYPE_RETRY_QUIT, this);
CountdownTimer->Stop();
break;
case CopyThreadClass::STATUS_SUCCESS:
Remove_Models();
// Advance to next model if timer has 'gone off'.
if (CountdownTimer->Value() == 0) {
CurrentModel = (CurrentModel + 1) % MODEL_COUNT;
Set_Model (CurrentModel);
delete CountdownTimer;
CountdownTimer = new CDTimerClass <SafeTimerClass> (MODEL_DISPLAY_TIME);
}
if (FlashTimer == NULL) {
FlashTimer = new TTimerClass <SafeTimerClass>;
// Allow the user to continue by enabling the OK button.
Enable_Dlg_Item (IDOK, true);
}
// Flash the status message in large text.
statustext1->Set_Text (L"");
Set_Dlg_Item_Text (IDC_COPY_PERCENTAGE, L"");
if (((FlashTimer->Value() / 1000) % 3) == 0) {
statustext2->Set_Text (statusmessage);
} else {
statustext2->Set_Text (L"");
}
break;
case CopyThreadClass::STATUS_ABORTED:
Remove_Models();
// Use the large text to display the status message.
statustext1->Set_Text (L"");
statustext2->Set_Text (statusmessage);
// Cancel this dialog if the copy thread has terminated.
if (!CopyThread->Is_Running()) {
MenuDialogClass::On_Command (IDCANCEL, 0, 0);
// NOTE: Must return because this object may have already been deleted.
return;
}
break;
case CopyThreadClass::STATUS_FAILURE:
{
WideStringClass errormessage;
// A fatal error has occurred.
CopyThread->Get_Error_Message (errormessage);
throw (errormessage);
}
default:
break;
}
InstallMenuDialogClass::On_Frame_Update();
}
/***********************************************************************************************
* CopyDialogClass::Add_Models -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void CopyDialogClass::Add_Models()
{
if (!AddedModels) {
const char *supplementalmodelname = "IN_COPYGIZMO";
const char *supplementalanimname = "IN_COPYGIZMO.IN_COPYGIZMO";
const char *progressbarmodelname = "IN_PROGRESS";
const char *progressbaranimname = "IN_PROGRESS.IN_PROGRESS";
HAnimClass *supplementalanim;
SupplementalModel = WW3DAssetManager::Get_Instance()->Create_Render_Obj (supplementalmodelname);
if (SupplementalModel != NULL) {
Get_BackDrop()->Peek_Scene()->Add_Render_Object (SupplementalModel);
supplementalanim = WW3DAssetManager::Get_Instance()->Get_HAnim (supplementalanimname);
if (supplementalanim != NULL) {
SupplementalModel->Set_Animation (supplementalanim, 0, RenderObjClass::ANIM_MODE_LOOP);
REF_PTR_RELEASE (supplementalanim);
}
}
ProgressBarModel = WW3DAssetManager::Get_Instance()->Create_Render_Obj (progressbarmodelname);
if (ProgressBarModel != NULL) {
Get_BackDrop()->Peek_Scene()->Add_Render_Object (ProgressBarModel);
ProgressBarAnim = WW3DAssetManager::Get_Instance()->Get_HAnim (progressbaranimname);
if (ProgressBarAnim != NULL) {
ProgressBarModel->Set_Animation (ProgressBarAnim, 0, RenderObjClass::ANIM_MODE_MANUAL);
}
}
Set_Model (CurrentModel);
AddedModels = true;
}
}
/***********************************************************************************************
* CopyDialogClass::Set_Model -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void CopyDialogClass::Set_Model (unsigned modelindex)
{
const float rotationrate = 45.0f;
// Set the appropriate model, animation and interface for the viewer.
ViewerCtrlClass *viewercontrol = Get_Dlg_Item (IDC_COPY_VIEWER)->As_ViewerCtrlClass();
Set_Dlg_Item_Text (IDC_COPY_HEADER, TxWideStringClass (_ModelHeadings [modelindex]));
Set_Dlg_Item_Text (IDC_COPY_DESCRIPTION, TxWideStringClass (_ModelDescriptions [modelindex]));
viewercontrol->Set_Model (_ModelNames [modelindex]);
viewercontrol->Set_Animation (_AnimNames [modelindex]);
viewercontrol->Set_Interface_Mode (ViewerCtrlClass::Z_ROTATION, rotationrate);
// Traverse the model...
for (int index = 0; index < viewercontrol->Peek_Model()->Get_Num_Sub_Objects(); index++) {
RenderObjClass *sub_obj = viewercontrol->Peek_Model()->Get_Sub_Object (index);
// Hide muzzle flashes - they are not appropriate in this context.
if (::strstr (sub_obj->Get_Name(), "MUZZLEFLASH") != NULL) {
sub_obj->Set_Hidden (true);
}
// Hide flares - the rendering system has not been initialized.
if (sub_obj->Class_ID() == RenderObjClass::CLASSID_DAZZLE) {
sub_obj->Set_Hidden (true);
}
REF_PTR_RELEASE (sub_obj);
}
}
/***********************************************************************************************
* CopyDialogClass::Remove_Models -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void CopyDialogClass::Remove_Models()
{
if (AddedModels) {
REF_PTR_RELEASE (ProgressBarAnim);
ProgressBarModel->Remove();
REF_PTR_RELEASE (ProgressBarModel);
SupplementalModel->Remove();
REF_PTR_RELEASE (SupplementalModel);
AddedModels = false;
}
}
/***********************************************************************************************
* CopyDialogClass::End_Dialog -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void CopyDialogClass::End_Dialog (void)
{
Remove_Models();
// Wait for copy thread to terminate (in case it hasn't finished yet).
while (CopyThread->Is_Running()) {
Sleep (50);
}
delete CopyThread;
AIL_set_preference (DIG_DS_MIX_FRAGMENT_CNT, 8);
if (CountdownTimer != NULL) delete CountdownTimer;
if (FlashTimer != NULL) delete FlashTimer;
InstallMenuDialogClass::End_Dialog();
}
/***********************************************************************************************
* CopyDialogClass::Callback -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void CopyDialogClass::Callback (int id, PopupDialogClass *popup)
{
if (popup == FileSystemErrorPopup) {
switch (id) {
case IDC_BUTTON_RETRY:
CopyThread->Set_Status (CopyThreadClass::STATUS_RETRY);
REF_PTR_RELEASE (popup);
CountdownTimer->Start();
break;
case IDC_BUTTON_QUIT:
CopyThread->Set_Status (CopyThreadClass::STATUS_QUIT);
REF_PTR_RELEASE (popup);
CountdownTimer->Start();
break;
default:
break;
}
} else {
switch (id) {
case IDC_BUTTON_YES:
CopyThread->Set_Abort (true);
CountdownTimer->Start();
break;
case IDC_BUTTON_NO:
case IDCANCEL:
case IDOK:
CopyThread->Set_Abort (false);
CountdownTimer->Start();
break;
default:
break;
}
}
// NOTE: Do not call base callback - this function replaces base callback functionality.
}
/***********************************************************************************************
* CopyDialogClass::On_Command -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void CopyDialogClass::On_Command (int ctrl_id, int message_id, DWORD param)
{
switch (ctrl_id) {
case IDOK:
// If the OK button has been disabled throw away this message.
if (!Is_Dlg_Item_Enabled (IDOK)) return;
break;
case IDCANCEL:
// If the copy process has already finished then cancel immediately.
if (!CopyThread->Is_Running()) {
MenuDialogClass::On_Command (IDCANCEL, 0, 0);
return;
} else {
// Can the user cancel?
// NOTE: User will not be able to cancel if the copying process is uninterruptable because,
// for example, it is updating the registry.
if (!CopyThread->Can_Abort (true)) {
CopyThread->Set_Abort (false);
return;
}
CountdownTimer->Stop();
}
default:
break;
}
InstallMenuDialogClass::On_Command (ctrl_id, message_id, param);
}

View File

@@ -0,0 +1,89 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/CopyDialog.h $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 1/12/02 7:32p $*
* *
* $Revision:: 9 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef _COPY_DIALOG_H
#define _COPY_DIALOG_H
// Includes.
#include "CopyThread.h"
#include "InstallMenuDialog.h"
#include "Mutex.h"
#include "SafeTimer.h"
#include "Timer.h"
// Forward declarations.
class LightClass;
class HAnimClass;
// Dialog to give feedback to user about the state of the copying process.
class CopyDialogClass : public InstallMenuDialogClass
{
public:
CopyDialogClass();
~CopyDialogClass() {}
// RTTI.
void *As_CopyDialogClass() {return (this);}
bool Was_Successful() {return (CopyThread->Get_Status() == CopyThreadClass::STATUS_SUCCESS);}
void End_Dialog (void);
void Callback (int id, PopupDialogClass *popup);
void On_Command (int ctrl_id, int message_id, DWORD param);
protected:
void On_Init_Dialog (void);
void On_Activate (bool onoff);
void On_Frame_Update (void);
void Add_Models();
void Set_Model (unsigned modelindex);
void Remove_Models();
CopyThreadClass *CopyThread; // A thread to copy files.
RenderObjClass *SupplementalModel; // Additional model to show in background.
RenderObjClass *ProgressBarModel;
HAnimClass *ProgressBarAnim;
unsigned CurrentModel; // Index of model to display.
CDTimerClass <SafeTimerClass> *CountdownTimer;
TTimerClass <SafeTimerClass> *FlashTimer;
MessageBoxClass *FileSystemErrorPopup;
bool AddedModels;
};
#endif // _COPY_DIALOG_H

File diff suppressed because it is too large Load Diff

122
Code/Installer/CopyThread.h Normal file
View File

@@ -0,0 +1,122 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/CopyThread.h $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 1/10/02 6:34p $*
* *
* $Revision:: 7 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef _COPY_THREAD_H
#define _COPY_THREAD_H
// Includes.
#include "Thread.h"
#include "Win.h"
#include "WWString.h"
#include "WideString.h"
// Class to implement a worker thread that will execute the file copying process.
// NOTE: Thread usage will ensure that copying does not stall the copy dialog.
class CopyThreadClass : public ThreadClass
{
public:
enum StatusEnum {
STATUS_OK,
STATUS_RETRY = STATUS_OK,
STATUS_ERROR,
STATUS_QUIT,
STATUS_SUCCESS,
STATUS_ABORTED,
STATUS_FAILURE
};
CopyThreadClass (__int64 bytestocopy);
~CopyThreadClass();
void Thread_Function();
bool Can_Abort (bool lock);
void Set_Abort (bool abort);
bool Get_Abort (bool canabort);
bool Is_Aborting() {return (IsAborting);}
void Add_Bytes_Copied (unsigned bytecount);
float Get_Fraction_Complete();
void Set_Target_Path (const WideStringClass &targetpath);
WCHAR *Get_Target_Path (WideStringClass &targetpath);
void Set_Status_Message (const WideStringClass &targetpath);
WCHAR *Get_Status_Message (WideStringClass &targetpath);
void Set_Error_Message (const WideStringClass &errormessage);
WCHAR *Get_Error_Message (WideStringClass &errormessage);
void Set_Status (StatusEnum status);
StatusEnum Get_Status();
bool Retry();
DynamicVectorClass <StringClass> &Get_Subdirectory_Log() {return (SubdirectoryLog);}
DynamicVectorClass <StringClass> &Get_Filename_Log() {return (FilenameLog);}
static bool Replace_File (const FILETIME &sourcefiletime, DWORD sourcefilesize, const WideStringClass &targetpathname);
static bool Replace_File (const WideStringClass &sourcepathname, const WideStringClass &targetpathname);
static CopyThreadClass *_ActiveCopyThread;
protected:
void Copy_Directory (const WideStringClass &sourcepath, const WideStringClass &targetpath);
void Copy_File (const WideStringClass &sourcepathname, const WideStringClass &targetpathname);
__int64 BytesToCopy;
bool IsAborting;
// NOTE: Do not access the following variables directly. Instead use the Set/Get()
// functions because they are protected by critical sections.
bool Abort;
bool CanAbort;
__int64 BytesCopied; // Bytes copied so far.
WideStringClass TargetPath;
WideStringClass StatusMessage;
WideStringClass ErrorMessage;
StatusEnum Status;
FastCriticalSectionClass::LockClass *AbortLock;
FastCriticalSectionClass SectionAbort;
FastCriticalSectionClass SectionBytesCopied;
FastCriticalSectionClass SectionTargetPath;
FastCriticalSectionClass SectionStatusMessage;
FastCriticalSectionClass SectionErrorMessage;
FastCriticalSectionClass SectionStatus;
DynamicVectorClass <StringClass> SubdirectoryLog;
DynamicVectorClass <StringClass> FilenameLog;
};
#endif // COPY_THREAD_H

View File

@@ -0,0 +1,247 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/DirectoryBrowser.cpp $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 11/25/01 11:12p $*
* *
* $Revision:: 6 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// Includes.
#include "DirectoryBrowser.h"
#include "ErrorHandler.h"
#include "TreeCtrl.h"
#include <io.h>
/***********************************************************************************************
* DirectoryBrowserClass::Get_Selected_Path -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void DirectoryBrowserClass::Get_Selected_Path (WideStringClass &selectedpath)
{
TreeCtrlClass *treectrl;
treectrl = Get_Dlg_Item (IDC_BROWSER_TREE)->As_TreeCtrlClass();
if (treectrl->Get_Selected_Item() != NULL) {
Build_Pathname (treectrl->Get_Selected_Item(), selectedpath);
} else {
selectedpath = L"???";
}
}
/***********************************************************************************************
* BrowserDialogClass::On_Init_Dialog -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void DirectoryBrowserClass::On_Init_Dialog (void)
{
TreeCtrlClass *treectrl;
char drivename [] = "?:";
treectrl = Get_Dlg_Item (IDC_BROWSER_TREE)->As_TreeCtrlClass();
// Make an entry at the root of the tree control for every fixed drive.
for (char r = 'A'; r <= 'Z'; r++) {
drivename [0] = r;
// If the drive is a fixed hard disc...
if (GetDriveType (drivename) == DRIVE_FIXED) {
TreeItemClass *treeitem;
treeitem = treectrl->Insert_Item (WideStringClass (drivename), TreeCtrlClass::ICON_FOLDER, TreeCtrlClass::ICON_FOLDER_OPEN, NULL);
treeitem->Set_Needs_Children (Has_Children (treectrl, treectrl->Get_ID(), treeitem));
}
}
treectrl->Sort_Children_Alphabetically (NULL);
// Must call base class.
PopupDialogClass::On_Init_Dialog();
}
/***********************************************************************************************
* DirectoryBrowserClass::On_TreeCtrl_Needs_Children -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void DirectoryBrowserClass::On_TreeCtrl_Needs_Children (TreeCtrlClass *tree_ctrl, int ctrl_id, TreeItemClass *parent_item)
{
if (parent_item != NULL) {
WideStringClass path;
Build_Pathname (parent_item, path);
Add_Folders (true, path, tree_ctrl, parent_item);
tree_ctrl->Sort_Children_Alphabetically (parent_item);
parent_item->Set_Needs_Children (false);
}
}
/***********************************************************************************************
* DirectoryBrowserClass::Has_Children -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool DirectoryBrowserClass::Has_Children (TreeCtrlClass *tree_ctrl, int ctrl_id, TreeItemClass *parent_item)
{
bool haschildren = true;
if (parent_item != NULL) {
WideStringClass path;
Build_Pathname (parent_item, path);
haschildren = Add_Folders (false, path, tree_ctrl, parent_item);
}
return (haschildren);
}
/***********************************************************************************************
* DirectoryBrowserClass::Build_Pathname -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void DirectoryBrowserClass::Build_Pathname (TreeItemClass *treenode, WideStringClass &path)
{
WideStringClass backslash ("\\");
if (treenode->Get_Parent() != NULL) {
Build_Pathname (treenode->Get_Parent(), path);
}
if (path.Get_Length() > 0) {
path += backslash;
}
// Append the tree node's name whilst recursively unwinding.
path += treenode->Get_Name();
}
/***********************************************************************************************
* DirectoryBrowserClass::Add_Folders -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool DirectoryBrowserClass::Add_Folders (bool recurse, const WideStringClass &path, TreeCtrlClass *treectrl, TreeItemClass *treenode)
{
const WCHAR *wildcardname = L"*.*";
WideStringClass pathname (path);
StringClass multibytepathname;
WIN32_FIND_DATA finddata;
HANDLE handle;
bool done = false;
bool haschildren = false;
// Add a child node for each subdirectory.
pathname += L"\\";
pathname += wildcardname;
multibytepathname = pathname;
handle = FindFirstFile (multibytepathname, &finddata);
if (handle != INVALID_HANDLE_VALUE) {
while (!done) {
WideStringClass filename (finddata.cFileName);
if ((filename [0] != L'.') && (finddata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
TreeItemClass *treechild;
haschildren = true;
if (!recurse) break;
treechild = treectrl->Insert_Item (filename, TreeCtrlClass::ICON_FOLDER, TreeCtrlClass::ICON_FOLDER_OPEN, treenode);
treechild->Set_Needs_Children (Has_Children (treectrl, treectrl->Get_ID(), treechild));
}
if (done = FindNextFile (handle, &finddata) == 0) {
if (GetLastError() != ERROR_NO_MORE_FILES) FATAL_SYSTEM_ERROR;
}
}
if (!FindClose (handle)) FATAL_SYSTEM_ERROR;
}
// Does this node have any children?
return (haschildren);
}

View File

@@ -0,0 +1,65 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/DirectoryBrowser.h $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 11/19/01 9:53p $*
* *
* $Revision:: 4 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef _DIRECTORY_BROWSER_H
#define _DIRECTORY_BROWSER_H
// Includes
#include "MessageBox.h"
#include "Resource.h"
// Popup dialog to implement directory browsing and selection.
class DirectoryBrowserClass : public MessageBoxClass {
public:
DirectoryBrowserClass (CallbackMenuDialogClass *callbackobject) : MessageBoxClass (IDD_DIALOG_BROWSER, callbackobject) {}
void On_TreeCtrl_Needs_Children (TreeCtrlClass *tree_ctrl, int ctrl_id, TreeItemClass *parent_item);
void Get_Selected_Path (WideStringClass &selectedpath);
protected:
void On_Init_Dialog (void);
bool Has_Children (TreeCtrlClass *tree_ctrl, int ctrl_id, TreeItemClass *parent_item);
void Build_Pathname (TreeItemClass *treenode, WideStringClass &path);
bool Add_Folders (bool recurse, const WideStringClass &path, TreeCtrlClass *treectrl, TreeItemClass *treenode);
};
#endif // DIRECTORY_BROWSER

View File

@@ -0,0 +1,433 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/DirectoryDialog.cpp $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 12/13/01 5:46p $*
* *
* $Revision:: 8 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// Includes.
#include "DirectoryDialog.h"
#include "DialogBase.h"
#include "DialogText.h"
#include "DirectoryBrowser.h"
#include "ErrorHandler.h"
#include "RegistryManager.h"
#include "Resource.h"
#include "Installer.h"
#include "Translator.h"
/***********************************************************************************************
* DirectoryDialogClass::Update -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void DirectoryDialogClass::Update (bool lazyupdate)
{
WideStringClass directorypath (Get_Dlg_Item_Text (IDC_DIRECTORY_EDIT));
TxWideStringClass spaceneededstring (IDS_DISK_SPACE_NEEDED);
WideStringClass sizestring;
__int64 spaceavailable;
if (!lazyupdate) {
// Update static text control with disk space needed.
spaceneededstring += Megabyte_Format (Get_Disk_Space_Needed(), sizestring);
Set_Dlg_Item_Text (IDC_DIRECTORY_STATIC2, spaceneededstring);
}
// Lazily update disk space available.
if (directorypath.Get_Length() >= 2) {
if (directorypath [1] == L':') {
if (!lazyupdate || (DriveLetter != directorypath [0])) {
if (Get_Disk_Space_Available (directorypath, spaceavailable)) {
TxWideStringClass spaceavailablestring (IDS_DISK_SPACE_AVAILABLE);
spaceavailablestring += Megabyte_Format (spaceavailable, sizestring);
Set_Dlg_Item_Text (IDC_DIRECTORY_STATIC3, spaceavailablestring);
DriveLetter = directorypath [0];
} else {
Set_Dlg_Item_Text (IDC_DIRECTORY_STATIC3, L"");
DriveLetter = '\0';
}
}
} else {
Set_Dlg_Item_Text (IDC_DIRECTORY_STATIC3, L"");
DriveLetter = '\0';
}
} else {
Set_Dlg_Item_Text (IDC_DIRECTORY_STATIC3, L"");
DriveLetter = '\0';
}
}
/***********************************************************************************************
* DirectoryDialogClass::Megabyte_Format -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
WCHAR *DirectoryDialogClass::Megabyte_Format (__int64 bytecount, WideStringClass &outputstring)
{
char buffer [32];
double size;
// Output byte count in Megabytes.
buffer [sizeof (buffer) - 1] = '\0';
size = ((double) bytecount) / ((double)(1024 * 1024));
_snprintf (buffer, sizeof (buffer) - 1, " %.2f ", size);
outputstring = buffer;
outputstring += TxWideStringClass (IDS_MEGABYTE_SYMBOL);
return (outputstring.Peek_Buffer());
}
/***********************************************************************************************
* DirectoryDialogClass::Callback -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void DirectoryDialogClass::Callback (int id, PopupDialogClass *popup)
{
// Is this callback from the browser?
if (popup == Browser) {
switch (id) {
case IDOK:
{
WideStringClass path;
// Update edit control with selected path from browser.
Browser->Get_Selected_Path (path);
Set_Dlg_Item_Text (IDC_DIRECTORY_EDIT, path);
Update();
break;
}
case IDCANCEL:
// Do nothing.
break;
default:
break;
}
REF_PTR_RELEASE (Browser);
} else {
if (popup == OverwriteDialog) {
switch (id) {
case IDC_BUTTON_YES:
On_Command (IDC_BUTTON_YES, 0, 0);
REF_PTR_RELEASE (OverwriteDialog);
break;
default:
REF_PTR_RELEASE (OverwriteDialog);
break;
}
} else {
// Callback is from some other source. Let the base class handle it.
InstallMenuDialogClass::Callback (id, popup);
}
}
}
/***********************************************************************************************
* DirectoryDialogClass::On_Activate -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void DirectoryDialogClass::On_Activate (bool onoff)
{
// NOTE 0: Disk space needed/available may have changed since this dialog was last active.
// NOTE 1: It is important to ensure that the dialog is running before Update() is called
// (this indicates that the dialog has been initialized by the framework).
if (onoff && Is_Running()) {
Update();
}
InstallMenuDialogClass::On_Activate (onoff);
}
/***********************************************************************************************
* DirectoryDialogClass::On_Frame_Update -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void DirectoryDialogClass::On_Frame_Update (void)
{
Update (true);
InstallMenuDialogClass::On_Frame_Update();
}
/***********************************************************************************************
* DirectoryDialogClass::On_Command -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void DirectoryDialogClass::On_Command (int ctrl_id, int message_id, DWORD param)
{
switch (ctrl_id)
{
case IDC_BUTTON_BROWSE:
{
Browser = NEW_REF (DirectoryBrowserClass, (this));
Browser->Start_Dialog();
break;
}
case IDOK:
{
WideStringClass path (Get_Dlg_Item_Text (IDC_DIRECTORY_EDIT));
int errormessageid;
__int64 spaceavailable;
// Check that the selected path is valid.
if (!Validate_Path (path, errormessageid)) {
MessageBoxClass::Do_Dialog (TxWideStringClass (IDS_WARNING), TxWideStringClass (errormessageid), MessageBoxClass::MESSAGE_BOX_TYPE_OK, this);
return;
}
// Check that the selected path is not a Windows system path.
if (Is_System_Directory (path)) {
MessageBoxClass::Do_Dialog (TxWideStringClass (IDS_WARNING), TxWideStringClass (IDS_SYSTEM_DIRECTORY), MessageBoxClass::MESSAGE_BOX_TYPE_OK, this);
return;
}
// Check that there is enough disk space on the selected drive.
if (!Get_Disk_Space_Available (path, spaceavailable)) {
MessageBoxClass::Do_Dialog (TxWideStringClass (IDS_WARNING), TxWideStringClass (IDS_INVALID_PATH), MessageBoxClass::MESSAGE_BOX_TYPE_OK, this);
return;
}
if (Get_Disk_Space_Needed() > spaceavailable) {
MessageBoxClass::Do_Dialog (TxWideStringClass (IDS_WARNING), TxWideStringClass (IDS_NOT_ENOUGH_DISK_SPACE), MessageBoxClass::MESSAGE_BOX_TYPE_OK, this);
return;
}
// If the path exists ask the user if he wishes to overwrite it?
if (Directory_Exists (path)) {
OverwriteDialog = MessageBoxClass::Create_Dialog (TxWideStringClass (IDS_WARNING), TxWideStringClass (IDS_DIRECTORY_EXISTS), MessageBoxClass::MESSAGE_BOX_TYPE_YES_NO, this);
return;
}
break;
}
case IDC_BUTTON_YES:
// NOTE: This command has come from the Overwrite dialog via the callback routine.
InstallMenuDialogClass::On_Command (IDOK, message_id, param);
return;
default:
break;
}
InstallMenuDialogClass::On_Command (ctrl_id, message_id, param);
}
/***********************************************************************************************
* DirectoryDialogClass::Get_Path -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
const WCHAR *DirectoryDialogClass::Get_Path (WideStringClass &path)
{
path = Get_Dlg_Item_Text (IDC_DIRECTORY_EDIT);
return (path);
}
/***********************************************************************************************
* GameDirectoryDialogClass::On_Init_Dialog -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void GameDirectoryDialogClass::On_Init_Dialog()
{
WideStringClass path;
TxWideStringClass spaceneededstring (IDS_DISK_SPACE_NEEDED);
Set_Dlg_Item_Text (IDC_DIRECTORY_STATIC1, TxWideStringClass (IDS_INSTALL_GAME_DIRECTORY));
// Extract game path from registry (if it exists) - otherwise use a default.
if (_RegistryManager.Get_Target_Game_Path (path)) {
Set_Dlg_Item_Text (IDC_DIRECTORY_EDIT, path);
} else {
Set_Dlg_Item_Text (IDC_DIRECTORY_EDIT, TxWideStringClass (IDS_DEFAULT_GAME_PATH, IDS_RESOURCE_DEFAULT_GAME_PATH));
}
Update();
InstallMenuDialogClass::On_Init_Dialog();
}
/***********************************************************************************************
* WOLDirectoryDialogClass::On_Init_Dialog -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void WOLDirectoryDialogClass::On_Init_Dialog()
{
WideStringClass path;
TxWideStringClass spaceneededstring (IDS_DISK_SPACE_NEEDED);
Set_Dlg_Item_Text (IDC_DIRECTORY_STATIC1, TxWideStringClass (IDS_INSTALL_WOL_DIRECTORY));
// Extract WOL path from registry (if it exists) - otherwise use a default.
if (_RegistryManager.Get_Target_WOL_Path (RegistryManagerClass::WOLAPI_COMPONENT, path)) {
Set_Dlg_Item_Text (IDC_DIRECTORY_EDIT, path);
} else {
Set_Dlg_Item_Text (IDC_DIRECTORY_EDIT, TxWideStringClass (IDS_DEFAULT_WOL_PATH, IDS_RESOURCE_DEFAULT_WOL_PATH));
}
Update();
InstallMenuDialogClass::On_Init_Dialog();
}
/***********************************************************************************************
* WOLDirectoryDialogClass::On_Command -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void WOLDirectoryDialogClass::On_Command (int ctrl_id, int message_id, DWORD param)
{
switch (ctrl_id)
{
case IDOK:
{
if (_Installer.Install_Game()) {
WideStringClass gamepath;
// Check that the selected WOL path is not the same as the target game path.
if (Is_Same_Path (WideStringClass (Get_Dlg_Item_Text (IDC_DIRECTORY_EDIT)), _Installer.Get_Target_Game_Path (gamepath))) {
MessageBoxClass::Do_Dialog (TxWideStringClass (IDS_WARNING), TxWideStringClass (IDS_SAME_PATHS), MessageBoxClass::MESSAGE_BOX_TYPE_OK, this);
return;
}
}
break;
}
default:
break;
}
DirectoryDialogClass::On_Command (ctrl_id, message_id, param);
}

View File

@@ -0,0 +1,117 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/DirectoryDialog.h $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 11/24/01 8:38p $*
* *
* $Revision:: 5 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef _DIRECTORY_DIALOG_H
#define _DIRECTORY_DIALOG_H
// Includes.
#include "InstallMenuDialog.h"
#include "Installer.h"
// Forward delcarations.
class DirectoryBrowserClass;
// Dialog to set the install directory for the game (GameDirectoryClass) or an
// online component (WOLDirectoryClass).
// Classes.
class DirectoryDialogClass : public InstallMenuDialogClass
{
public:
DirectoryDialogClass() : InstallMenuDialogClass (IDD_DIALOG_DIRECTORY), Browser (NULL), OverwriteDialog (NULL), DriveLetter ('\0') {}
// RTTI.
void *As_DirectoryDialogClass() {return (this);}
void On_Command (int ctrl_id, int message_id, DWORD param);
void Callback (int id, PopupDialogClass *popup);
const WCHAR *Get_Path (WideStringClass &path);
protected:
void Update (bool lazyupdate = false);
void On_Init_Dialog (void) {InstallMenuDialogClass::On_Init_Dialog();}
void On_Activate (bool onoff);
void On_Frame_Update (void);
WCHAR *Megabyte_Format (__int64 bytecount, WideStringClass &outputstring);
virtual __int64 Get_Disk_Space_Needed() = 0;
virtual bool Get_Disk_Space_Available (const WideStringClass &path, __int64 &diskspace) = 0;
DirectoryBrowserClass *Browser;
MessageBoxClass *OverwriteDialog;
WCHAR DriveLetter;
};
class GameDirectoryDialogClass : public DirectoryDialogClass
{
public:
// RTTI.
virtual void *As_GameDirectoryDialogClass() {return (this);}
void On_Command (int ctrl_id, int message_id, DWORD param) {DirectoryDialogClass::On_Command (ctrl_id, message_id, param);}
protected:
void On_Init_Dialog (void);
__int64 Get_Disk_Space_Needed() {return (_Installer.Get_Game_Size (true));}
bool Get_Disk_Space_Available (const WideStringClass &path, __int64 &diskspace) {return (_Installer.Get_Game_Space_Available (path, diskspace));}
};
class WOLDirectoryDialogClass : public DirectoryDialogClass
{
public:
// RTTI.
virtual void *As_WOLDirectoryDialogClass() {return (this);}
void On_Command (int ctrl_id, int message_id, DWORD param);
protected:
void On_Init_Dialog (void);
__int64 Get_Disk_Space_Needed() {return (_Installer.Get_WOL_Size (true));}
bool Get_Disk_Space_Available (const WideStringClass &path, __int64 &diskspace) {return (_Installer.Get_WOL_Space_Available (path, diskspace));}
};
#endif // _DIRECTORY_DIALOG_H

View File

@@ -0,0 +1,144 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/ErrorHandler.cpp $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 11/25/01 6:56p $*
* *
* $Revision:: 7 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// Includes.
#include "ErrorHandler.h"
#include "CodeControl.h"
#include "Resource.h"
#include "Translator.h"
#include "Win.h"
// Defines.
#if VERBOSE_ERROR_MESSAGES
#define SYSTEM_ERROR_FORMAT_STRING L"%s\nFile: %s\nLine: %d\n"
#define APPLICATION_ERROR_FORMAT_STRING L"%s\n\nFile: %s\nLine: %d\n"
#define CAB_ERROR_FORMAT_STRING L"%s %d\n\nFile: %s\nLine: %d\n"
#else
#define SYSTEM_ERROR_FORMAT_STRING L"%s"
#define APPLICATION_ERROR_FORMAT_STRING L"%s"
#define CAB_ERROR_FORMAT_STRING L"%s %d"
#endif
/***********************************************************************************************
* Handle_Fatal_System_Error -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void Handle_Fatal_System_Error (int errorcode, const char *filename, int sourceline)
{
WideStringClass errormessage, messagebody;
LPVOID messagebuffer;
FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
errorcode,
MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &messagebuffer,
0,
NULL);
messagebody = (TCHAR*) messagebuffer;
LocalFree (messagebuffer);
#if VERBOSE_ERROR_MESSAGES
errormessage.Format (SYSTEM_ERROR_FORMAT_STRING, messagebody, WideStringClass (filename), sourceline);
#else
errormessage.Format (SYSTEM_ERROR_FORMAT_STRING, messagebody);
#endif
throw (errormessage);
}
/***********************************************************************************************
* Handle_Fatal_Application_Error -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void Handle_Fatal_Application_Error (int errorcode, const char *filename, int sourceline)
{
WideStringClass errormessage;
#if VERBOSE_ERROR_MESSAGES
errormessage.Format (APPLICATION_ERROR_FORMAT_STRING, TxWideStringClass (errorcode), WideStringClass (filename), sourceline);
#else
errormessage.Format (APPLICATION_ERROR_FORMAT_STRING, TxWideStringClass (errorcode));
#endif
throw (errormessage);
}
/***********************************************************************************************
* Handle_Fatal_Cab_Error -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void Handle_Fatal_Cab_Error (int errorcode, const char *filename, int sourceline)
{
WideStringClass errormessage;
#if VERBOSE_ERROR_MESSAGES
errormessage.Format (CAB_ERROR_FORMAT_STRING, TxWideStringClass (IDS_CAB_ERROR), errorcode, WideStringClass (filename), sourceline);
#else
errormessage.Format (CAB_ERROR_FORMAT_STRING, TxWideStringClass (IDS_CAB_ERROR), errorcode);
#endif
throw (errormessage);
}

View File

@@ -0,0 +1,50 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/ErrorHandler.h $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 10/25/01 10:07p $*
* *
* $Revision:: 4 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef _ERROR_HANDLER_H
#define _ERROR_HANDLER_H
// Includes.
#include "Resource.h"
#define FATAL_SYSTEM_ERROR Handle_Fatal_System_Error (GetLastError(), __FILE__, __LINE__)
#define FATAL_APP_ERROR(errorcode) Handle_Fatal_Application_Error (errorcode, __FILE__, __LINE__)
#define FATAL_CAB_ERROR(errorcode) Handle_Fatal_Cab_Error (errorcode, __FILE__, __LINE__)
void Handle_Fatal_System_Error (int errorcode, const char *filename, int sourceline);
void Handle_Fatal_Application_Error (int errorcode, const char *filename, int sourceline);
void Handle_Fatal_Cab_Error (int errorcode, const char *filename, int sourceline);
#endif // _ERROR_HANDLER_H

View File

@@ -0,0 +1,178 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/FinalDialog.cpp $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 11/09/01 10:42p $*
* *
* $Revision:: 5 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// Includes.
#include "FinalDialog.h"
#include "ButtonCtrl.h"
#include "CheckBoxCtrl.h"
#include "Installer.h"
#include "Translator.h"
/***********************************************************************************************
* FinalDialogClass::On_Init_Dialog -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void FinalDialogClass::On_Init_Dialog (void)
{
switch ((_Installer.Install_Game() ? 1 : 0) + (_Installer.Install_WOL() ? 2 : 0)) {
case 0:
// Should never occur. At least one component should have been installed.
WWASSERT (false);
break;
case 1:
Set_Dlg_Item_Text (IDC_FINAL_STATIC1, TxWideStringClass (IDS_GAME_INSTALLED));
break;
case 2:
Set_Dlg_Item_Text (IDC_FINAL_STATIC1, TxWideStringClass (IDS_WOL_INSTALLED));
break;
case 3:
Set_Dlg_Item_Text (IDC_FINAL_STATIC1, TxWideStringClass (IDS_GAME_AND_WOL_INSTALLED));
break;
}
// Show the back button? If false this suggests that there is not a dialog to go back to.
if (!ShowBackButton) {
ButtonCtrlClass *backbutton;
backbutton = Get_Dlg_Item (IDC_BUTTON_BACK)->As_ButtonCtrlClass();
backbutton->Show (false);
backbutton->Enable (false);
}
if (_Installer.Install_Game()) {
Check_Dlg_Button (IDC_FINAL_CHECK1, true);
} else {
Check_Dlg_Button (IDC_FINAL_CHECK3, true);
Enable_Dlg_Item (IDC_FINAL_CHECK1, false);
Enable_Dlg_Item (IDC_FINAL_CHECK2, false);
}
Set_Dlg_Item_Text (IDC_FINAL_STATIC3, TxWideStringClass (IDS_FINAL_NOTES));
InstallMenuDialogClass::On_Init_Dialog();
}
/***********************************************************************************************
* FinalDialogClass::On_Command -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void FinalDialogClass::On_Command (int ctrl_id, int message_id, DWORD param)
{
static bool _disabled = false;
// Implement radio controls with the three check boxes by making them mutually exclusive.
// NOTE: Unlike Windows GUI, a control can always get focus regardless of its checked status.
if (!_disabled) {
CheckBoxCtrlClass *check1, *check2, *check3;
bool setcheckcontrols;
setcheckcontrols = false;
switch (ctrl_id) {
case IDC_FINAL_CHECK1:
check1 = Get_Dlg_Item (IDC_FINAL_CHECK1)->As_CheckBoxCtrlClass();
check2 = Get_Dlg_Item (IDC_FINAL_CHECK2)->As_CheckBoxCtrlClass();
check3 = Get_Dlg_Item (IDC_FINAL_CHECK3)->As_CheckBoxCtrlClass();
setcheckcontrols = true;
break;
case IDC_FINAL_CHECK2:
check1 = Get_Dlg_Item (IDC_FINAL_CHECK2)->As_CheckBoxCtrlClass();
check2 = Get_Dlg_Item (IDC_FINAL_CHECK1)->As_CheckBoxCtrlClass();
check3 = Get_Dlg_Item (IDC_FINAL_CHECK3)->As_CheckBoxCtrlClass();
setcheckcontrols = true;
break;
case IDC_FINAL_CHECK3:
check1 = Get_Dlg_Item (IDC_FINAL_CHECK3)->As_CheckBoxCtrlClass();
check2 = Get_Dlg_Item (IDC_FINAL_CHECK1)->As_CheckBoxCtrlClass();
check3 = Get_Dlg_Item (IDC_FINAL_CHECK2)->As_CheckBoxCtrlClass();
setcheckcontrols = true;
break;
case IDCANCEL:
MenuDialogClass::On_Command (ctrl_id, message_id, param);
return;
default:
break;
}
if (setcheckcontrols) {
// Prevent recursion on this function by 'disabling' it.
_disabled = true;
if (check1->Get_Check()) {
check2->Set_Check (false);
check3->Set_Check (false);
} else {
// If it has just been unchecked then check it again - user must
// not be able to uncheck a control by clicking on it.
check1->Set_Check (true);
}
_disabled = false;
}
}
InstallMenuDialogClass::On_Command (ctrl_id, message_id, param);
}

View File

@@ -0,0 +1,66 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/FinalDialog.h $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 10/22/01 8:51p $*
* *
* $Revision:: 3 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef _FINAL_DIALOG_H
#define _FINAL_DIALOG_H
// Includes.
#include "InstallMenuDialog.h"
// Dialog to instigate sign-up for a Westwood Online account.
// Classes.
class FinalDialogClass : public InstallMenuDialogClass
{
public:
FinalDialogClass (bool showbackbutton) : InstallMenuDialogClass (IDD_DIALOG_FINAL), ShowBackButton (showbackbutton) {}
// RTTI.
void *As_FinalDialogClass() {return (this);}
void On_Command (int ctrl_id, int message_id, DWORD param);
bool Run_Game() {return (Is_Dlg_Button_Checked (IDC_FINAL_CHECK1));}
bool Display_Readme() {return (Is_Dlg_Button_Checked (IDC_FINAL_CHECK2));}
protected:
void FinalDialogClass::On_Init_Dialog (void);
bool ShowBackButton;
};
#endif // _FINAL_DIALOG_H

View File

@@ -0,0 +1,256 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/FolderDialog.cpp $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 12/13/01 5:46p $*
* *
* $Revision:: 9 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// Includes.
#include "FolderDialog.h"
#include "ErrorHandler.h"
#include "DialogText.h"
#include "Installer.h"
#include "ListCtrl.h"
#include "RegistryManager.h"
#include "Resource.h"
#include "Translator.h"
#include <io.h>
/***********************************************************************************************
* FolderDialogClass::On_Init_Dialog -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void FolderDialogClass::On_Init_Dialog (void)
{
WideStringClass wildcardfolderpath;
// Set-up the folder list control with available folders.
if (_RegistryManager.Get_Folder_Path (wildcardfolderpath)) {
const WCHAR *wildcardname = L"*.*";
ListCtrlClass *listctrl;
unsigned i;
WIN32_FIND_DATA finddata;
HANDLE handle;
bool done = false;
wildcardfolderpath += L"\\";
wildcardfolderpath += wildcardname;
StringClass multibytewildcardfolderpath (wildcardfolderpath);
// Add a list item for each subdirectory.
listctrl = Get_Dlg_Item (IDC_FOLDER_LIST)->As_ListCtrlClass();
listctrl->Add_Column (L"", 1.0f, Vector3 (1.0f, 1.0f, 1.0f));
i = 0;
handle = FindFirstFile (multibytewildcardfolderpath, &finddata);
if (handle != INVALID_HANDLE_VALUE) {
while (!done) {
WideStringClass filename (finddata.cFileName);
if ((filename [0] != L'.') && (finddata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
listctrl->Insert_Entry (i, filename);
}
if (done = FindNextFile (handle, &finddata) == 0) {
if (GetLastError() != ERROR_NO_MORE_FILES) FATAL_SYSTEM_ERROR;
}
i++;
}
if (!FindClose (handle)) FATAL_SYSTEM_ERROR;
listctrl->Sort_Alphabetically (0, ListCtrlClass::SORT_ASCENDING);
}
}
InstallMenuDialogClass::On_Init_Dialog();
}
/***********************************************************************************************
* FolderDialogClass::Get_Folder -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
const WCHAR *FolderDialogClass::Get_Folder (WideStringClass &folder)
{
folder = Get_Dlg_Item_Text (IDC_FOLDER_EDIT);
return (folder);
}
/***********************************************************************************************
* GameFolderDialogClass::On_Init_Dialog -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void GameFolderDialogClass::On_Init_Dialog (void)
{
WideStringClass folder;
// Initialize strings.
Set_Dlg_Item_Text (IDC_FOLDER_STATIC1, TxWideStringClass (IDS_SELECT_GAME_FOLDER));
// Extract game folder from registry (if it exists) - otherwise use a default.
if (_RegistryManager.Get_Target_Game_Folder (folder)) {
Set_Dlg_Item_Text (IDC_FOLDER_EDIT, folder);
} else {
Set_Dlg_Item_Text (IDC_FOLDER_EDIT, TxWideStringClass (IDS_DEFAULT_GAME_FOLDER, IDS_RESOURCE_DEFAULT_GAME_FOLDER));
}
FolderDialogClass::On_Init_Dialog();
}
/***********************************************************************************************
* WOLFolderDialogClass::On_Init_Dialog -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void WOLFolderDialogClass::On_Init_Dialog (void)
{
WideStringClass folder;
// Initialize strings.
Set_Dlg_Item_Text (IDC_FOLDER_STATIC1, TxWideStringClass (IDS_SELECT_WOL_FOLDER));
// Extract game folder from registry (if it exists) - otherwise use a default.
if (_RegistryManager.Get_Target_WOL_Folder (RegistryManagerClass::WOLAPI_COMPONENT, folder)) {
Set_Dlg_Item_Text (IDC_FOLDER_EDIT, folder);
} else {
Set_Dlg_Item_Text (IDC_FOLDER_EDIT, TxWideStringClass (IDS_DEFAULT_WOL_FOLDER, IDS_RESOURCE_DEFAULT_WOL_FOLDER));
}
FolderDialogClass::On_Init_Dialog();
}
/***********************************************************************************************
* FolderDialogClass::On_ListCtrl_Sel_Change -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void FolderDialogClass::On_ListCtrl_Sel_Change (ListCtrlClass *list_ctrl, int ctrl_id, int old_index, int new_index)
{
Set_Dlg_Item_Text (IDC_FOLDER_EDIT, list_ctrl->Get_Entry_Text (new_index, 0));
}
/***********************************************************************************************
* FolderDialogClass::On_Command -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void FolderDialogClass::On_Command (int ctrl_id, int message_id, DWORD param)
{
switch (ctrl_id) {
case IDOK:
{
WideStringClass foldername (Get_Dlg_Item_Text (IDC_FOLDER_EDIT));
WideStringClass folderpathname;
bool hasnonspacechar;
int dummyid;
// Check that the selected folder name has non-space characters.
hasnonspacechar = false;
for (int i = 0; i < foldername.Get_Length(); i++) {
if (foldername [i] != L' ') hasnonspacechar = true;
}
if (!hasnonspacechar) {
MessageBoxClass::Do_Dialog (TxWideStringClass (IDS_WARNING), TxWideStringClass (IDS_INVALID_FOLDER_NAME), MessageBoxClass::MESSAGE_BOX_TYPE_OK, this);
return;
}
// Check that the selected folder path is valid.
_RegistryManager.Get_Folder_Path (folderpathname);
folderpathname += L"\\";
folderpathname += Get_Dlg_Item_Text (IDC_FOLDER_EDIT);
if (!Validate_Path (folderpathname, dummyid)) {
MessageBoxClass::Do_Dialog (TxWideStringClass (IDS_WARNING), TxWideStringClass (IDS_INVALID_FOLDER_NAME), MessageBoxClass::MESSAGE_BOX_TYPE_OK, this);
return;
}
}
default:
break;
}
InstallMenuDialogClass::On_Command (ctrl_id, message_id, param);
}

View File

@@ -0,0 +1,92 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/FolderDialog.h $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 11/24/01 8:52p $*
* *
* $Revision:: 5 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef _FOLDER_DIALOG_H
#define _FOLDER_DIALOG_H
// Includes.
#include "InstallMenuDialog.h"
// Dialog to select the folder to which icons will be added. GameFolderClass specifies the
// folder for game icons, WOLFolderClass specifies the directory for online icons.
// Classes.
class FolderDialogClass : public InstallMenuDialogClass
{
public:
FolderDialogClass() : InstallMenuDialogClass (IDD_DIALOG_FOLDER) {}
// RTTI.
void *As_FolderDialogClass() {return (this);}
void On_ListCtrl_Sel_Change (ListCtrlClass *list_ctrl, int ctrl_id, int old_index, int new_index);
void On_Command (int ctrl_id, int message_id, DWORD param);
const WCHAR *Get_Folder (WideStringClass &folder);
protected:
void On_Init_Dialog (void);
};
class GameFolderDialogClass : public FolderDialogClass
{
public:
// RTTI.
virtual void *As_GameFolderDialogClass() {return (this);}
void On_Command (int ctrl_id, int message_id, DWORD param) {FolderDialogClass::On_Command (ctrl_id, message_id, param);}
protected:
void On_Init_Dialog (void);
};
class WOLFolderDialogClass : public FolderDialogClass
{
public:
// RTTI.
virtual void *As_WOLFolderDialogClass() {return (this);}
void On_Command (int ctrl_id, int message_id, DWORD param) {FolderDialogClass::On_Command (ctrl_id, message_id, param);}
protected:
void On_Init_Dialog (void);
};
#endif // _FOLDER_DIALOG_H

View File

@@ -0,0 +1,142 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/InstallMenuDialog.c $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 12/14/01 11:05a $*
* *
* $Revision:: 5 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// Includes.
#include "InstallMenuDialog.h"
#include "AssetMgr.h"
#include "HAnim.h"
#include "MenuBackDrop.h"
#include "Scene.h"
#include "Translator.h"
/***********************************************************************************************
* InstallMenuDialogClass::InstallMenuDialogClass -- Constructor *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
InstallMenuDialogClass::InstallMenuDialogClass (int resourceid)
: CallbackMenuDialogClass (resourceid)
{
// If a model has not yet been specified...
if (Get_BackDrop()->Peek_Model() == NULL) {
const char *basemodelname = "IF_BACK01";
const char *baseanimname = "IF_BACK01.IF_BACK01";
const unsigned supplementalmodelcount = 2;
const char *supplementalmodelname [supplementalmodelcount] = {"IN_EVA", "IN_RENLOGO"};
const char *supplementalanimname [supplementalmodelcount] = {"IN_EVA.IN_EVA", "IN_RENLOGO.IN_RENLOGO"};
Get_BackDrop()->Set_Model (basemodelname);
Get_BackDrop()->Set_Animation (baseanimname);
for (unsigned m = 0; m < supplementalmodelcount; m++) {
RenderObjClass *supplementalmodel;
HAnimClass *supplementalanim;
supplementalmodel = WW3DAssetManager::Get_Instance()->Create_Render_Obj (supplementalmodelname [m]);
if (supplementalmodel != NULL) {
Get_BackDrop()->Peek_Scene()->Add_Render_Object (supplementalmodel);
}
supplementalanim = WW3DAssetManager::Get_Instance()->Get_HAnim (supplementalanimname [m]);
if (supplementalanim != NULL) {
supplementalmodel->Set_Animation (supplementalanim, 0, RenderObjClass::ANIM_MODE_LOOP);
REF_PTR_RELEASE (supplementalanim);
}
REF_PTR_RELEASE (supplementalmodel);
}
}
}
/***********************************************************************************************
* InstallMenuDialogClass::~InstallMenuDialogClass -- Destructor *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
InstallMenuDialogClass::~InstallMenuDialogClass()
{
}
/***********************************************************************************************
* InstallMenuDialogClass::On_Command -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void InstallMenuDialogClass::On_Command (int ctrl_id, int message_id, DWORD param)
{
switch (ctrl_id)
{
case IDCANCEL:
{
MessageBoxClass::Do_Dialog (TxWideStringClass (IDS_EXIT_SETUP), TxWideStringClass (IDS_PROMPT_EXIT_SETUP), MessageBoxClass::MESSAGE_BOX_TYPE_YES_NO, this);
return;
}
case IDOK:
case IDC_BUTTON_BACK:
break;
default:
break;
}
MenuDialogClass::On_Command (ctrl_id, message_id, param);
}

View File

@@ -0,0 +1,73 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/InstallMenuDialog. $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 12/04/01 4:43p $*
* *
* $Revision:: 5 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef _INSTALL_MENU_DIALOG_H
#define _INSTALL_MENU_DIALOG_H
// Includes.
#include "MenuDialog.h"
#include "Resource.h"
#include "MessageBox.h"
// Classes.
class InstallMenuDialogClass : public CallbackMenuDialogClass
{
public:
InstallMenuDialogClass (int resourceid);
~InstallMenuDialogClass();
// RTTI.
virtual void *As_CopyDialogClass() {return (NULL);}
virtual void *As_DirectoryDialogClass() {return (NULL);}
virtual void *As_FinalDialogClass() {return (NULL);}
virtual void *As_GameFolderDialogClass() {return (NULL);}
virtual void *As_GameDirectoryDialogClass() {return (NULL);}
virtual void *As_LicenseDialogClass() {return (NULL);}
virtual void *As_NDADialogClass() {return (NULL);}
virtual void *As_WOLDirectoryDialogClass() {return (NULL);}
virtual void *As_WOLFolderDialogClass() {return (NULL);}
virtual void *As_ReviewDialogClass() {return (NULL);}
virtual void *As_SerialDialogClass() {return (NULL);}
virtual void *As_WelcomeDialogClass() {return (NULL);}
virtual void *As_WhatToInstallDialogClass() {return (NULL);}
virtual void *As_WOL1DialogClass() {return (NULL);}
virtual void *As_WOL2DialogClass() {return (NULL);}
void On_Command (int ctrl_id, int message_id, DWORD param);
};
#endif // _INSTALL_MENU_DIALOG_H

2664
Code/Installer/Installer.cpp Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,333 @@
# Microsoft Developer Studio Project File - Name="Installer" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=Installer - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "Installer.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "Installer.mak" CFG="Installer - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "Installer - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "Installer - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""$/Commando/Code/Installer", KQFEAAAA"
# PROP Scc_LocalPath "."
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "Installer - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\WwSaveLoad" /I "..\Wwui" /I "..\Ww3d2" /I "..\Wwmath" /I "..\Wwlib" /I "..\BinkMovie" /I "..\Wwdebug" /I "..\WWAudio" /I "..\Miles6\Include" /I "Cab\Include" /I "..\Wwtranslatedb" /I "..\DirectX\Include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D _WIN32_WINNT=0x400 /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib vfw32.lib winmm.lib d3dx8.lib d3d8.lib wwui.lib ww3d2.lib wwmath.lib wwlib.lib wwsaveload.lib wwdebug.lib binkmovie.lib binkw32.lib wwaudio.lib ..\miles6\lib\win\mss32.lib cab\lib\fdi.lib version.lib wwtranslatedb.lib /nologo /subsystem:windows /machine:I386 /out:"Run\Setup.exe" /libpath:"..\Libs\Release" /libpath:"..\BinkMovie" /libpath:"..\DirectX\Lib"
# SUBTRACT LINK32 /debug
# Begin Special Build Tool
SOURCE="$(InputPath)"
PostBuild_Cmds=Copy Run\Setup.exe Run\Chinese\Setup.exe Copy Run\Setup.exe Run\English\Setup.exe Copy Run\Setup.exe Run\French\Setup.exe Copy Run\Setup.exe Run\German\Setup.exe Copy Run\Setup.exe Run\Korean\Setup.exe Copy Run\Setup.exe Run\Japanese\Setup.exe Copy Run\Setup.exe Run\Beta\Setup.exe
# End Special Build Tool
!ELSEIF "$(CFG)" == "Installer - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\WwSaveLoad" /I "..\Wwui" /I "..\Ww3d2" /I "..\Wwmath" /I "..\Wwlib" /I "..\BinkMovie" /I "..\Wwdebug" /I "..\WWAudio" /I "..\Miles6\Include" /I "Cab\Include" /I "..\Wwtranslatedb" /I "..\DirectX\Include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D _WIN32_WINNT=0x400 /D "WWDEBUG" /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib vfw32.lib winmm.lib d3dx8.lib d3d8.lib wwui.lib ww3d2.lib wwmath.lib wwlib.lib wwsaveload.lib wwdebug.lib binkmovie.lib binkw32.lib wwaudio.lib ..\miles6\lib\win\mss32.lib cab\lib\fdi.lib version.lib wwtranslatedb.lib /nologo /subsystem:windows /incremental:no /debug /machine:I386 /out:"Run\SetupD.exe" /libpath:"..\Libs\Debug" /libpath:"..\BinkMovie" /libpath:"..\DirectX\Lib"
# Begin Special Build Tool
SOURCE="$(InputPath)"
PostBuild_Cmds=Copy Run\SetupD.exe Run\Chinese\SetupD.exe Copy Run\SetupD.exe Run\English\SetupD.exe Copy Run\SetupD.exe Run\French\SetupD.exe Copy Run\SetupD.exe Run\German\SetupD.exe Copy Run\SetupD.exe Run\Korean\SetupD.exe Copy Run\SetupD.exe Run\Japanese\SetupD.exe Copy Run\SetupD.exe Run\Beta\SetupD.exe
# End Special Build Tool
!ENDIF
# Begin Target
# Name "Installer - Win32 Release"
# Name "Installer - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\CardSelectionDialog.cpp
!IF "$(CFG)" == "Installer - Win32 Release"
!ELSEIF "$(CFG)" == "Installer - Win32 Debug"
# ADD CPP /MTd
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\CopyDialog.cpp
# End Source File
# Begin Source File
SOURCE=.\CopyThread.cpp
# End Source File
# Begin Source File
SOURCE=.\DirectoryBrowser.cpp
# End Source File
# Begin Source File
SOURCE=.\DirectoryDialog.cpp
# End Source File
# Begin Source File
SOURCE=.\ErrorHandler.cpp
# End Source File
# Begin Source File
SOURCE=.\FinalDialog.cpp
# End Source File
# Begin Source File
SOURCE=.\FolderDialog.cpp
# End Source File
# Begin Source File
SOURCE=.\Installer.cpp
# End Source File
# Begin Source File
SOURCE=.\Installer.rc
# End Source File
# Begin Source File
SOURCE=.\InstallMenuDialog.cpp
# End Source File
# Begin Source File
SOURCE=.\LicenseDialog.cpp
# End Source File
# Begin Source File
SOURCE=.\MessageBox.cpp
# End Source File
# Begin Source File
SOURCE=.\RAMFileFactory.cpp
# End Source File
# Begin Source File
SOURCE=.\RegistryManager.cpp
# End Source File
# Begin Source File
SOURCE=.\ReviewDialog.cpp
# End Source File
# Begin Source File
SOURCE=.\SafeTimer.cpp
# End Source File
# Begin Source File
SOURCE=.\SerialDialog.cpp
# End Source File
# Begin Source File
SOURCE=.\TransitionDialog.cpp
# End Source File
# Begin Source File
SOURCE=.\Translator.cpp
# End Source File
# Begin Source File
SOURCE=.\Utilities.cpp
# End Source File
# Begin Source File
SOURCE=.\WelcomeDialog.cpp
# End Source File
# Begin Source File
SOURCE=.\WhatToInstallDialog.cpp
# End Source File
# Begin Source File
SOURCE=.\WinMain.cpp
# End Source File
# Begin Source File
SOURCE=.\WOL1Dialog.cpp
# End Source File
# Begin Source File
SOURCE=.\WOL2Dialog.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\CardSelectionDialog.h
# End Source File
# Begin Source File
SOURCE=.\CodeControl.h
# End Source File
# Begin Source File
SOURCE=.\CopyDialog.h
# End Source File
# Begin Source File
SOURCE=.\CopyThread.h
# End Source File
# Begin Source File
SOURCE=.\DirectoryBrowser.h
# End Source File
# Begin Source File
SOURCE=.\DirectoryDialog.h
# End Source File
# Begin Source File
SOURCE=.\ErrorHandler.h
# End Source File
# Begin Source File
SOURCE=.\FinalDialog.h
# End Source File
# Begin Source File
SOURCE=.\FolderDialog.h
# End Source File
# Begin Source File
SOURCE=.\Installer.h
# End Source File
# Begin Source File
SOURCE=.\InstallMenuDialog.h
# End Source File
# Begin Source File
SOURCE=.\LicenseDialog.h
# End Source File
# Begin Source File
SOURCE=.\MessageBox.h
# End Source File
# Begin Source File
SOURCE=.\RAMFileFactory.h
# End Source File
# Begin Source File
SOURCE=.\RegistryManager.h
# End Source File
# Begin Source File
SOURCE=.\Resource.h
# End Source File
# Begin Source File
SOURCE=.\ReviewDialog.h
# End Source File
# Begin Source File
SOURCE=.\SafeTimer.h
# End Source File
# Begin Source File
SOURCE=.\SerialDialog.h
# End Source File
# Begin Source File
SOURCE=.\TransitionDialog.h
# End Source File
# Begin Source File
SOURCE=.\Translator.h
# End Source File
# Begin Source File
SOURCE=.\Utilities.h
# End Source File
# Begin Source File
SOURCE=.\WelcomeDialog.h
# End Source File
# Begin Source File
SOURCE=.\WhatToInstallDialog.h
# End Source File
# Begin Source File
SOURCE=.\WOL1Dialog.h
# End Source File
# Begin Source File
SOURCE=.\WOL2Dialog.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE=.\Renegade.ico
# End Source File
# End Group
# End Target
# End Project

277
Code/Installer/Installer.h Normal file
View File

@@ -0,0 +1,277 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/Installer.h $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 1/17/02 5:01p $*
* *
* $Revision:: 13 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef _INSTALLER_H
#define _INSTALLER_H
// Includes.
#include "RegistryManager.h"
#include "Utilities.h"
#include "Wwuiinput.h"
// Forward declarations.
class AudibleSoundClass;
class CardSelectionDialogClass;
class CopyDialogClass;
class DialogBaseClass;
class FinalDialogClass;
class GameDirectoryDialogClass;
class GameFolderDialogClass;
class INIClass;
class NDADialogClass;
class LicenseDialogClass;
class MixFileFactoryClass;
class ReviewDialogClass;
class SerialDialogClass;
class WelcomeDialogClass;
class WhatToInstallDialogClass;
class WOL1DialogClass;
class WOL2DialogClass;
class WOLDirectoryDialogClass;
class WOLFolderDialogClass;
class WWAudioClass;
class WW3DAssetManager;
// Class definitions.
class InstallerUIInputClass : public WWUIInputClass
{
public:
InstallerUIInputClass() : WWUIInputClass(), MousePosition (Vector3 (0.0f, 0.0f, 0.0f)) {}
void Add_Mouse_Wheel (short delta)
{
MousePosition.Z += delta;
}
private:
const Vector3 &Get_Mouse_Pos (void) const
{
POINT cursorposition;
GetCursorPos (&cursorposition);
ScreenToClient (MainWindow, &cursorposition);
MousePosition.X = cursorposition.x;
MousePosition.Y = cursorposition.y;
return (MousePosition);
}
void Set_Mouse_Pos (const Vector3 &position)
{
POINT p;
if (GameInFocus) {
p.x = position.X;
p.y = position.Y;
ClientToScreen (MainWindow, &p);
SetCursorPos (p.x, p.y);
MousePosition.X = p.x;
MousePosition.Y = p.y;
}
}
bool Is_Button_Down (int vk_mouse_button_id)
{
bool retval = false;
switch (vk_mouse_button_id)
{
case VK_LBUTTON:
case VK_MBUTTON:
case VK_RBUTTON:
retval = (GetKeyState (vk_mouse_button_id) & 0x80000000) != 0x0;
break;
}
return retval;
}
mutable Vector3 MousePosition;
};
class FileLogClass {
public:
// Equality operator.
bool operator == (const FileLogClass &f) {
return ((RelativePathname == f.RelativePathname) && (Size == f.Size));
}
// Inequality operator.
bool operator != (const FileLogClass &f) {
return (!(*this == f));
}
WideStringClass RelativePathname; // Relative pathname of file.
__int64 Size; // Size of file (in bytes).
};
class InstallerClass
{
public:
InstallerClass();
~InstallerClass();
InstallerUIInputClass *Get_Input() {return (UIInput);}
void Cancel_Introduction() {CancelIntroduction = true;}
void Install (MixFileFactoryClass *mixfilefactory);
void Dialog_Callback (DialogBaseClass *dialog, int ctrl_id, int message_id, DWORD param);
void On_Prog_End();
// Main interface.
const WCHAR *Get_Source_Game_Path (WideStringClass &path) {path = SourceGamePath; return (path);}
const WCHAR *Get_Source_WOL_Path (WideStringClass &path) {path = SourceWOLPath; return (path);}
bool Install_Game();
bool Install_WOL();
bool Install_Game_Shortcut();
__int64 Get_Game_Size (bool ondisk);
__int64 Get_WOL_Size (bool ondisk);
__int64 Get_Total_Size (bool ondisk);
bool Get_Game_Space_Available (const WideStringClass &path, __int64 &diskspace) {return (Get_Disk_Space_Available (path, diskspace));}
bool Get_WOL_Space_Available (const WideStringClass &path, __int64 &diskspace);
const char *Get_Serial_Number (StringClass &serialnumber);
const WCHAR *Get_Target_Game_Path (WideStringClass &path);
bool Get_Target_Sub_Path (unsigned index, WideStringClass &subdirectoryname);
const WCHAR *Get_Target_WOL_Path (WideStringClass &path);
const WCHAR *Get_Target_Game_Folder (WideStringClass &folder);
const WCHAR *Get_Target_WOL_Folder (WideStringClass &folder);
bool Is_Fresh_Game_Install() {return (FreshGameInstall);}
bool Is_Fresh_WOL_Install() {return (FreshWOLInstall);}
bool Is_Target_WOL_Older_Than_Source() {return (TargetWOLOlder);}
WW3DAssetManager *Get_Asset_Manager() {return (AssetManager);}
bool Can_Use_IGR_Settings();
bool Use_IGR_Settings();
bool Beta_Test();
// Registry interface.
void Update_Registry();
void Create_Links();
bool Get_WOL_Account (unsigned index, WideStringClass &name, WideStringClass &password);
void Set_Preferred_WOL_Account (const WideStringClass &accountname) {_RegistryManager.Set_Preferred_WOL_Account (accountname);}
// File/subdirectory logging interface.
void Log (const WideStringClass &pathname, __int64 size = -1);
void Create_Uninstall_Logs();
protected:
enum ProgEndActionEnum {
ACTION_NONE,
ACTION_RUN_GAME,
ACTION_DISPLAY_README
};
// Internal initialization/shutdown.
void Initialize();
void Shutdown();
bool WW3D_Initialize (int cardselection = -1);
void WW3D_Shutdown();
// Support functions.
bool Check_Source();
void Count_Source_Files (const WideStringClass &sourcepath, unsigned &filecount, __int64 &filesize);
void Check_Existing_Install();
void Auto_Configure();
bool Register_COM_Server (const WideStringClass &comdll);
void Create_Encryption_File (const WideStringClass &pathname);
void Encrypt (const char *number, const WideStringClass &pathname, StringClass &encryptednumber);
bool Create_File_Link (const WideStringClass &linkpath, const WideStringClass &title, const WideStringClass &targetpathname, const WideStringClass &iconpathname, const WideStringClass *arguments = NULL);
bool Create_URL_Link (const WideStringClass &linkpath, const WideStringClass &title, const WideStringClass &url);
bool Has_WOL_Account();
void Create_Game_Uninstall_Log();
void Create_WOL_Uninstall_Log();
void Run_Game();
void Display_Readme();
// Data.
INIClass *SetupIni;
INIClass *GameIni;
INIClass *WOLIni;
WideStringClass SourceGamePath;
WideStringClass SourceWOLPath;
MixFileFactoryClass *MixFileFactory;
DynamicVectorClass <WideStringClass> FontNames;
WideStringClass TargetGamePath;
bool FreshGameInstall;
bool FreshWOLInstall;
bool TargetWOLOlder;
unsigned GameFileCount;
__int64 GameSize;
unsigned WOLFileCount;
__int64 WOLSize;
WW3DAssetManager *AssetManager;
bool WwmathInitialized;
bool DialogMgrInitialized;
WWAudioClass *AudioSystem;
AudibleSoundClass *TransitionMusic;
AudibleSoundClass *InstallMusic;
InstallerUIInputClass *UIInput;
bool CancelIntroduction;
bool CancelApplication;
WelcomeDialogClass *WelcomeDialog;
NDADialogClass *NDADialog;
LicenseDialogClass *LicenseDialog;
SerialDialogClass *SerialDialog;
WhatToInstallDialogClass *WhatToInstallDialog;
GameDirectoryDialogClass *GameDirectoryDialog;
GameFolderDialogClass *GameFolderDialog;
WOLDirectoryDialogClass *WOLDirectoryDialog;
WOLFolderDialogClass *WOLFolderDialog;
ReviewDialogClass *ReviewDialog;
CopyDialogClass *CopyDialog;
WOL1DialogClass *WOL1Dialog;
WOL2DialogClass *WOL2Dialog;
FinalDialogClass *FinalDialog;
CardSelectionDialogClass *CardSelectionDialog;
DynamicVectorClass <WideStringClass> GameSubdirectories;
DynamicVectorClass <FileLogClass> GameFiles;
DynamicVectorClass <FileLogClass> WOLFiles;
ProgEndActionEnum ProgEndAction;
};
// Singleton.
extern InstallerClass _Installer;
#endif // INSTALLER_H

626
Code/Installer/Installer.rc Normal file
View File

@@ -0,0 +1,626 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#undef APSTUDIO_HIDDEN_SYMBOLS
#include "resource.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// 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
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_INSTALLER ICON DISCARDABLE "Renegade.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDC_INSTALLER MENU DISCARDABLE
BEGIN
POPUP "&File"
BEGIN
MENUITEM "E&xit", IDM_EXIT
END
POPUP "&Help"
BEGIN
MENUITEM "&About ...", IDM_ABOUT
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_DIALOG_WELCOME DIALOG DISCARDABLE 0, 0, 400, 300
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "IDS_INSTALLER_TEXT001"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "IDS_INSTALLER_TEXT002",IDOK,340,262,50,18
PUSHBUTTON "IDS_INSTALLER_TEXT003",IDCANCEL,10,262,50,18
LTEXT "%hIDS_INSTALLER_TEXT004",IDC_WELCOME_STATIC1,40,78,320,
30
EDITTEXT IDC_WELCOME_EDIT,40,108,320,132,ES_MULTILINE |
ES_AUTOHSCROLL
END
IDD_DIALOG_LICENSE DIALOG DISCARDABLE 0, 0, 400, 300
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "IDS_INSTALLER_TEXT006"
FONT 8, "MS Sans Serif"
BEGIN
EDITTEXT IDC_LICENSE_EDIT,40,73,320,120,ES_MULTILINE |
ES_AUTOHSCROLL
CONTROL "IDS_INSTALLER_TEXT007",IDC_LICENSE_CHECK,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,40,227,320,14
DEFPUSHBUTTON "IDS_INSTALLER_TEXT008",IDOK,340,262,50,18
PUSHBUTTON "IDS_INSTALLER_TEXT009",IDC_BUTTON_BACK,280,262,50,18
PUSHBUTTON "IDS_INSTALLER_TEXT010",IDCANCEL,10,262,50,18
LTEXT "IDS_INSTALLER_TEXT011",IDC_LICENSE_HEADING,40,59,320,14
LTEXT "IDS_INSTALLER_TEXT012",IDC_LICENSE_QUERY,40,210,320,14
END
IDD_DIALOG_SERIAL DIALOG DISCARDABLE 0, 0, 400, 300
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "IDS_INSTALLER_TEXT013"
FONT 8, "MS Sans Serif"
BEGIN
EDITTEXT IDC_SERIAL_EDIT1,105,166,44,18,ES_AUTOHSCROLL |
ES_OEMCONVERT | ES_NUMBER
EDITTEXT IDC_SERIAL_EDIT2,156,166,44,18,ES_AUTOHSCROLL |
ES_OEMCONVERT | ES_NUMBER
EDITTEXT IDC_SERIAL_EDIT3,207,166,44,18,ES_AUTOHSCROLL |
ES_OEMCONVERT | ES_NUMBER
EDITTEXT IDC_SERIAL_EDIT4,258,166,34,18,ES_AUTOHSCROLL |
ES_OEMCONVERT | ES_NUMBER
DEFPUSHBUTTON "IDS_INSTALLER_TEXT014",IDOK,340,262,50,18
PUSHBUTTON "IDS_INSTALLER_TEXT015",IDC_BUTTON_BACK,280,262,50,18
PUSHBUTTON "IDS_INSTALLER_TEXT016",IDCANCEL,10,262,50,18
LTEXT "IDS_INSTALLER_TEXT017",IDC_SERIAL_STATIC,40,116,320,40
END
IDD_DIALOG_MESSAGE_BOX_OK DIALOG DISCARDABLE 0, 0, 186, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "IDS_INSTALLER_TEXT018"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "IDS_INSTALLER_TEXT019",IDOK,65,62,50,18
LTEXT "IDS_INSTALLER_TEXT020",IDC_MESSAGE_BOX_STATIC,15,15,156,
46
END
IDD_DIALOG_WHAT_TO_INSTALL DIALOG DISCARDABLE 0, 0, 400, 300
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "IDS_INSTALLER_TEXT021"
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "IDS_INSTALLER_TEXT022",IDC_WHAT_TO_INSTALL_CHECK1,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,40,122,320,14
CONTROL "IDS_INSTALLER_TEXT023",IDC_WHAT_TO_INSTALL_CHECK3,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,40,143,320,14
CONTROL "IDS_INSTALLER_TEXT024",IDC_WHAT_TO_INSTALL_CHECK2,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,40,164,320,14
CONTROL "IDS_INSTALLER_TEXT025",IDC_WHAT_TO_INSTALL_CHECK4,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,40,185,320,14
DEFPUSHBUTTON "IDS_INSTALLER_TEXT026",IDOK,340,262,50,18
PUSHBUTTON "IDS_INSTALLER_TEXT027",IDC_BUTTON_BACK,280,262,50,18
PUSHBUTTON "IDS_INSTALLER_TEXT028",IDCANCEL,10,262,50,18
LTEXT "IDS_INSTALLER_TEXT029",IDC_WHAT_TO_INSTALL_STATIC,40,
101,320,14
END
IDD_DIALOG_MESSAGE_BOX_YES_NO DIALOG DISCARDABLE 0, 0, 186, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "IDS_INSTALLER_TEXT030"
FONT 8, "MS Sans Serif"
BEGIN
PUSHBUTTON "IDS_INSTALLER_TEXT031",IDC_BUTTON_YES,15,62,50,18
DEFPUSHBUTTON "IDS_INSTALLER_TEXT032",IDC_BUTTON_NO,121,62,50,18
LTEXT "IDS_INSTALLER_TEXT033",IDC_MESSAGE_BOX_STATIC,15,15,156,
46
END
IDD_DIALOG_DIRECTORY DIALOG DISCARDABLE 0, 0, 400, 300
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "IDS_INSTALLER_TEXT034"
FONT 8, "MS Sans Serif"
BEGIN
EDITTEXT IDC_DIRECTORY_EDIT,40,121,320,20,ES_AUTOHSCROLL
DEFPUSHBUTTON "IDS_INSTALLER_TEXT035",IDOK,340,262,50,18
PUSHBUTTON "IDS_INSTALLER_TEXT036",IDC_BUTTON_BACK,280,262,50,18
PUSHBUTTON "IDS_INSTALLER_TEXT037",IDC_BUTTON_BROWSE,70,262,72,18
PUSHBUTTON "IDS_INSTALLER_TEXT038",IDCANCEL,10,262,50,18
LTEXT "IDS_INSTALLER_TEXT039",IDC_DIRECTORY_STATIC1,40,94,320,
24
LTEXT "IDS_INSTALLER_TEXT040",IDC_DIRECTORY_STATIC2,40,161,320,
14
LTEXT "IDS_INSTALLER_TEXT041",IDC_DIRECTORY_STATIC3,40,181,320,
14
END
IDD_DIALOG_FOLDER DIALOG DISCARDABLE 0, 0, 400, 300
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "IDS_INSTALLER_TEXT042"
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "IDS_INSTALLER_TEXT043",IDC_FOLDER_LIST,"SysListView32",
LVS_LIST | LVS_SINGLESEL | LVS_NOCOLUMNHEADER |
WS_BORDER | WS_TABSTOP,40,107,320,74
EDITTEXT IDC_FOLDER_EDIT,40,217,320,20,ES_AUTOHSCROLL
DEFPUSHBUTTON "IDS_INSTALLER_TEXT044",IDOK,340,262,50,18
PUSHBUTTON "IDS_INSTALLER_TEXT045",IDC_BUTTON_BACK,280,262,50,18
PUSHBUTTON "IDS_INSTALLER_TEXT046",IDCANCEL,10,262,50,18
LTEXT "IDS_INSTALLER_TEXT047",IDC_FOLDER_STATIC1,40,63,320,26
LTEXT "IDS_INSTALLER_TEXT048",IDC_FOLDER_STATIC2,40,92,320,14
LTEXT "IDS_INSTALLER_TEXT049",IDC_FOLDER_STATIC3,40,203,320,14
END
IDD_DIALOG_REVIEW DIALOG DISCARDABLE 0, 0, 400, 300
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "IDS_INSTALLER_TEXT050"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "IDS_INSTALLER_TEXT051",IDOK,340,262,50,18
PUSHBUTTON "IDS_INSTALLER_TEXT052",IDC_BUTTON_BACK,280,262,50,18
PUSHBUTTON "IDS_INSTALLER_TEXT053",IDCANCEL,10,262,50,18
LTEXT "IDS_INSTALLER_TEXT054",IDC_REVIEW_STATIC1,40,65,320,52
LTEXT "IDS_INSTALLER_TEXT055",IDC_REVIEW_STATIC2,40,120,320,14
EDITTEXT IDC_REVIEW_EDIT,40,135,320,100,ES_MULTILINE |
ES_AUTOHSCROLL
END
IDD_DIALOG_WOL1 DIALOG DISCARDABLE 0, 0, 400, 300
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "IDS_INSTALLER_TEXT056"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "IDS_INSTALLER_TEXT057",IDC_BUTTON_YES,280,262,50,18
PUSHBUTTON "IDS_INSTALLER_TEXT058",IDC_BUTTON_NO,340,262,50,18
LTEXT "IDS_INSTALLER_TEXT059",IDC_WOL1_STATIC,40,118,320,64
PUSHBUTTON "IDS_INSTALLER_TEXT085",IDCANCEL,10,262,50,18
END
IDD_DIALOG_FINAL DIALOG DISCARDABLE 0, 0, 400, 300
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "IDS_INSTALLER_TEXT060"
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "IDS_INSTALLER_TEXT061",IDC_FINAL_CHECK1,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,40,118,320,14
CONTROL "IDS_INSTALLER_TEXT062",IDC_FINAL_CHECK2,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,40,138,320,14
CONTROL "IDS_INSTALLER_TEXT063",IDC_FINAL_CHECK3,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,40,158,320,14
DEFPUSHBUTTON "IDS_INSTALLER_TEXT064",IDOK,340,262,50,18
LTEXT "%hIDS_INSTALLER_TEXT065",IDC_FINAL_STATIC1,40,66,320,26
LTEXT "IDS_INSTALLER_TEXT066",IDC_FINAL_STATIC2,40,98,320,14
LTEXT "IDS_INSTALLER_TEXT067",IDC_FINAL_STATIC3,40,194,320,40
PUSHBUTTON "IDS_INSTALLER_TEXT068",IDC_BUTTON_BACK,280,262,50,18
END
IDD_DIALOG_TRANSITION DIALOG DISCARDABLE 0, 0, 400, 300
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "IDS_INSTALLER_TEXT069"
FONT 8, "MS Sans Serif"
BEGIN
CTEXT "Static",IDC_TARGETING_SYSTEM_ONLINE,192,74,18,14,NOT
WS_VISIBLE
CTEXT "Static",IDC_EVA_UPDATING1,20,144,360,14,NOT WS_VISIBLE
CTEXT "Static",IDC_EVA_UPDATING2,46,130,334,14,NOT WS_VISIBLE
RTEXT "Static",IDC_PLEASE_STANDBY,20,266,360,14,NOT WS_VISIBLE
LTEXT "Static",IDC_BIO_MONITOR_ACTIVATING,85,254,18,14,NOT
WS_VISIBLE
RTEXT "Static",IDC_UPDATING_WEAPON_STATUS,362,228,18,14,NOT
WS_VISIBLE
RTEXT "Static",IDC_INITIALIZING_OBJECTIVES_SYSTEM,362,44,18,14,
NOT WS_VISIBLE
LTEXT "Static",IDC_SCANNING_LOCAL_RADAR,20,204,19,14,NOT
WS_VISIBLE
END
IDD_DIALOG_COPY DIALOG DISCARDABLE 0, 0, 400, 300
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "IDS_INSTALLER_TEXT071"
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "",IDC_COPY_VIEWER,"MODELVIEWER",WS_TABSTOP,200,48,160,
160
DEFPUSHBUTTON "IDS_INSTALLER_TEXT072",IDOK,340,262,50,18
PUSHBUTTON "IDS_INSTALLER_TEXT073",IDCANCEL,10,262,50,18
LTEXT "IDS_INSTALLER_TEXT074",IDC_COPY_DESCRIPTION,40,100,150,
108
LTEXT "IDS_INSTALLER_TEXT075",IDC_COPY_STATUS1,40,230,272,14
RTEXT "IDS_INSTALLER_TEXT076",IDC_COPY_PERCENTAGE,320,230,40,
14
LTEXT "%hIDS_INSTALLER_TEXT077",IDC_COPY_HEADER,40,70,150,26
CTEXT "%hIDS_INSTALL_COMPLETE",IDC_COPY_STATUS2,40,230,320,24
END
IDD_DIALOG_BROWSER DIALOG DISCARDABLE 0, 0, 320, 239
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "IDS_INSTALLER_TEXT078"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "IDS_INSTALLER_TEXT079",IDOK,263,214,50,18
PUSHBUTTON "IDS_INSTALLER_TEXT080",IDCANCEL,7,214,50,18
CONTROL "IDS_INSTALLER_TEXT081",IDC_BROWSER_TREE,"SysTreeView32",
WS_BORDER | WS_TABSTOP,7,21,306,170
LTEXT "IDS_INSTALLER_TEXT082",IDC_BROWSER_STATIC,7,7,306,14
END
IDD_DIALOG_WOL2 DIALOG DISCARDABLE 0, 0, 400, 300
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "IDS_INSTALLER_TEXT083"
FONT 8, "MS Sans Serif"
BEGIN
EDITTEXT IDC_WOL2_EDIT,40,216,320,20,ES_PASSWORD | ES_AUTOHSCROLL |
ES_OEMCONVERT
DEFPUSHBUTTON "IDS_INSTALLER_TEXT084",IDOK,340,262,50,18
PUSHBUTTON "IDS_INSTALLER_TEXT085",IDCANCEL,10,262,50,18
CONTROL "IDS_INSTALLER_TEXT086",IDC_WOL2_LIST,"SysListView32",
LVS_LIST | LVS_SINGLESEL | LVS_NOCOLUMNHEADER |
WS_BORDER | WS_TABSTOP,39,79,320,90
LTEXT "IDS_INSTALLER_TEXT087",IDC_WOL2_STATIC1,40,64,320,14
LTEXT "IDS_INSTALLER_TEXT088",IDC_WOL2_STATIC2,40,201,320,14
END
IDD_DIALOG_CARD_SELECTION DIALOG DISCARDABLE 0, 0, 400, 300
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "IDS_INSTALLER_TEXT089"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "IDS_INSTALLER_TEXT090",IDOK,340,262,50,18
PUSHBUTTON "IDS_INSTALLER_TEXT091",IDCANCEL,10,262,50,18
CONTROL "IDS_INSTALLER_TEXT092",IDC_CARD_SELECTION_LIST,
"SysListView32",LVS_LIST | LVS_SINGLESEL |
LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,40,118,320,
80
LTEXT "IDS_INSTALLER_TEXT093",IDC_STATIC,40,103,320,14
END
IDD_DIALOG_MESSAGE_BOX_RETRY_QUIT DIALOG DISCARDABLE 0, 0, 186, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "IDS_RETRY",IDC_BUTTON_RETRY,15,62,50,18
PUSHBUTTON "IDS_QUIT",IDC_BUTTON_QUIT,121,62,50,18
LTEXT "IDS_FILE_SYSTEM_ERROR",IDC_STATIC,15,15,156,47
END
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
"#include ""windows.h""\r\n"
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
"#include ""resource.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_DIALOG_WELCOME, DIALOG
BEGIN
LEFTMARGIN, 10
RIGHTMARGIN, 390
TOPMARGIN, 20
BOTTOMMARGIN, 280
END
IDD_DIALOG_LICENSE, DIALOG
BEGIN
LEFTMARGIN, 10
RIGHTMARGIN, 390
TOPMARGIN, 20
BOTTOMMARGIN, 280
END
IDD_DIALOG_SERIAL, DIALOG
BEGIN
LEFTMARGIN, 10
RIGHTMARGIN, 390
TOPMARGIN, 20
BOTTOMMARGIN, 280
END
IDD_DIALOG_MESSAGE_BOX_OK, DIALOG
BEGIN
LEFTMARGIN, 15
RIGHTMARGIN, 171
TOPMARGIN, 15
BOTTOMMARGIN, 80
END
IDD_DIALOG_WHAT_TO_INSTALL, DIALOG
BEGIN
LEFTMARGIN, 10
RIGHTMARGIN, 390
TOPMARGIN, 20
BOTTOMMARGIN, 280
END
IDD_DIALOG_MESSAGE_BOX_YES_NO, DIALOG
BEGIN
LEFTMARGIN, 15
RIGHTMARGIN, 171
TOPMARGIN, 15
BOTTOMMARGIN, 80
END
IDD_DIALOG_DIRECTORY, DIALOG
BEGIN
LEFTMARGIN, 10
RIGHTMARGIN, 390
TOPMARGIN, 20
BOTTOMMARGIN, 280
END
IDD_DIALOG_FOLDER, DIALOG
BEGIN
LEFTMARGIN, 10
RIGHTMARGIN, 390
TOPMARGIN, 20
BOTTOMMARGIN, 280
END
IDD_DIALOG_REVIEW, DIALOG
BEGIN
LEFTMARGIN, 10
RIGHTMARGIN, 390
TOPMARGIN, 20
BOTTOMMARGIN, 280
END
IDD_DIALOG_WOL1, DIALOG
BEGIN
LEFTMARGIN, 10
RIGHTMARGIN, 390
TOPMARGIN, 20
BOTTOMMARGIN, 280
END
IDD_DIALOG_FINAL, DIALOG
BEGIN
LEFTMARGIN, 10
RIGHTMARGIN, 390
TOPMARGIN, 20
BOTTOMMARGIN, 280
END
IDD_DIALOG_TRANSITION, DIALOG
BEGIN
LEFTMARGIN, 20
RIGHTMARGIN, 380
TOPMARGIN, 20
BOTTOMMARGIN, 280
END
IDD_DIALOG_COPY, DIALOG
BEGIN
LEFTMARGIN, 10
RIGHTMARGIN, 390
TOPMARGIN, 20
BOTTOMMARGIN, 280
END
IDD_DIALOG_BROWSER, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 313
TOPMARGIN, 7
BOTTOMMARGIN, 232
END
IDD_DIALOG_WOL2, DIALOG
BEGIN
LEFTMARGIN, 10
RIGHTMARGIN, 390
TOPMARGIN, 20
BOTTOMMARGIN, 280
END
IDD_DIALOG_CARD_SELECTION, DIALOG
BEGIN
LEFTMARGIN, 10
RIGHTMARGIN, 390
TOPMARGIN, 20
BOTTOMMARGIN, 280
END
IDD_DIALOG_MESSAGE_BOX_RETRY_QUIT, DIALOG
BEGIN
LEFTMARGIN, 15
RIGHTMARGIN, 171
TOPMARGIN, 15
BOTTOMMARGIN, 80
END
END
#endif // APSTUDIO_INVOKED
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,6,0,0
PRODUCTVERSION 1,6,0,0
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", "Westwood Studios\0"
VALUE "FileDescription", "Setup\0"
VALUE "FileVersion", "1, 6, 0, 0\0"
VALUE "InternalName", "Setup\0"
VALUE "LegalCopyright", "Copyright <20> 2002 Electronic Arts\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "Setup.exe\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "Renegade Setup\0"
VALUE "ProductVersion", "1, 6, 0, 0\0"
VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_WWCONFIG_FILENAME "WWConfig.exe"
IDS_APPLICATION_MAIN_WINDOW "Renegade Setup"
IDS_AUTORUN_MAIN_WINDOW "Renegade Autorun"
IDS_RESOURCE_APPLICATION_ERROR "Renegade Setup Error"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_WOLAPI_SKU "32512"
IDS_WOLREGISTER_SKU "32256"
IDS_GAME_EXECUTABLE_FILENAME "Renegade.exe"
IDS_WORD_README_FILENAME "ReadMe.doc"
IDS_README_ICON_FILENAME "Notes.ico"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_GAME_UNINSTALL_FILENAME "Uninstll.exe"
IDS_INTERNET_REGISTRATION_FILENAME "Register.exe"
IDS_WOL_UNINSTALL_FILENAME "UnstllAP.exe"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_INSTALL_CD_VOLUME_NAME "Renegade Game"
IDS_GAME_PRODUCT_KEY "Renegade"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_GAME_INI_FILENAME "Renegade.ini"
IDS_SETUP_INI_FILENAME "Setup.ini"
IDS_WOL_INI_FILENAME "WOLAPI.ini"
IDS_WOLAPI_DLL_FILENAME "WOLAPI.dll"
IDS_WOLBROWSER_DLL_FILENAME "WOLBrowser.dll"
IDS_TEXT_README_FILENAME "ReadMe.txt"
IDS_GAME_UNINSTALL_LOG_FILENAME "Uninst.wsu"
IDS_WOL_UNINSTALL_LOG_FILENAME "UninstAP.wsu"
IDS_SERIAL_ENCRYPTION_FILENAME "WOLData.key"
IDS_GAME_DIRECTORY_NAME "Install"
IDS_WOL_DIRECTORY_NAME "WOLAPI"
IDS_NON_DISCLOSURE_AGREEMENT
"Pre-Release Software Confidentiality Agreement"
IDS_AGREE_TO_NDA "Do you accept all the terms of the Agreement?"
IDS_RESOURCE_DEFAULT_GAME_PATH "C:\\Westwood\\Renegade"
IDS_RESOURCE_DEFAULT_WOL_PATH "C:\\Westwood\\Internet"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_RESOURCE_DEFAULT_GAME_FOLDER "Westwood"
IDS_RESOURCE_DEFAULT_WOL_FOLDER "Westwood"
IDS_RESOURCE_GAME_PRODUCT_NAME "Renegade"
IDS_RESOURCE_WOL_PRODUCT_NAME "Shared Internet Components"
IDS_RESOURCE_WOLREGISTER_NAME "Internet Registration"
IDS_RESOURCE_WOLBROWSER_NAME "WOLBrowser"
IDS_RESOURCE_AUTO_UPDATE_TITLE "Renegade Auto Update"
IDS_RESOURCE_README_TITLE "Renegade ReadMe"
IDS_RESOURCE_GAME_UNINSTALL_TITLE "Renegade Uninstall"
IDS_RESOURCE_INTERNET_REGISTRATION_TITLE "Internet Registration"
IDS_RESOURCE_WWCONFIG_TITLE "Renegade Config"
IDS_RESOURCE_WOL_UNINSTALL_TITLE "Uninstall Registration"
IDS_RESOURCE_VERBOSE_GAME_PRODUCT_NAME "Command & Conquer Renegade"
IDS_RESOURCE_PLAY_ONLINE_WITH_GAMESPY "Play Online with GameSpy Arcade"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@@ -0,0 +1,218 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/LicenseDialog.cp $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 12/04/01 5:17p $*
* *
* $Revision:: 7 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// Includes.
#include "LicenseDialog.h"
#include "CheckBoxCtrl.h"
#include "ErrorHandler.h"
#include "MessageBox.h"
#include "Resource.h"
#include "Translator.h"
/***********************************************************************************************
* LicenseDialogClass::On_Init_Dialog -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void LicenseDialogClass::On_Init_Dialog (void)
{
Load_License ("License.txt");
// Set initial check text to 'agree' but uncheck it so that the user must consiously check it.
#if NDEBUG
Check_Dlg_Button (IDC_LICENSE_CHECK, false);
#else
Check_Dlg_Button (IDC_LICENSE_CHECK, true);
#endif
Set_Dlg_Item_Text (IDC_LICENSE_CHECK, TxWideStringClass (IDS_AGREE_TO_TERMS));
InstallMenuDialogClass::On_Init_Dialog();
}
/***********************************************************************************************
* LicenseDialogClass::Load_License -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void LicenseDialogClass::Load_License (const char *licensefilename)
{
HANDLE file;
BY_HANDLE_FILE_INFORMATION fileinformation;
// Load up the license agreement text.
// NOTE: This agreement should be in Unicode.
file = CreateFile (licensefilename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0L, NULL);
// If the file exists...
if (file != INVALID_HANDLE_VALUE) {
if (!GetFileInformationByHandle (file, &fileinformation)) FATAL_SYSTEM_ERROR;
// Does header exist?
if ((fileinformation.nFileSizeHigh == 0) && (fileinformation.nFileSizeLow >= sizeof (WCHAR))) {
int length;
unsigned long bytesreadcount;
WCHAR *buffer;
length = fileinformation.nFileSizeLow / sizeof (WCHAR);
buffer = new WCHAR [length + 1];
if (ReadFile (file, buffer, length * sizeof (WCHAR), &bytesreadcount, NULL)) {
unsigned s, d;
buffer [length] = L'\0';
// Advance past header.
s = 1;
// Strip 0x000D characters from the license text - they're not parsed as carriage return by the multi-line edit control.
d = 0;
while (true) {
if (buffer [s] != 0x000D) {
buffer [d] = buffer [s];
d++;
}
if (buffer [s] == 0x000) break;
s++;
}
Set_Dlg_Item_Text (IDC_LICENSE_EDIT, buffer);
}
delete [] buffer;
}
if (!CloseHandle (file)) FATAL_SYSTEM_ERROR;
}
}
/***********************************************************************************************
* LicenseDialogClass::On_Command -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void LicenseDialogClass::On_Command (int ctrl_id, int message_id, DWORD param)
{
switch (ctrl_id)
{
case IDC_LICENSE_CHECK:
{
CheckBoxCtrlClass *check = Get_Dlg_Item (IDC_LICENSE_CHECK)->As_CheckBoxCtrlClass();
if (check->Get_Check()) {
check->Set_Text (TxWideStringClass (IDS_AGREE_TO_TERMS));
} else {
check->Set_Text (TxWideStringClass (IDS_NOT_AGREE_TO_TERMS));
}
break;
}
case IDOK:
{
CheckBoxCtrlClass *check = Get_Dlg_Item (IDC_LICENSE_CHECK)->As_CheckBoxCtrlClass();
if (!check->Get_Check()) {
MessageBoxClass::Do_Dialog (TxWideStringClass (IDS_WARNING), TxWideStringClass (IDS_MUST_ACCEPT), MessageBoxClass::MESSAGE_BOX_TYPE_OK);
return;
} else {
break;
}
}
default:
break;
}
InstallMenuDialogClass::On_Command (ctrl_id, message_id, param);
}
/***********************************************************************************************
* NDADialogClass::On_Init_Dialog -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void NDADialogClass::On_Init_Dialog (void)
{
Load_License ("NDA.txt");
Set_Dlg_Item_Text (IDC_LICENSE_HEADING, RxWideStringClass (IDS_NON_DISCLOSURE_AGREEMENT));
Set_Dlg_Item_Text (IDC_LICENSE_QUERY, RxWideStringClass (IDS_AGREE_TO_NDA));
// Set initial check text to 'agree' but uncheck it so that the user must consiously check it.
#if NDEBUG
Check_Dlg_Button (IDC_LICENSE_CHECK, false);
#else
Check_Dlg_Button (IDC_LICENSE_CHECK, true);
#endif
Set_Dlg_Item_Text (IDC_LICENSE_CHECK, TxWideStringClass (IDS_AGREE_TO_TERMS));
InstallMenuDialogClass::On_Init_Dialog();
}

View File

@@ -0,0 +1,76 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/LicenseDialog. $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 12/04/01 4:56p $*
* *
* $Revision:: 3 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef _LICENSE_DIALOG_H
#define _LICENSE_DIALOG_H
// Includes.
#include "InstallMenuDialog.h"
// Dialog to display the Software License Agreement. User must agree to these terms
// before proceeding.
// Classes.
class LicenseDialogClass : public InstallMenuDialogClass
{
public:
LicenseDialogClass() : InstallMenuDialogClass (IDD_DIALOG_LICENSE) {}
// RTTI.
void *As_LicenseDialogClass() {return (this);}
void On_Command (int ctrl_id, int message_id, DWORD param);
protected:
void Load_License (const char *licensefilename);
void On_Init_Dialog (void);
};
class NDADialogClass : public LicenseDialogClass
{
public:
NDADialogClass() : LicenseDialogClass() {}
// RTTI.
void *As_NDADialogClass() {return (this);}
protected:
void On_Init_Dialog (void);
};
#endif // _LICENSE_DIALOG_H

View File

@@ -0,0 +1,151 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/MessageBox.cpp $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 11/29/01 3:54p $*
* *
* $Revision:: 4 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// Includes.
#include "ErrorHandler.h"
#include "MessageBox.h"
#include "InstallMenuDialog.h"
#include "Resource.h"
/***********************************************************************************************
* MessageBoxClass::Create_Dialog -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
MessageBoxClass *MessageBoxClass::Create_Dialog (const WCHAR *title, const WCHAR *text, MessageBoxTypeEnum type, CallbackMenuDialogClass *callbackobject)
{
MessageBoxClass *popup;
switch (type) {
case MESSAGE_BOX_TYPE_OK:
popup = NEW_REF (MessageBoxClass, (IDD_DIALOG_MESSAGE_BOX_OK, callbackobject));
break;
case MESSAGE_BOX_TYPE_YES_NO:
popup = NEW_REF (MessageBoxClass, (IDD_DIALOG_MESSAGE_BOX_YES_NO, callbackobject));
break;
case MESSAGE_BOX_TYPE_RETRY_QUIT:
popup = NEW_REF (MessageBoxClass, (IDD_DIALOG_MESSAGE_BOX_RETRY_QUIT, callbackobject));
break;
};
popup->Start_Dialog();
popup->Set_Title (title);
popup->Set_Dlg_Item_Text (IDC_MESSAGE_BOX_STATIC, text);
popup->Build_Background_Renderers();
return (popup);
}
/***********************************************************************************************
* MessageBoxClass::Do_Dialog -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void MessageBoxClass::Do_Dialog (const WCHAR *title, const WCHAR *text, MessageBoxTypeEnum type, CallbackMenuDialogClass *callbackobject)
{
MessageBoxClass *popup;
popup = Create_Dialog (title, text, type, callbackobject);
REF_PTR_RELEASE (popup);
}
/***********************************************************************************************
* MessageBoxClass::On_Command -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void MessageBoxClass::On_Command (int ctrl_id, int message_id, DWORD param)
{
if (CallbackObject != NULL) {
CallbackObject->Callback (ctrl_id, this);
}
End_Dialog();
}
/***********************************************************************************************
* CallbackMenuDialogClass::Callback -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void CallbackMenuDialogClass::Callback (int id, PopupDialogClass *popup)
{
switch (id) {
case IDC_BUTTON_YES:
MenuDialogClass::On_Command (IDCANCEL, 0, 0);
break;
default:
break;
}
}

View File

@@ -0,0 +1,83 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/MessageBox.h $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 11/28/01 12:50a $*
* *
* $Revision:: 5 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef _MESSAGE_BOX_H
#define _MESSAGE_BOX_H
// Includes.
#include "PopupDialog.h"
#include "MenuDialog.h"
// Forward declarations.
class CallbackMenuDialogClass;
// Simple pop-up style message box.
class MessageBoxClass : public PopupDialogClass
{
public:
enum MessageBoxTypeEnum {
MESSAGE_BOX_TYPE_OK,
MESSAGE_BOX_TYPE_YES_NO,
MESSAGE_BOX_TYPE_RETRY_QUIT
};
MessageBoxClass (int res_id, CallbackMenuDialogClass *callbackobject) : PopupDialogClass (res_id), CallbackObject (callbackobject) {}
static MessageBoxClass *Create_Dialog (const WCHAR *title, const WCHAR *text, MessageBoxTypeEnum type, CallbackMenuDialogClass *callbackobject);
static void Do_Dialog (const WCHAR *title, const WCHAR *text, MessageBoxTypeEnum type, CallbackMenuDialogClass *callbackobject = NULL);
void On_Command (int ctrl_id, int message_id, DWORD param);
protected:
CallbackMenuDialogClass *CallbackObject;
};
// Interface class to inherit if you want to be notified of a key press from the message box.
class CallbackMenuDialogClass : public MenuDialogClass
{
public:
CallbackMenuDialogClass (int resourceid) : MenuDialogClass (resourceid) {}
virtual void Callback (int id, PopupDialogClass *popup);
};
#endif // _MESSAGE_BOX_H

View File

@@ -0,0 +1,137 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/RAMFileFactory.cpp $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 10/31/01 2:57p $*
* *
* $Revision:: 2 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// Includes.
#include "RAMFileFactory.h"
#include "BuffFile.h"
#include "RamFile.h"
/***********************************************************************************************
* RAMFileFactoryClass::RAMFileFactoryClass -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
RAMFileFactoryClass::RAMFileFactoryClass()
: FileFactoryClass(),
FileBuffer (NULL)
{
}
/***********************************************************************************************
* RAMFileFactoryClass::RAMFileFactoryClass -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
RAMFileFactoryClass::~RAMFileFactoryClass()
{
if (FileBuffer != NULL) delete [] FileBuffer;
}
/***********************************************************************************************
* RAMFileFactoryClass::Get_File -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
FileClass *RAMFileFactoryClass::Get_File (const char *filename)
{
RAMFileClass *ramfile;
// If file buffer has not been read then do it now.
if ((FileBuffer == NULL) || (stricmp (filename, FileName) != 0)) {
BufferedFileClass *bufferfile;
if (FileBuffer != NULL) delete [] FileBuffer;
bufferfile = new BufferedFileClass (filename);
if ((bufferfile != NULL) && bufferfile->Is_Available()) {
FileBuffer = new unsigned char [bufferfile->Size()];
bufferfile->Open();
bufferfile->Read (FileBuffer, bufferfile->Size());
}
FileBufferSize = bufferfile->Size();
FileName = filename;
// Clean-up.
delete bufferfile;
}
ramfile = new RAMFileClass (FileBuffer, FileBufferSize);
return (ramfile);
}
/***********************************************************************************************
* RAMFileFactoryClass::Return_File -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void RAMFileFactoryClass::Return_File (FileClass *file)
{
delete file;
}

View File

@@ -0,0 +1,61 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/RAMFileFactory.h $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 10/31/01 2:52p $*
* *
* $Revision:: 2 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef _RAM_FILE_FACTORY_H
#define _RAM_FILE_FACTORY_H
// Includes.
#include "FFactory.h"
// Classes
class RAMFileFactoryClass : public FileFactoryClass {
public:
RAMFileFactoryClass();
~RAMFileFactoryClass();
FileClass *Get_File (const char *filename);
void Return_File (FileClass *file);
protected:
unsigned char *FileBuffer;
unsigned FileBufferSize;
StringClass FileName;
};
#endif // RAM_FILE_FACTORY_H

View File

@@ -0,0 +1,934 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/RegistryManager.cpp $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 1/25/02 5:09p $*
* *
* $Revision:: 11 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// Includes.
#include "Installer.h"
#include "ErrorHandler.h"
#include "RegistryManager.h"
#include "Resource.h"
#include "Translator.h"
#include "Utilities.h"
#include "Win.h"
#include <mmsystem.h>
#include <winreg.h>
// Defines.
#define SHELL_FOLDERS_KEY "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"
#define PROGRAMS_PATH_KEY "Programs"
#define DESKTOP_PATH_KEY "Desktop"
#define SOFTWARE_KEY "Software"
#define WESTWOOD_KEY "Westwood"
#define NAME_KEY "Name"
#define DESKTOP_SHORTCUT_PATHNAME_KEY "Desktop" // Pathname of shortcut file to launch game.
#define FOLDER_PATH_KEY "FolderPath"
#define INSTALL_PATHNAME_KEY "InstallPath" // NOTE: This is a misnomer. Actually refers to product pathname.
#define LANGUAGE_KEY "Language"
#define SERIAL_KEY "Serial"
#define SKU_KEY "SKU"
#define VERSION_KEY "Version"
#define WOLSETTINGS_KEY "WOLSettings"
#define URL_KEY "URL"
#define WOLAPI_KEY "WOLAPI"
#define WOLREGISTER_KEY "Register"
#define WOLBROWSER_KEY "WOLBrowser"
#define USAGE_KEY "Usage"
#define MICROSOFT_KEY "Microsoft"
#define WINDOWS_KEY "Windows"
#define CURRENT_VERSION_KEY "CurrentVersion"
#define APP_PATHS_KEY "App Paths"
#define PATH_KEY "Path"
#define UNINSTALL_KEY "Uninstall"
#define DISPLAY_NAME_KEY "DisplayName"
#define UNINSTALLER_FILENAME_KEY "UninstallString"
#define EXTENSIONS_KEY "Extensions"
#define DOCUMENT_KEY "doc"
#define WESTWOOD_CHAT_KEY "Wchat"
#define NICKNAME_INDEX_KEY "Nick%u"
#define NICKNAME_KEY "Nick"
#define PASSWORD_KEY "Pass"
#define PREFERRED_LOGIN_KEY "AutoLogin"
#define OPTIONS_KEY "Options"
// Internet Game Room flags.
#define IGR_NO_AUTO_LOGIN 0x01
#define IGR_NEVER_STORE_NICKS 0x02
#define IGR_NEVER_RUN_REG_APP 0x04
#define IGR_ALL (IGR_NO_AUTO_LOGIN | IGR_NEVER_STORE_NICKS | IGR_NEVER_RUN_REG_APP)
#define IGR_NONE 0x00
// Singleton.
RegistryManagerClass _RegistryManager;
/***********************************************************************************************
* RegistryManagerClass::RegistryManagerClass -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
RegistryManagerClass::RegistryManagerClass()
{
WOLKeys [WOLAPI_COMPONENT] = WOLAPI_KEY;
WOLKeys [WOLREGISTER_COMPONENT] = WOLREGISTER_KEY;
WOLKeys [WOLBROWSER_COMPONENT] = WOLBROWSER_KEY;
}
/***********************************************************************************************
* RegistryManagerClass::Get_Folder_Path -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool RegistryManagerClass::Get_Folder_Path (WideStringClass &path)
{
return (Get_String (HKEY_CURRENT_USER, &path, SHELL_FOLDERS_KEY, PROGRAMS_PATH_KEY, NULL));
}
/***********************************************************************************************
* RegistryManagerClass::Get_Desktop_Path -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool RegistryManagerClass::Get_Desktop_Path (WideStringClass &path)
{
return (Get_String (HKEY_CURRENT_USER, &path, SHELL_FOLDERS_KEY, DESKTOP_PATH_KEY, NULL));
}
/***********************************************************************************************
* RegistryManagerClass::Get_Target_Game_Pathname -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool RegistryManagerClass::Get_Target_Game_Pathname (WideStringClass &pathname)
{
return (Get_String (HKEY_LOCAL_MACHINE, &pathname, SOFTWARE_KEY, WESTWOOD_KEY, RxStringClass (IDS_GAME_PRODUCT_KEY), INSTALL_PATHNAME_KEY, NULL));
}
/***********************************************************************************************
* RegistryManagerClass::Get_Target_Game_Path -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool RegistryManagerClass::Get_Target_Game_Path (WideStringClass &path)
{
bool success = false;
WideStringClass pathname;
if (Get_Target_Game_Pathname (pathname)) {
// Remove filename.
path = pathname;
Remove_Trailing_Name (path);
success = true;
}
return (success);
}
/***********************************************************************************************
* RegistryManagerClass::Get_Target_Game_Folder -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool RegistryManagerClass::Get_Target_Game_Folder (WideStringClass &folder)
{
bool success = false;
WideStringClass path, folderpath;
WCHAR *suffixroot;
if (Get_String (HKEY_LOCAL_MACHINE, &path, SOFTWARE_KEY, WESTWOOD_KEY, RxStringClass (IDS_GAME_PRODUCT_KEY), FOLDER_PATH_KEY, NULL)) {
Get_Folder_Path (folderpath);
suffixroot = Extract_Suffix_Root (path, folderpath);
if (suffixroot != NULL) {
folder = path;
success = true;
}
}
return (success);
}
/***********************************************************************************************
* RegistryManagerClass::Get_Target_WOL_Pathname -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool RegistryManagerClass::Get_Target_WOL_Pathname (WOLComponentEnum wolcomponent, WideStringClass &pathname)
{
return (Get_String (HKEY_LOCAL_MACHINE, &pathname, SOFTWARE_KEY, WESTWOOD_KEY, WOLKeys [wolcomponent], INSTALL_PATHNAME_KEY, NULL));
}
/***********************************************************************************************
* RegistryManagerClass::Get_Target_WOL_Path -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool RegistryManagerClass::Get_Target_WOL_Path (WOLComponentEnum wolcomponent, WideStringClass &path)
{
bool success = false;
WideStringClass pathname;
if (Get_Target_WOL_Pathname (wolcomponent, pathname)) {
// Remove filename.
path = pathname;
Remove_Trailing_Name (path);
success = true;
}
return (success);
}
/***********************************************************************************************
* RegistryManagerClass::Get_Target_WOL_Folder -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool RegistryManagerClass::Get_Target_WOL_Folder (WOLComponentEnum wolcomponent, WideStringClass &folder)
{
bool success = false;
WideStringClass path, folderpath;
WCHAR *suffixroot;
if (Get_String (HKEY_LOCAL_MACHINE, &path, SOFTWARE_KEY, WESTWOOD_KEY, WOLKeys [wolcomponent], FOLDER_PATH_KEY, NULL)) {
Get_Folder_Path (folderpath);
suffixroot = Extract_Suffix_Root (path, folderpath);
if (suffixroot != NULL) {
folder = path;
success = true;
}
}
return (success);
}
/***********************************************************************************************
* RegistryManagerClass::Get_WOL_Version -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool RegistryManagerClass::Get_Target_WOL_Version (WOLComponentEnum wolcomponent, DWORD &version)
{
return (Get_Value (HKEY_LOCAL_MACHINE, &version, SOFTWARE_KEY, WESTWOOD_KEY, WOLKeys [wolcomponent], VERSION_KEY, NULL));
}
/***********************************************************************************************
* RegistryManagerClass::Use_IGR_Settings -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool RegistryManagerClass::Use_IGR_Settings (bool &useigrsettings)
{
bool success;
DWORD igrsettings;
success = Get_Value (HKEY_LOCAL_MACHINE, &igrsettings, SOFTWARE_KEY, WESTWOOD_KEY, WOLAPI_KEY, OPTIONS_KEY, NULL);
if (success) {
useigrsettings = (igrsettings == IGR_ALL);
}
return (success);
}
/***********************************************************************************************
* RegistryManagerClass::Register_Game -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void RegistryManagerClass::Register_Game (const WideStringClass &name,
const WideStringClass &installpathname,
const WideStringClass &folderpath,
const WideStringClass &desktopshortcutpathname,
DWORD languageid,
const StringClass &serialnumber,
DWORD sku,
DWORD version)
{
DWORD maskedsku;
RxStringClass gameproductkey (IDS_GAME_PRODUCT_KEY);
WideStringClass wideserialnumber (serialnumber);
WideStringClass s, url;
// The input SKU also contains the languageid in the LSB, so mask this off.
maskedsku = sku & 0xffffff00;
Set_String (HKEY_LOCAL_MACHINE, name, SOFTWARE_KEY, WESTWOOD_KEY, gameproductkey, NAME_KEY, NULL);
Set_String (HKEY_LOCAL_MACHINE, installpathname, SOFTWARE_KEY, WESTWOOD_KEY, gameproductkey, INSTALL_PATHNAME_KEY, NULL);
Set_String (HKEY_LOCAL_MACHINE, folderpath, SOFTWARE_KEY, WESTWOOD_KEY, gameproductkey, FOLDER_PATH_KEY, NULL);
Set_String (HKEY_LOCAL_MACHINE, desktopshortcutpathname, SOFTWARE_KEY, WESTWOOD_KEY, gameproductkey, DESKTOP_SHORTCUT_PATHNAME_KEY, NULL);
Set_Value (HKEY_LOCAL_MACHINE, languageid, SOFTWARE_KEY, WESTWOOD_KEY, gameproductkey, LANGUAGE_KEY, NULL);
Set_String (HKEY_LOCAL_MACHINE, wideserialnumber, SOFTWARE_KEY, WESTWOOD_KEY, gameproductkey, SERIAL_KEY, NULL);
Set_Value (HKEY_LOCAL_MACHINE, sku, SOFTWARE_KEY, WESTWOOD_KEY, gameproductkey, SKU_KEY, NULL);
Set_Value (HKEY_LOCAL_MACHINE, version, SOFTWARE_KEY, WESTWOOD_KEY, gameproductkey, VERSION_KEY, NULL);
s = L"http://renchat2.westwood.com/cgi-bin/cgiclient?ren_clan_manager&request=expand_template&Template=index.html&SKU=%d&LANGCODE=%d&embedded=1";
url.Format (s, maskedsku, languageid);
Set_String (HKEY_LOCAL_MACHINE, url, SOFTWARE_KEY, WESTWOOD_KEY, gameproductkey, WOLSETTINGS_KEY, URL_KEY, "BattleClans", NULL);
s = L"http://renchat2.westwood.com/cgi-bin/cgiclient?ren_clan_manager&request=expand_template&Template=index.html&SKU=%d&LANGCODE=%d";
url.Format (s, maskedsku, languageid);
Set_String (HKEY_LOCAL_MACHINE, url, SOFTWARE_KEY, WESTWOOD_KEY, gameproductkey, WOLSETTINGS_KEY, URL_KEY, "BattleClansX", NULL);
s = L"http://renchat2.westwood.com/renegade_embedded/index.html";
url.Format (s);
Set_String (HKEY_LOCAL_MACHINE, url, SOFTWARE_KEY, WESTWOOD_KEY, gameproductkey, WOLSETTINGS_KEY, URL_KEY, "Ladder", NULL);
s = L"http://renchat2.westwood.com/renegade/index.html";
url.Format (s);
Set_String (HKEY_LOCAL_MACHINE, url, SOFTWARE_KEY, WESTWOOD_KEY, gameproductkey, WOLSETTINGS_KEY, URL_KEY, "LadderX", NULL);
s = L"http://battleclans.westwood.com/cgi-bin/cgiclient?rosetta&request=do_netstatus&LANGCODE=%d&SKU=%d&embedded=1";
url.Format (s, languageid, maskedsku);
Set_String (HKEY_LOCAL_MACHINE, url, SOFTWARE_KEY, WESTWOOD_KEY, gameproductkey, WOLSETTINGS_KEY, URL_KEY, "NetStatus", NULL);
s = L"http://battleclans.westwood.com/cgi-bin/cgiclient?rosetta&request=do_netstatus&LANGCODE=%d&SKU=%d";
url.Format (s, languageid, maskedsku);
Set_String (HKEY_LOCAL_MACHINE, url, SOFTWARE_KEY, WESTWOOD_KEY, gameproductkey, WOLSETTINGS_KEY, URL_KEY, "NetStatusX", NULL);
s = L"http://battleclans.westwood.com/cgi-bin/cgiclient?rosetta&request=do_news&LANGCODE=%d&SKU=%d&embedded=1";
url.Format (s, languageid, maskedsku);
Set_String (HKEY_LOCAL_MACHINE, url, SOFTWARE_KEY, WESTWOOD_KEY, gameproductkey, WOLSETTINGS_KEY, URL_KEY, "News", NULL);
s = L"http://battleclans.westwood.com/cgi-bin/cgiclient?rosetta&request=do_news&LANGCODE=%d&SKU=%d";
url.Format (s, languageid, maskedsku);
Set_String (HKEY_LOCAL_MACHINE, url, SOFTWARE_KEY, WESTWOOD_KEY, gameproductkey, WOLSETTINGS_KEY, URL_KEY, "NewsX", NULL);
s = L"http://renchat2.westwood.com/cgi-bin/cgiclient?live_ren_register&request=expand_template&Template=newreg_menu.html&LANGCODE=%d&embedded=1&SKU=%d";
url.Format (s, languageid, maskedsku);
Set_String (HKEY_LOCAL_MACHINE, url, SOFTWARE_KEY, WESTWOOD_KEY, gameproductkey, WOLSETTINGS_KEY, URL_KEY, "Signup", NULL);
s = L"http://renchat2.westwood.com/cgi-bin/cgiclient?live_ren_register&request=expand_template&Template=newreg_menu.html&LANGCODE=%d&SKU=%d";
url.Format (s, languageid, maskedsku);
Set_String (HKEY_LOCAL_MACHINE, url, SOFTWARE_KEY, WESTWOOD_KEY, gameproductkey, WOLSETTINGS_KEY, URL_KEY, "SignupX", NULL);
// Register the executable with the OS.
s = installpathname;
Remove_Trailing_Name (s);
Set_String (HKEY_LOCAL_MACHINE, s, SOFTWARE_KEY, MICROSOFT_KEY, WINDOWS_KEY, CURRENT_VERSION_KEY, APP_PATHS_KEY, RxStringClass (IDS_GAME_EXECUTABLE_FILENAME), PATH_KEY, NULL);
Set_String (HKEY_LOCAL_MACHINE, installpathname, SOFTWARE_KEY, MICROSOFT_KEY, WINDOWS_KEY, CURRENT_VERSION_KEY, APP_PATHS_KEY, RxStringClass (IDS_GAME_EXECUTABLE_FILENAME), "", NULL);
// Register the uninstall program with the OS.
Set_String (HKEY_LOCAL_MACHINE, TxWideStringClass (IDS_VERBOSE_GAME_PRODUCT_NAME), SOFTWARE_KEY, MICROSOFT_KEY, WINDOWS_KEY, CURRENT_VERSION_KEY, UNINSTALL_KEY, RxStringClass (IDS_GAME_PRODUCT_KEY), DISPLAY_NAME_KEY, NULL);
s += L"\\";
s += RxWideStringClass (IDS_GAME_UNINSTALL_FILENAME);
Set_String (HKEY_LOCAL_MACHINE, s, SOFTWARE_KEY, MICROSOFT_KEY, WINDOWS_KEY, CURRENT_VERSION_KEY, UNINSTALL_KEY, RxStringClass (IDS_GAME_PRODUCT_KEY), UNINSTALLER_FILENAME_KEY, NULL);
}
/***********************************************************************************************
* RegistryManagerClass::Register_WOLAPI -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void RegistryManagerClass::Register_WOLAPI (const WideStringClass &folderpath,
const WideStringClass &installpathname,
const WideStringClass &name,
DWORD sku,
DWORD version,
bool useigrsettings)
{
const DWORD igrsettings [] = {IGR_NONE, IGR_ALL};
WideStringClass s;
Set_String (HKEY_LOCAL_MACHINE, folderpath, SOFTWARE_KEY, WESTWOOD_KEY, WOLAPI_KEY, FOLDER_PATH_KEY, NULL);
Set_String (HKEY_LOCAL_MACHINE, installpathname, SOFTWARE_KEY, WESTWOOD_KEY, WOLAPI_KEY, INSTALL_PATHNAME_KEY, NULL);
Set_String (HKEY_LOCAL_MACHINE, name, SOFTWARE_KEY, WESTWOOD_KEY, WOLAPI_KEY, NAME_KEY, NULL);
Set_Value (HKEY_LOCAL_MACHINE, sku, SOFTWARE_KEY, WESTWOOD_KEY, WOLAPI_KEY, SKU_KEY, NULL);
Set_Value (HKEY_LOCAL_MACHINE, version, SOFTWARE_KEY, WESTWOOD_KEY, WOLAPI_KEY, VERSION_KEY, NULL);
// Register the uninstall program with the OS.
Set_String (HKEY_LOCAL_MACHINE, TxWideStringClass (IDS_VERBOSE_WOL_PRODUCT_NAME), SOFTWARE_KEY, MICROSOFT_KEY, WINDOWS_KEY, CURRENT_VERSION_KEY, UNINSTALL_KEY, WOLAPI_KEY, DISPLAY_NAME_KEY, NULL);
s = installpathname;
Remove_Trailing_Name (s);
s += L"\\";
s += RxWideStringClass (IDS_WOL_UNINSTALL_FILENAME);
Set_String (HKEY_LOCAL_MACHINE, s, SOFTWARE_KEY, MICROSOFT_KEY, WINDOWS_KEY, CURRENT_VERSION_KEY, UNINSTALL_KEY, WOLAPI_KEY, UNINSTALLER_FILENAME_KEY, NULL);
// Write the game room settings.
Set_Value (HKEY_LOCAL_MACHINE, igrsettings [useigrsettings], SOFTWARE_KEY, WESTWOOD_KEY, WOLAPI_KEY, OPTIONS_KEY, NULL);
}
/***********************************************************************************************
* RegistryManagerClass::Register_WOLRegister -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void RegistryManagerClass::Register_WOLRegister (const WideStringClass &folderpath,
const WideStringClass &installpathname,
const WideStringClass &name,
DWORD sku,
DWORD version)
{
Set_String (HKEY_LOCAL_MACHINE, folderpath, SOFTWARE_KEY, WESTWOOD_KEY, WOLREGISTER_KEY, FOLDER_PATH_KEY, NULL);
Set_String (HKEY_LOCAL_MACHINE, installpathname, SOFTWARE_KEY, WESTWOOD_KEY, WOLREGISTER_KEY, INSTALL_PATHNAME_KEY, NULL);
Set_String (HKEY_LOCAL_MACHINE, name, SOFTWARE_KEY, WESTWOOD_KEY, WOLREGISTER_KEY, NAME_KEY, NULL);
Set_Value (HKEY_LOCAL_MACHINE, sku, SOFTWARE_KEY, WESTWOOD_KEY, WOLREGISTER_KEY, SKU_KEY, NULL);
Set_Value (HKEY_LOCAL_MACHINE, version, SOFTWARE_KEY, WESTWOOD_KEY, WOLREGISTER_KEY, VERSION_KEY, NULL);
}
/***********************************************************************************************
* RegistryManagerClass::Register_WOLBrowser -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void RegistryManagerClass::Register_WOLBrowser (const WideStringClass &installpathname,
const WideStringClass &name,
DWORD version)
{
Set_String (HKEY_LOCAL_MACHINE, installpathname, SOFTWARE_KEY, WESTWOOD_KEY, WOLBROWSER_KEY, INSTALL_PATHNAME_KEY, NULL);
Set_String (HKEY_LOCAL_MACHINE, name, SOFTWARE_KEY, WESTWOOD_KEY, WOLBROWSER_KEY, NAME_KEY, NULL);
Set_Value (HKEY_LOCAL_MACHINE, version, SOFTWARE_KEY, WESTWOOD_KEY, WOLBROWSER_KEY, VERSION_KEY, NULL);
}
/***********************************************************************************************
* RegistryManagerClass::Update_WOLAPI -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void RegistryManagerClass::Update_WOLAPI()
{
DWORD keyindex, usagecount;
StringClass keyname;
keyindex = 0;
usagecount = 0;
while (Get_Key (HKEY_LOCAL_MACHINE, keyindex, &keyname, SOFTWARE_KEY, WESTWOOD_KEY, NULL)) {
DWORD sku;
WideStringClass serialnumber;
// If a SKU and a serial number exist...
if (Get_Value (HKEY_LOCAL_MACHINE, &sku, SOFTWARE_KEY, WESTWOOD_KEY, keyname, SKU_KEY, NULL)) {
if (Get_String (HKEY_LOCAL_MACHINE, &serialnumber, SOFTWARE_KEY, WESTWOOD_KEY, keyname, SERIAL_KEY, NULL)) {
WideStringClass widekeyname;
char skuname [MAX_NUMBER_STRING_LENGTH];
// Create a key for the key name under the WOLAPI key.
ltoa (sku, skuname, 10);
widekeyname = keyname;
Set_String (HKEY_LOCAL_MACHINE, widekeyname, SOFTWARE_KEY, WESTWOOD_KEY, WOLAPI_KEY, skuname, NAME_KEY, NULL);
usagecount++;
}
}
keyindex++;
}
// Update the WOLAPI usage count.
Set_Value (HKEY_LOCAL_MACHINE, usagecount, SOFTWARE_KEY, WESTWOOD_KEY, WOLAPI_KEY, USAGE_KEY, NULL);
}
/***********************************************************************************************
* RegistryManagerClass::Get_WOL_Account -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool RegistryManagerClass::Get_WOL_Account (unsigned index, WideStringClass &name, WideStringClass &password)
{
unsigned nonemptyindex, i;
// Find the n'th key with a non-empty name string.
// NOTE: Conversion from zero-based to one-based index.
nonemptyindex = 0;
i = 1;
while (true) {
StringClass key;
key.Format (NICKNAME_INDEX_KEY, i);
if (Get_String (HKEY_CLASSES_ROOT, &name, WESTWOOD_CHAT_KEY, key, NICKNAME_KEY, "", NULL)) {
if (name != L"") {
if (index == nonemptyindex) {
return (Get_String (HKEY_CLASSES_ROOT, &password, WESTWOOD_CHAT_KEY, key, PASSWORD_KEY, "", NULL));
}
nonemptyindex++;
}
} else {
break;
}
i++;
}
// Key not found.
return (false);
}
/***********************************************************************************************
* RegistryManagerClass::Set_Preferred_WOL_Account -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void RegistryManagerClass::Set_Preferred_WOL_Account (const WideStringClass &accountname)
{
Set_String (HKEY_LOCAL_MACHINE, accountname, SOFTWARE_KEY, WESTWOOD_KEY, RxStringClass (IDS_GAME_PRODUCT_KEY), WOLSETTINGS_KEY, PREFERRED_LOGIN_KEY, NULL);
}
/***********************************************************************************************
* RegistryManagerClass::Get_Document_Application_Pathname -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool RegistryManagerClass::Get_Document_Application_Pathname (WideStringClass &pathname)
{
return (Get_String (HKEY_CURRENT_USER, &pathname, SOFTWARE_KEY, MICROSOFT_KEY, WINDOWS_KEY, CURRENT_VERSION_KEY, EXTENSIONS_KEY, DOCUMENT_KEY, NULL));
}
/***********************************************************************************************
* RegistryManagerClass::Get_String -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool RegistryManagerClass::Get_String (HKEY rootkey, WideStringClass *string, ...)
{
bool success = false;
va_list marker;
char *keyname, *nextkeyname;
StringClass keystring;
HKEY key;
va_start (marker, string);
keyname = va_arg (marker, char*);
if (keyname != NULL) {
// Concatenate all but the last key name.
nextkeyname = va_arg (marker, char*);
while (nextkeyname != NULL) {
if (keystring.Get_Length() > 0) keystring += "\\";
keystring += keyname;
keyname = nextkeyname;
nextkeyname = va_arg (marker, char*);
}
if (RegOpenKeyEx (rootkey, keystring, 0, KEY_ALL_ACCESS, &key) == ERROR_SUCCESS) {
DWORD type;
DWORD size;
if (RegQueryValueEx (key, keyname, NULL, &type, NULL, &size) == ERROR_SUCCESS) {
if (type == REG_SZ) {
StringClass multibytestring;
if (RegQueryValueEx (key, keyname, NULL, &type, (BYTE*) multibytestring.Get_Buffer (size), &size) == ERROR_SUCCESS) {
*string = multibytestring;
success = true;
}
}
}
RegCloseKey (key);
}
}
va_end (marker);
return (success);
}
/***********************************************************************************************
* RegistryManagerClass::Get_Value -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool RegistryManagerClass::Get_Value (HKEY rootkey, DWORD *value, ...)
{
bool success = false;
va_list marker;
char *keyname, *nextkeyname;
StringClass keystring;
HKEY key;
va_start (marker, value);
keyname = va_arg (marker, char*);
if (keyname != NULL) {
// Concatenate all but the last key name.
nextkeyname = va_arg (marker, char*);
while (nextkeyname != NULL) {
if (keystring.Get_Length() > 0) {
keystring += "\\";
}
keystring += keyname;
keyname = nextkeyname;
nextkeyname = va_arg (marker, char*);
}
if (RegOpenKeyEx (rootkey, keystring, 0, KEY_ALL_ACCESS, &key) == ERROR_SUCCESS) {
DWORD type;
DWORD size;
if (RegQueryValueEx (key, keyname, NULL, &type, NULL, &size) == ERROR_SUCCESS) {
if (type == REG_DWORD) {
if (RegQueryValueEx (key, keyname, NULL, &type, (BYTE*) value, &size) == ERROR_SUCCESS) {
success = true;
}
}
}
RegCloseKey (key);
}
}
va_end (marker);
return (success);
}
/***********************************************************************************************
* RegistryManagerClass::Set_String -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool _cdecl RegistryManagerClass::Set_String (HKEY rootkey, const WCHAR *string, ...)
{
HKEY key;
DWORD disposition;
bool success = false;
va_list marker;
char *keyname, *nextkeyname;
va_start (marker, string);
// Create subkeys (if necessary).
key = rootkey;
keyname = va_arg (marker, char*);
if (keyname != NULL) {
nextkeyname = va_arg (marker, char*);
while (true) {
if (nextkeyname == NULL) {
StringClass multibytestring (string);
if (RegSetValueEx (key, keyname, 0, REG_SZ, (BYTE*) multibytestring.Peek_Buffer(), multibytestring.Get_Length() + 1) == ERROR_SUCCESS) {
success = true;
}
break;
}
if (RegCreateKeyEx (key, keyname, 0, "", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &key, &disposition) != ERROR_SUCCESS) {
break;
}
keyname = nextkeyname;
nextkeyname = va_arg (marker, char*);
}
}
va_end (marker);
return (success);
}
/***********************************************************************************************
* RegistryManagerClass::Set_Value -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool _cdecl RegistryManagerClass::Set_Value (HKEY rootkey, DWORD value, ...)
{
HKEY key;
DWORD disposition;
bool success = false;
va_list marker;
char *keyname, *nextkeyname;
va_start (marker, value);
// Create subkeys (if necessary).
key = rootkey;
keyname = va_arg (marker, char*);
if (keyname != NULL) {
nextkeyname = va_arg (marker, char*);
while (true) {
if (nextkeyname == NULL) {
if (RegSetValueEx (key, keyname, 0, REG_DWORD, (BYTE*) &value, sizeof (value)) == ERROR_SUCCESS) {
success = true;
}
break;
}
if (RegCreateKeyEx (key, keyname, 0, "", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &key, &disposition) != ERROR_SUCCESS) {
break;
}
keyname = nextkeyname;
nextkeyname = va_arg (marker, char*);
}
}
va_end (marker);
return (success);
}
/***********************************************************************************************
* RegistryManagerClass::Get_Key -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool _cdecl RegistryManagerClass::Get_Key (HKEY rootkey, DWORD keyindex, StringClass *keyname, ...)
{
bool success = false;
va_list marker;
char *ckeyname;
StringClass keystring;
HKEY key;
va_start (marker, keyname);
while ((ckeyname = va_arg (marker, char*)) != NULL) {
if (keystring.Get_Length() > 0) {
keystring += "\\";
}
keystring += ckeyname;
}
if (RegOpenKeyEx (rootkey, keystring, 0, KEY_ALL_ACCESS, &key) == ERROR_SUCCESS) {
FILETIME lastwritetime;
DWORD size;
if (RegEnumKeyEx (key, keyindex, keyname->Get_Buffer (256), &size, 0, NULL, NULL, &lastwritetime) == ERROR_SUCCESS) {
success = true;
}
RegCloseKey (key);
}
va_end (marker);
return (success);
}

View File

@@ -0,0 +1,121 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/RegistryManager.h $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 11/25/01 2:35p $*
* *
* $Revision:: 6 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef _REGISTRY_MANAGER_H
#define _REGISTRY_MANAGER_H
// Includes
#include "Registry.h"
// Forward declarations.
class StringClass;
class RegistryManagerClass {
public:
enum WOLComponentEnum {
COMPONENT_FIRST = 0,
WOLAPI_COMPONENT = COMPONENT_FIRST,
WOLREGISTER_COMPONENT,
WOLBROWSER_COMPONENT,
COMPONENT_COUNT
};
RegistryManagerClass();
bool Get_Folder_Path (WideStringClass &path);
bool Get_Desktop_Path (WideStringClass &path);
bool Get_Target_Game_Pathname (WideStringClass &path);
bool Get_Target_Game_Path (WideStringClass &path);
bool Get_Target_Game_Folder (WideStringClass &folder);
bool Get_Target_WOL_Pathname (WOLComponentEnum wolcomponent, WideStringClass &pathname);
bool Get_Target_WOL_Path (WOLComponentEnum wolcomponent, WideStringClass &path);
bool Get_Target_WOL_Folder (WOLComponentEnum wolcomponent, WideStringClass &folder);
bool Get_Target_WOL_Version (WOLComponentEnum wolcomponent, DWORD &version);
bool Use_IGR_Settings (bool &useigrsettings);
void Register_Game (const WideStringClass &name,
const WideStringClass &installpathname,
const WideStringClass &folderpath,
const WideStringClass &desktopshortcutpathname,
DWORD languageid,
const StringClass &serialnumber,
DWORD sku,
DWORD version);
void Register_WOLAPI (const WideStringClass &folderpath,
const WideStringClass &installpathname,
const WideStringClass &name,
DWORD sku,
DWORD version,
bool useigrsettings);
void Update_WOLAPI();
void Register_WOLRegister (const WideStringClass &folderpath,
const WideStringClass &installpathname,
const WideStringClass &name,
DWORD sku,
DWORD version);
void Register_WOLBrowser (const WideStringClass &installpathname,
const WideStringClass &name,
DWORD version);
bool Get_WOL_Account (unsigned index, WideStringClass &name, WideStringClass &password);
void Set_Preferred_WOL_Account (const WideStringClass &accountname);
bool Get_Document_Application_Pathname (WideStringClass &pathname);
protected:
bool _cdecl Get_String (HKEY rootkey, WideStringClass *string, ...);
bool _cdecl Get_Value (HKEY rootkey, DWORD *value, ...);
bool _cdecl Set_String (HKEY rootkey, const WCHAR *string, ...);
bool _cdecl Set_Value (HKEY rootkey, DWORD value, ...);
bool _cdecl Get_Key (HKEY rootkey, DWORD keyindex, StringClass *keyname, ...);
char *WOLKeys [COMPONENT_COUNT];
};
// Singleton.
extern RegistryManagerClass _RegistryManager;
#endif // REGISTRY_MANAGER_H

BIN
Code/Installer/Renegade.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -0,0 +1,140 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/ReviewDialog.cpp $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 11/24/01 9:29p $*
* *
* $Revision:: 5 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// Includes.
#include "ReviewDialog.h"
#include "Installer.h"
#include "ListCtrl.h"
#include "Translator.h"
/***********************************************************************************************
* ReviewDialogClass::On_Init_Dialog -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void ReviewDialogClass::On_Init_Dialog (void)
{
Set_Dlg_Item_Text (IDC_REVIEW_STATIC1, TxWideStringClass (IDS_REVIEW_SETTINGS));
InstallMenuDialogClass::On_Init_Dialog();
}
/***********************************************************************************************
* ReviewDialogClass::On_Activate -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void ReviewDialogClass::On_Activate (bool onoff)
{
if (onoff) {
const WCHAR *formatstring = L"<EFBFBD>%s: %s";
WideStringClass reviewtext, substring;
WideStringClass t;
// NOTE: Items may have changed since this dialog was last active.
if (_Installer.Install_Game()) {
reviewtext += TxWideStringClass (IDS_INSTALL_GAME);
reviewtext += L"\n";
substring.Format (formatstring, TxWideStringClass (IDS_DESTINATION_DIRECTORY), _Installer.Get_Target_Game_Path (t));
reviewtext += substring;
reviewtext += L"\n";
substring.Format (formatstring, TxWideStringClass (IDS_PROGRAM_FOLDER), _Installer.Get_Target_Game_Folder (t));
reviewtext += substring;
reviewtext += L"\n\n";
if (_Installer.Install_Game_Shortcut()) {
reviewtext += TxWideStringClass (IDS_PLACE_SHORTCUT);
reviewtext += L"\n\n";
}
}
if (_Installer.Install_WOL()) {
reviewtext += TxWideStringClass (IDS_INSTALL_WOL);
reviewtext += L"\n";
substring.Format (formatstring, TxWideStringClass (IDS_DESTINATION_DIRECTORY), _Installer.Get_Target_WOL_Path (t));
reviewtext += substring;
reviewtext += L"\n";
substring.Format (formatstring, TxWideStringClass (IDS_PROGRAM_FOLDER), _Installer.Get_Target_WOL_Folder (t));
reviewtext += substring;
reviewtext += L"\n\n";
if (_Installer.Use_IGR_Settings()) {
reviewtext += TxWideStringClass (IDS_USE_GAME_ROOM_SETTINGS);
reviewtext += L"\n\n";
}
}
Set_Dlg_Item_Text (IDC_REVIEW_EDIT, reviewtext);
}
InstallMenuDialogClass::On_Activate (onoff);
}
/***********************************************************************************************
* ReviewDialogClass::On_Command -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void ReviewDialogClass::On_Command (int ctrl_id, int message_id, DWORD param)
{
InstallMenuDialogClass::On_Command (ctrl_id, message_id, param);
}

View File

@@ -0,0 +1,62 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/ReviewDialog.h $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 11/03/01 5:53p $*
* *
* $Revision:: 4 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef _REVIEW_DIALOG_H
#define _REVIEW_DIALOG_H
// Includes.
#include "InstallMenuDialog.h"
// Dialog to confirm user's settings.
// Classes.
class ReviewDialogClass : public InstallMenuDialogClass
{
public:
ReviewDialogClass() : InstallMenuDialogClass (IDD_DIALOG_REVIEW) {}
void On_Command (int ctrl_id, int message_id, DWORD param);
// RTTI.
void *As_ReviewDialogClass() {return (this);}
protected:
void On_Init_Dialog (void);
void On_Activate (bool onoff);
};
#endif // _REVIEW_DIALOG_H

View File

@@ -0,0 +1,40 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/SafeTimer.cpp $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 11/05/01 7:35p $*
* *
* $Revision:: 2 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// Includes.
#include "SafeTimer.h"
DWORD SafeTimerClass::_StartTime = timeGetTime();

View File

@@ -0,0 +1,89 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/SafeTimer.h $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 11/05/01 7:41p $*
* *
* $Revision:: 2 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef _SAFE_TIMER_H
#define _SAFE_TIMER_H
// Includes.
#include "win.h"
#include <mmsystem.h>
// This timer increments at 1000Hz, is DWORD size and uses the OS timer timeGetTime().
// Therefore it will wrap ~49 days after boot time. This class attempts to minimize
// the possibility of the timer wrapping by offsetting time from the point at which
// the application starts up. It will still, however, fail if the application is
// active for > ~49 days.
class SafeTimerClass
{
public:
long operator () (void) const;
operator long (void) const;
private:
static DWORD _StartTime;
};
inline long SafeTimerClass::operator () (void) const
{
DWORD time = timeGetTime();
// Has the timer wrapped?
if (time >= _StartTime) {
return (time - _StartTime);
} else {
return ((0xffffffff - _StartTime) + time);
}
}
inline SafeTimerClass::operator long (void) const
{
DWORD time = timeGetTime();
// Has the timer wrapped?
if (time >= _StartTime) {
return (time - _StartTime);
} else {
return ((0xffffffff - _StartTime) + time);
}
}
#endif // _SAFE_TIMER_H

View File

@@ -0,0 +1,435 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/SerialDialog.cpp $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 1/15/02 11:09a $*
* *
* $Revision:: 10 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// Includes.
#include "SerialDialog.h"
#include "CodeControl.h"
#include "EditCtrl.h"
#include "Installer.h"
#include "Resource.h"
#include "Translator.h"
// Defines.
#define EDIT_CONTROL_COUNT 4
// Forward declarations.
unsigned int Check_Sum (char *str);
// Static data.
static const int _EditControlIds [EDIT_CONTROL_COUNT] = {IDC_SERIAL_EDIT1,
IDC_SERIAL_EDIT2,
IDC_SERIAL_EDIT3,
IDC_SERIAL_EDIT4};
static const int _EditControlLengths [EDIT_CONTROL_COUNT] = {6, 6, 6, 4};
static char *_SerialNumberLowRange;
static char *_SerialNumberHighRange;
/***********************************************************************************************
* SerialDialogClass::On_Init_Dialog -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void SerialDialogClass::On_Init_Dialog (void)
{
if (!_Installer.Beta_Test()) {
#if USE_QA_SERIAL_NOS
_SerialNumberLowRange = "0661";
_SerialNumberHighRange = "0661";
#else
_SerialNumberLowRange = "0559";
_SerialNumberHighRange = "0660";
#endif
} else {
_SerialNumberLowRange = "0663";
_SerialNumberHighRange = "0663";
}
#if NDEBUG
#if USE_QA_SERIAL_NOS
Set_Dlg_Item_Text (IDC_SERIAL_EDIT1, WideStringClass (_SerialNumberLowRange));
#endif
#else
// Initialize with a valid serial number.
if (!_Installer.Beta_Test()) {
#if USE_QA_SERIAL_NOS
Set_Dlg_Item_Text (IDC_SERIAL_EDIT1, WideStringClass ("066146"));
Set_Dlg_Item_Text (IDC_SERIAL_EDIT2, WideStringClass ("321463"));
Set_Dlg_Item_Text (IDC_SERIAL_EDIT3, WideStringClass ("028258"));
Set_Dlg_Item_Text (IDC_SERIAL_EDIT4, WideStringClass ("8591"));
#else
Set_Dlg_Item_Text (IDC_SERIAL_EDIT1, WideStringClass ("065906"));
Set_Dlg_Item_Text (IDC_SERIAL_EDIT2, WideStringClass ("044792"));
Set_Dlg_Item_Text (IDC_SERIAL_EDIT3, WideStringClass ("767144"));
Set_Dlg_Item_Text (IDC_SERIAL_EDIT4, WideStringClass ("4915"));
#endif
} else {
Set_Dlg_Item_Text (IDC_SERIAL_EDIT1, WideStringClass ("066390"));
Set_Dlg_Item_Text (IDC_SERIAL_EDIT2, WideStringClass ("274825"));
Set_Dlg_Item_Text (IDC_SERIAL_EDIT3, WideStringClass ("508134"));
Set_Dlg_Item_Text (IDC_SERIAL_EDIT4, WideStringClass ("6328"));
}
#endif
InstallMenuDialogClass::On_Init_Dialog();
}
/***********************************************************************************************
* SerialDialogClass::On_Unicode_Char -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void SerialDialogClass::On_Unicode_Char (uint16 unicode)
{
// Scan the edit controls for input focus...
for (unsigned i = 0; i < EDIT_CONTROL_COUNT; i++) {
EditCtrlClass *editcontrol = Get_Dlg_Item (_EditControlIds [i])->As_EditCtrlClass();
// Does this control have focus?
if (editcontrol->Has_Focus()) {
int textlength = wcslen (editcontrol->Get_Text());
// Is this key one of the edit keys?
switch (unicode) {
case VK_BACK:
if (textlength == 0) {
if (i > 0) {
EditCtrlClass *preveditcontrol = Get_Dlg_Item (_EditControlIds [i - 1])->As_EditCtrlClass();
preveditcontrol->Set_Focus();
preveditcontrol->Set_Sel (-1, -1);
}
} else {
InstallMenuDialogClass::On_Unicode_Char (unicode);
}
break;
case VK_DELETE:
case VK_HOME:
case VK_END:
case VK_LEFT:
case VK_RIGHT:
case VK_RETURN:
case VK_UP:
case VK_DOWN:
case VK_TAB:
// Process the key.
InstallMenuDialogClass::On_Unicode_Char (unicode);
break;
default:
// Is it a numeric key?
if ((unicode >= L'0') && (unicode <= L'9')) {
if (textlength < _EditControlLengths [i]) {
// Process the key.
InstallMenuDialogClass::On_Unicode_Char (unicode);
textlength = wcslen (editcontrol->Get_Text());
// If the edit control is now full and the caret is at the end...
if ((textlength == _EditControlLengths [i]) && (textlength == editcontrol->Get_Caret_Pos())) {
// If the next edit control is empty switch focus to it.
if (i < EDIT_CONTROL_COUNT - 1) {
EditCtrlClass *nexteditcontrol = Get_Dlg_Item (_EditControlIds [i + 1])->As_EditCtrlClass();
if (wcslen (nexteditcontrol->Get_Text()) == 0) {
nexteditcontrol->Set_Focus();
}
}
}
} else {
if ((textlength == _EditControlLengths [i]) && (textlength == editcontrol->Get_Caret_Pos())) {
// If the next edit control is empty switch focus to it and process the key.
if (i < EDIT_CONTROL_COUNT - 1) {
EditCtrlClass *nexteditcontrol = Get_Dlg_Item (_EditControlIds [i + 1])->As_EditCtrlClass();
if (wcslen (nexteditcontrol->Get_Text()) == 0) {
nexteditcontrol->Set_Focus();
InstallMenuDialogClass::On_Unicode_Char (unicode);
}
}
}
}
}
}
break;
}
}
}
/***********************************************************************************************
* SerialDialogClass::On_Command -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void SerialDialogClass::On_Command (int ctrl_id, int message_id, DWORD param)
{
bool valid = true;
switch (ctrl_id) {
case IDOK:
{
StringClass serialnumber;
valid = Get_Serial_Number (serialnumber);
if (valid) {
#if NDEBUG
StringClass lowrange (_SerialNumberLowRange);
StringClass highrange (_SerialNumberHighRange);
// Limit range of serial number.
valid = !(((_strnicmp (serialnumber, lowrange, 4) < 0) || (_strnicmp (serialnumber, highrange, 4) > 0)));
#endif
if (valid) {
unsigned i, v;
// Scan the string for all zeros.
v = 0;
for (i = 0; i < (unsigned) serialnumber.Get_Length(); i++) {
v += *(serialnumber.Peek_Buffer() + i) - '0';
}
valid = (v > 0);
if (valid) {
const unsigned offset = 18;
StringClass checksumstring (serialnumber);
unsigned checksum;
// Apply checksum test.
*(checksumstring.Peek_Buffer() + offset) = '\0';
checksum = Check_Sum (checksumstring.Peek_Buffer());
valid = (checksum == (uint32) atol (serialnumber.Peek_Buffer() + offset));
}
}
}
break;
}
default:
// Do nothing.
break;
}
if (valid) {
InstallMenuDialogClass::On_Command (ctrl_id, message_id, param);
} else {
MessageBoxClass::Do_Dialog (TxWideStringClass (IDS_WARNING), TxWideStringClass (IDS_INCORRECT_SERIAL), MessageBoxClass::MESSAGE_BOX_TYPE_OK, this);
}
}
/***********************************************************************************************
* SerialDialogClass::Get_Serial_Number -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool SerialDialogClass::Get_Serial_Number (StringClass &serialnumber)
{
bool valid = false;
for (unsigned i = 0; i < EDIT_CONTROL_COUNT; i++) {
EditCtrlClass *editcontrol = Get_Dlg_Item (_EditControlIds [i])->As_EditCtrlClass();
// Extract the serial number.
WideStringClass widedigits (editcontrol->Get_Text());
StringClass digits;
// Ensure that the text contains correct no. of characters.
// NOTE: Non-numeric characters have already been filtered out, so no need to check for this.
valid = (widedigits.Get_Length() == _EditControlLengths [i]);
if (!valid) {
break;
}
widedigits.Convert_To (digits);
serialnumber += digits;
}
return (valid);
}
/***********************************************************************************************
* SerialDialogClass::CheckSum -- Generate a checksum number between 0...9999 from a null *
* terminated string of numbers. *
* *
* INPUT: none. *
* *
* OUTPUT: none. *
* *
* WARNINGS: *
* *
* The checksum is divided into 2 parts. The first is computed by grabbing 7 digits at a *
* grabbing 7 digits at a time and summing them mod 97. The second part is computed by *
* grabbing 5 digits at a time and The second part is computed by grabbing 5 digits at a *
* time and summing them mod 93. *
* *
* Note that it's important that 97 & 93 are prime (or at least relatively prime...) and *
* less than 100. 7 & 5 were chosen because they can stay out of phase for the length of *
* the input string. *
* *
* The two components together make the checksum. This will catch all errors of 1 & 2 *
* digits and many other errors, but the proof is left as an exercise to the reader. *
* *
* Note, if you try and checksum ammounts over 30 chars the above guarantees will fail. *
* (That's the number of chars that the skip & offset values will stay out of phase). * *
* *
* Note: The checksum of all zeros will be 0 so you need to special case the check to not *
* allow this (since it's a pretty obvious thing for a user to type all 0's to try and *
* cheat the system). *
* *
* HISTORY: *
* 10/30/1995 MML : Created. *
*=============================================================================================*/
unsigned int Check_Sum (char *str)
{
unsigned int counter = 0;
unsigned int retval = 0;
unsigned int group = 0;
int len = strlen( str );
int mult = 0;
int i;
int j;
const int skipa = 7; // part A's skip value
const int skipb = 5; // ... part B
const int offsa = -5; // Everywhere the skips are in phase is a place where an 2nd error can occur and not be detected.
//---------------------------------------------------------------------------
// Part1
//---------------------------------------------------------------------------
counter = 0;
for ( i = offsa; i < len; i += skipa ) {
mult = 1;
for ( j = 1; j < skipa; j++ ) {
mult *= 10;
}
group = 0;
for ( j = i; j < MIN( len, i+skipa ); j++ ) {
if ( j >= 0 ) {
group += ((int)( str[j] - '0' )) * mult;
}
mult /= 10;
}
counter += group;
counter %= 97;
}
retval = counter * 100;
//---------------------------------------------------------------------------
// Part2
//---------------------------------------------------------------------------
counter = 0;
for ( i = 0; i < len; i += skipb ) {
mult = 1;
for ( j = 1; j < skipb; j++ ) {
mult *= 10;
}
group = 0;
for ( j = i; j < MIN( len, i+skipb ); j++ ) {
if ( j >= 0 ) {
group += ((int)( str[j] - '0' )) * mult;
}
mult /= 10;
}
counter += group;
counter %= 93;
}
retval += counter;
return (retval);
}

View File

@@ -0,0 +1,65 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/SerialDialog.h $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 11/12/01 7:35p $*
* *
* $Revision:: 4 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef _SERIAL_DIALOG_H
#define _SERIAL_DIALOG_H
// Includes.
#include "InstallMenuDialog.h"
// Dialog to obtain serial number from user.
// Classes.
class SerialDialogClass : public InstallMenuDialogClass
{
public:
SerialDialogClass() : InstallMenuDialogClass (IDD_DIALOG_SERIAL) {}
// RTTI.
void *As_SerialDialogClass() {return (this);}
void On_Command (int ctrl_id, int message_id, DWORD param);
bool Get_Serial_Number (StringClass &serialnumber);
protected:
void On_Init_Dialog (void);
void On_Unicode_Char (uint16 unicode);
};
#endif // _SERIAL_DIALOG_H

View File

@@ -0,0 +1,420 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/TransitionDialog.c $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 12/15/01 6:37p $*
* *
* $Revision:: 6 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// Includes.
#include "TransitionDialog.h"
#include "AssetMgr.h"
#include "DialogText.h"
#include "HAnim.h"
#include "MenuBackDrop.h"
#include "Mesh.h"
#include "MeshMdl.h"
#include "MessageBox.h"
#include "MouseMgr.h"
#include "RendObj.h"
#include "Resource.h"
#include "StyleMgr.h"
#include "Translator.h"
#include "Scene.h"
#include "TooltipMgr.h"
#include "Ww3D.h"
/***********************************************************************************************
* TransitionDialogClass::TransitionDialogClass -- Constructor *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
TransitionDialogClass::TransitionDialogClass()
: MenuDialogClass (IDD_DIALOG_TRANSITION),
Time (0.0f)
{
const char *modelname = "IN_STATICTRANS2";
const char *animname = "IN_STATICTRANS2.IN_STATICTRANS2";
Get_BackDrop()->Set_Model (modelname);
Get_BackDrop()->Set_Animation (animname);
// Null materials.
for (unsigned mesh = 0; mesh < MESH_COUNT; mesh++) {
Materials [mesh] = NULL;
}
}
/***********************************************************************************************
* TransitionDialogClass::~TransitionDialogClass -- Destructor *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
TransitionDialogClass::~TransitionDialogClass()
{
Get_BackDrop()->Remove_Model();
}
/***********************************************************************************************
* TransitionDialogClass::On_Init_Dialog -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void TransitionDialogClass::On_Init_Dialog (void)
{
const int textstringids [LABEL_COUNT] = {IDS_INSTALLER_TEXT094,
IDS_INSTALLER_TEXT070,
IDS_SCANNING_LOCAL_RADAR,
IDS_BIO_MONITOR_ACTIVATING,
IDS_UPDATING_WEAPON_STATUS,
IDS_INITIALIZING_OBJECTIVES_SYSTEM,
IDS_TARGETING_SYSTEM_ONLINE};
const int textcontrolids [LABEL_COUNT] = {IDC_EVA_UPDATING1,
IDC_PLEASE_STANDBY,
IDC_SCANNING_LOCAL_RADAR,
IDC_BIO_MONITOR_ACTIVATING,
IDC_UPDATING_WEAPON_STATUS,
IDC_INITIALIZING_OBJECTIVES_SYSTEM,
IDC_TARGETING_SYSTEM_ONLINE};
const char *meshnames [MESH_COUNT] = {"RADAR",
"HEALTH",
"WEAPONS",
"POGS",
"TARGETING"};
MouseMgrClass::Show_Cursor (false);
// Create labels.
for (unsigned label = 0; label < LABEL_COUNT; label++) {
TxWideStringClass text (textstringids [label]);
TextRenderers [label] = new Render2DSentenceClass;
StyleMgrClass::Assign_Font (TextRenderers [label], StyleMgrClass::FONT_CREDITS);
TextRenderers [label]->Build_Sentence (text);
TextRenderers [label]->Set_Location (Position (textcontrolids [label], text));
}
Digits.Set_Growth_Step (1024);
// For each model...
for (unsigned mesh = 0; mesh < MESH_COUNT; mesh++) {
for (int index = 0; index < Get_BackDrop()->Peek_Model()->Get_Num_Sub_Objects(); index++) {
RenderObjClass *sub_obj = Get_BackDrop()->Peek_Model()->Get_Sub_Object (index);
if (sub_obj->Class_ID() == RenderObjClass::CLASSID_MESH) {
if (::strstr (sub_obj->Get_Name(), meshnames [mesh]) != 0) {
Materials [mesh] = ((MeshClass*) sub_obj)->Peek_Model()->Get_Single_Material();
}
}
REF_PTR_RELEASE (sub_obj);
}
}
MenuDialogClass::On_Init_Dialog();
}
/***********************************************************************************************
* TransitionDialogClass::End_Dialog -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void TransitionDialogClass::End_Dialog (void)
{
MouseMgrClass::Show_Cursor (true);
// Remove materials.
for (unsigned mesh = 0; mesh < MESH_COUNT; mesh++) {
REF_PTR_RELEASE (Materials [mesh]);
}
// Remove all digits.
for (int d = 0; d < Digits.Count(); d++) {
delete Digits [d];
}
// Remove labels.
for (unsigned label = 0; label < LABEL_COUNT; label++) {
delete TextRenderers [label];
}
MenuDialogClass::End_Dialog();
}
/***********************************************************************************************
* TransitionDialogClass::On_Frame_Update -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void TransitionDialogClass::On_Frame_Update (void)
{
static Random2Class _randomnumber (0x236ae371);
const float labelcontroltimes [LABEL_COUNT][4] = {{ 1.67f, 1.73f, 6.60f, 6.67f},
{ 6.86f, 6.93f, 17.59f, 17.67f},
{17.97f, 17.97f, 38.97f, 38.97f},
{21.97f, 21.97f, 38.97f, 38.97f},
{25.97f, 25.97f, 38.97f, 38.97f},
{29.97f, 29.97f, 38.97f, 38.97f},
{33.97f, 33.97f, 38.97f, 38.97f}};
const float digitstarttime = 7.00f;
const float digitdecaytime = 14.00f;
const float digitendtime = 15.00f;
const float meshcontroltimes [MESH_COUNT][4] = {{18.97f, 20.97f, 38.97f, 38.97f},
{22.97f, 24.97f, 38.97f, 38.97f},
{26.97f, 28.97f, 38.97f, 38.97f},
{30.97f, 32.97f, 38.97f, 38.97f},
{34.97f, 36.97f, 38.97f, 38.97f}};
Time += WW3D::Get_Frame_Time() * 0.001f;
// For each label...
for (unsigned label = 0; label < LABEL_COUNT; label++) {
uint32 color;
float f;
if ((Time < labelcontroltimes [label][0]) || (Time > labelcontroltimes [label][3])) {
f = 0.0f;
} else {
if (Time < labelcontroltimes [label][1]) {
f = (Time - labelcontroltimes [label][0]) / (labelcontroltimes [label][1] - labelcontroltimes [label][0]);
} else {
if (Time < labelcontroltimes [label][2]) {
f = 1.0f;
} else {
f = 1.0f - (Time - labelcontroltimes [label][2]) / (labelcontroltimes [label][3] - labelcontroltimes [label][2]);
}
}
}
color = ((uint32)(f * 0xff)) << 24;
TextRenderers [label]->Reset_Polys();
TextRenderers [label]->Draw_Sentence (color | (RGBA_TO_INT32 (255, 213, 40, 0)));
}
// Process binary digits.
if (Time > digitstarttime) {
if (Time < digitendtime) {
const int digitthreshhold = 32;
if (Time < digitdecaytime) {
const unsigned randomness = 32;
const WCHAR *text [2] = {L"0", L"1"};
Render2DSentenceClass *digit;
int w, h, bits;
bool windowed;
float oow, ooh;
// Remove a digit?
if (Digits.Count() > digitthreshhold) {
delete Digits [0];
Digits.Delete (0);
}
// Add another digit.
WW3D::Get_Render_Target_Resolution (w, h, bits, windowed);
oow = ((float) w) / randomness;
ooh = ((float) h) / randomness;
digit = new Render2DSentenceClass;
StyleMgrClass::Assign_Font (digit, StyleMgrClass::FONT_CREDITS);
digit->Build_Sentence (text [_randomnumber (0, 1)]);
digit->Set_Location (Vector2 (floorf (_randomnumber (0, randomness) * oow), floorf (_randomnumber (0, randomness) * ooh)));
digit->Reset_Polys();
digit->Draw_Sentence (RGBA_TO_INT32 (255, 213, 40, 255));
Digits.Add (digit);
} else {
// Remove a digit?
if (Digits.Count() > 0) {
delete Digits [0];
Digits.Delete (0);
}
}
} else {
// Remove all digits.
for (int d = 0; d < Digits.Count(); d++) {
delete Digits [d];
}
Digits.Clear();
}
}
// For each mesh...
for (unsigned mesh = 0; mesh < MESH_COUNT; mesh++) {
float f;
if ((Time < meshcontroltimes [mesh][0]) || (Time > meshcontroltimes [mesh][3])) {
f = 0.0f;
} else {
if (Time < meshcontroltimes [mesh][1]) {
f = (Time - meshcontroltimes [mesh][0]) / (meshcontroltimes [mesh][1] - meshcontroltimes [mesh][0]);
} else {
if (Time < meshcontroltimes [mesh][2]) {
f = 1.0f;
} else {
f = 1.0f - (Time - meshcontroltimes [mesh][2]) / (meshcontroltimes [mesh][3] - meshcontroltimes [mesh][2]);
}
}
}
Materials [mesh]->Set_Opacity (f);
}
MenuDialogClass::On_Frame_Update();
// Has the animation played out?
if (Time > Get_BackDrop()->Peek_Model()->Peek_Animation()->Get_Total_Time()) {
End_Dialog();
}
}
/***********************************************************************************************
* TransitionDialogClass::Position -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
Vector2 TransitionDialogClass::Position (int controlid, const WideStringClass &text)
{
DialogTextClass *textcontrol;
RectClass rect;
Vector2 textextent;
DWORD style;
Vector2 position;
textcontrol = Get_Dlg_Item (controlid)->As_DialogTextClass();
rect = textcontrol->Get_Client_Rect();
textextent = TextRenderers [0]->Get_Text_Extents (text);
style = textcontrol->Get_Style();
if ((style & 0xF) == SS_RIGHT) {
position.X = rect.Right - textextent.X;
} else {
if ((style & 0xF) == SS_CENTER) {
position.X = rect.Left + (0.5f * (rect.Width() - textextent.X));
} else {
position.X = rect.Left;
}
}
position.Y = rect.Top;
position.X = (int) position.X;
position.Y = (int) position.Y;
return (position);
}
/***********************************************************************************************
* TransitionDialogClass::Render -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void TransitionDialogClass::Render (void)
{
MenuDialogClass::Render();
// Render the binary digits.
for (int d = 0; d < Digits.Count(); d++) {
Digits [d]->Render();
}
// Render the labels.
for (unsigned label = 0; label < LABEL_COUNT; label++) {
TextRenderers [label]->Render();
}
}

View File

@@ -0,0 +1,77 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/TransitionDialog.h $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 12/15/01 5:08p $*
* *
* $Revision:: 4 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef _TRANSITION_DIALOG_H
#define _TRANSITION_DIALOG_H
// Includes.
#include "MenuDialog.h"
#include "Random.h"
// Defines.
#define LABEL_COUNT 7
#define MESH_COUNT 5
// Forward declarations.
class Render2DSentenceClass;
class VertexMaterialClass;
// Classes.
class TransitionDialogClass : public MenuDialogClass
{
public:
TransitionDialogClass();
~TransitionDialogClass();
void End_Dialog (void);
void Render (void);
protected:
void On_Init_Dialog (void);
void On_Frame_Update (void);
Vector2 Position (int controlid, const WideStringClass &text);
float Time; // Time (in seconds) that the dialog has been running.
Render2DSentenceClass *TextRenderers [LABEL_COUNT];
DynamicVectorClass <Render2DSentenceClass*> Digits;
VertexMaterialClass *Materials [MESH_COUNT];
};
#endif // _TRANSITION_DIALOG_H

View File

@@ -0,0 +1,148 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/Translator.cpp $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 12/13/01 5:31p $*
* *
* $Revision:: 5 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// Includes.
#include "Translator.h"
#include "Resource.h"
#include "Win.h"
#include <stdio.h>
// Defines.
#define RESOURCE_NOT_FOUND_STRING "[Resource %d not found]"
#define WIDE_RESOURCE_NOT_FOUND_STRING L"[Resource %d not found]"
/***********************************************************************************************
* RxStringClass::RxStringClass -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
RxStringClass::RxStringClass (int resourceid)
: StringClass()
{
int charactercount;
TCHAR stringbuffer [1024];
charactercount = LoadString (ProgramInstance, resourceid, stringbuffer, sizeof (stringbuffer) / sizeof (TCHAR));
if (charactercount == 0) {
Format (RESOURCE_NOT_FOUND_STRING, resourceid);
} else {
*((StringClass*) this) = stringbuffer;
}
}
/***********************************************************************************************
* RxWideStringClass::RxWideStringClass -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
RxWideStringClass::RxWideStringClass (int resourceid)
: WideStringClass()
{
int charactercount;
TCHAR stringbuffer [1024];
charactercount = LoadString (ProgramInstance, resourceid, stringbuffer, sizeof (stringbuffer) / sizeof (TCHAR));
if (charactercount == 0) {
Format (WIDE_RESOURCE_NOT_FOUND_STRING, resourceid);
} else {
*((WideStringClass*) this) = stringbuffer;
}
}
/***********************************************************************************************
* TxWideStringClass::TxWideStringClass -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
TxWideStringClass::TxWideStringClass (int databaseid, int resourceid)
: WideStringClass()
{
// In the event that the translation database has not been loaded see if there is a substitute in the resource.
if (!TranslateDBClass::Is_Loaded()) {
switch (databaseid) {
case IDS_APPLICATION_ERROR:
*((WideStringClass*) this) = RxStringClass (IDS_RESOURCE_APPLICATION_ERROR);
break;
default:
*((WideStringClass*) this) = TRANSLATE (databaseid);
break;
}
} else {
if (resourceid != -1) {
StringClass multibytestring;
// If the translation cannot be converted to multi-byte format then substitute the resource.
*((WideStringClass*) this) = TRANSLATE (databaseid);
if (!multibytestring.Copy_Wide (*this)) {
*((WideStringClass*) this) = RxStringClass (resourceid);
}
} else {
*((WideStringClass*) this) = TRANSLATE (databaseid);
}
}
}

View File

@@ -0,0 +1,74 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/Translator.h $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 12/13/01 5:30p $*
* *
* $Revision:: 6 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef _TRANSLATOR_H
#define _TRANSLATOR_H
// Includes
#include "String_ids.h"
#include "Translatedb.h"
#include "WWString.h"
#include "WideString.h"
class RxStringClass : public StringClass
{
public:
// Get a string from the resource in ANSI format.
RxStringClass (int resourceid);
};
class RxWideStringClass : public WideStringClass
{
public:
// Get a string from the resource in wide (Unicode) format.
RxWideStringClass (int resourceid);
};
class TxWideStringClass : public WideStringClass
{
public:
// Get a string from the translation database in wide format.
TxWideStringClass (int databaseid, int resourceid = -1);
};
#endif // TRANSLATOR_H

View File

@@ -0,0 +1,794 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/Utilities.cpp $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 1/11/02 10:27a $*
* *
* $Revision:: 10 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// Includes.
#include "Utilities.h"
#include "ErrorHandler.h"
#include "Resource.h"
#include "Translator.h"
#include <shlwapi.h>
#include <stdlib.h>
#include <winbase.h>
#include <shlobj.h>
// Private prototypes.
static bool Create_Directory (const WCHAR *drive, const WCHAR *directory, WCHAR *subdirectory, bool remove, DynamicVectorClass <StringClass> *log);
static WCHAR *Standardize_Path (const WideStringClass &path, WideStringClass &standardpath);
static bool Validate_Install_CD (const char driveletter, const WideStringClass &installvolumename);
/***********************************************************************************************
* Prompt_Install_CD -- Is the install CD in one of the CD drives? If not prompt for it. *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool Prompt_Install_CD (const WideStringClass &installvolumename, char &sourcedriveletter)
{
bool success = false;
while (!success) {
for (char r = 'A'; r <= 'Z'; r++) {
char rootpathname [] = "?:\\";
rootpathname [0] = r;
// If the drive is a CD-ROM...
if (GetDriveType (rootpathname) == DRIVE_CDROM) {
if (Validate_Install_CD (r, installvolumename)) {
sourcedriveletter = r;
success = true;
break;
}
}
}
if (!success) {
bool cancel;
// No CD-ROM with the correct label found. Ask user to insert the CD-ROM.
ShowCursor (true);
cancel = MessageBoxExW (NULL, TxWideStringClass (IDS_INSERT_GAME_CD_ROM), TxWideStringClass (IDS_APPLICATION_NAME), MB_RETRYCANCEL | MB_APPLMODAL | MB_SETFOREGROUND, MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT)) == IDCANCEL;
ShowCursor (false);
if (cancel) break;
}
}
return (success);
}
/***********************************************************************************************
* Validate_Install_CD -- Is the install CD in the designated CD drive? *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool Validate_Install_CD (const WideStringClass &sourcepath, const WideStringClass &installvolumename)
{
StringClass multibytesourcepath (sourcepath);
return (Validate_Install_CD (multibytesourcepath [0], installvolumename));
}
/***********************************************************************************************
* Validate_Install_CD -- Is the install CD in the designated CD drive? *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool Validate_Install_CD (const char driveletter, const WideStringClass &installvolumename)
{
char multibytevolumename [_MAX_PATH];
char filesystemname [_MAX_PATH];
DWORD maxfilenamelength;
DWORD flags;
char rootpathname [] = "?:\\";
rootpathname [0] = driveletter;
if (GetVolumeInformation (rootpathname, multibytevolumename, _MAX_PATH, NULL, &maxfilenamelength, &flags, filesystemname, _MAX_PATH)) {
WideStringClass volumename (multibytevolumename);
// Windows '95 appears to have a volume name limit of 11 characters. I cannot find a Win32
// call that will return the maximum volume name length so the value '11' is hard-coded here
// and the assumption made that all OS's have this length or better.
if (wcsncmp (volumename, installvolumename, MAX (11, volumename.Get_Length())) == 0) {
return (true);
}
}
return (false);
}
/***********************************************************************************************
* Get_Disk_Space_Available -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool Get_Disk_Space_Available (const WideStringClass &path, __int64 &diskspace)
{
StringClass multibytepath (path);
char drive [_MAX_DRIVE];
ULARGE_INTEGER freebytecount; // Free bytes on disk available to caller (caller may not have access to entire disk).
ULARGE_INTEGER totalbytecount; // Total bytes on disk.
StringClass kernelpathname;
int (__stdcall *getfreediskspaceex) (LPCTSTR, PULARGE_INTEGER, PULARGE_INTEGER, PULARGE_INTEGER);
// Extract the drive.
// NOTE 0: Even though GetDiskFreeSpaceEx() will accept a full path, it will err if the path is not valid.
// NOTE 1: _splitpath() automatically handles multi-byte character strings.
_splitpath (multibytepath, drive, NULL, NULL, NULL);
GetSystemDirectory (kernelpathname.Get_Buffer (_MAX_PATH), _MAX_PATH);
kernelpathname += "\\";
kernelpathname += "Kernel32.dll";
getfreediskspaceex = (int (_stdcall*) (LPCTSTR, PULARGE_INTEGER, PULARGE_INTEGER, PULARGE_INTEGER)) GetProcAddress (GetModuleHandle (kernelpathname.Peek_Buffer()), "GetDiskFreeSpaceExA");
if (getfreediskspaceex != NULL) {
// NOTE: This function uses GetDiskFreeSpaceEx() and therefore assumes Win '95 OSR2 or greater.
if (!getfreediskspaceex (drive, &freebytecount, &totalbytecount, NULL)) return (false);
// Convert to a 64-bit integer.
diskspace = freebytecount.QuadPart;
} else {
DWORD sectorspercluster, bytespersector, freeclustercount, totalclustercount;
// The Ex version is not available. Use the Win'95 version.
// QUESTION: SDK docs say that values returned by this function are erroneous if partition > 2Gb.
// Does that mean that the partition is guaranteed to be <= 2Gb if Ex is not available?
if (!GetDiskFreeSpace (drive, &sectorspercluster, &bytespersector, &freeclustercount, &totalclustercount)) return (false);
diskspace = sectorspercluster * bytespersector * freeclustercount;
}
return (true);
}
/***********************************************************************************************
* Validate_Path -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool Validate_Path (const WideStringClass &path, int &errorcode)
{
bool valid = false;
// Check that path has syntax <drive>:\<directory>\<directory>...
if (path.Get_Length() > _MAX_DRIVE) {
if (((path [0] >= L'A') && (path [0] <= L'Z')) || ((path [0] >= L'a') && (path [0] <= L'z'))) {
if ((path [1] == L':') && ((path [2] == L'\\') || (path [2] == L'/'))) {
const WCHAR *c = ((WideStringClass) path).Peek_Buffer() + _MAX_DRIVE;
while (*c != L'\0') {
if ((*c == L'\\') || (*c == L'/')) {
// Cannot have two adjacent slashes.
if ((*(c - 1) == L'\\') || (*(c - 1) == L'/')) break;
}
c++;
}
// Parsed entire string?
if (*c == L'\0') {
// Check that path does not contain any illegal characters.
if (wcscspn (((WideStringClass) path).Peek_Buffer(), L"*?<>|") == (size_t) path.Get_Length()) {
WCHAR drive [_MAX_DRIVE + 1];
WideStringClass directory;
wcsncpy (drive, path, _MAX_DRIVE);
drive [_MAX_DRIVE] = L'\0';
directory = ((WideStringClass) path).Peek_Buffer() + _MAX_DRIVE;
// Attempt to create (and then remove) the path.
if (Create_Directory (drive, directory.Peek_Buffer(), directory.Peek_Buffer(), true, NULL)) {
valid = true;
} else {
errorcode = IDS_CANNOT_CREATE_DIRECTORY;
}
} else {
errorcode = IDS_INVALID_PATH;
}
} else {
errorcode = IDS_INVALID_PATH;
}
} else {
errorcode = IDS_INVALID_PATH;
}
} else {
errorcode = IDS_INVALID_PATH;
}
} else {
errorcode = IDS_INVALID_PATH;
}
return (valid);
}
/***********************************************************************************************
* Create_Directory -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool Create_Directory (const WideStringClass &path, DynamicVectorClass <StringClass> *log)
{
WCHAR drive [_MAX_DRIVE + 1];
WideStringClass directory;
// NOTE: Assumes that path is a full path. If not, an error may be thrown.
wcsncpy (drive, path, _MAX_DRIVE);
drive [_MAX_DRIVE] = L'\0';
directory = ((WideStringClass) path).Peek_Buffer() + _MAX_DRIVE;
return (Create_Directory (drive, directory.Peek_Buffer(), directory.Peek_Buffer(), false, log));
}
/***********************************************************************************************
* Create_Directory -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool Create_Directory (const WCHAR *drive, const WCHAR *directory, WCHAR *subdirectory, bool remove, DynamicVectorClass <StringClass> *log)
{
bool valid;
WCHAR *c, replacement;
WideStringClass path;
StringClass multibytepath;
DWORD errorcode;
// If subdirectory is empty, we're done.
c = subdirectory;
if (*c != L'\0') {
// Step down the subdirectory to the next slash or null.
while ((*c != L'\\') && (*c != L'/') && (*c != L'\0')) c++;
replacement = *c;
*c = L'\0';
path = drive;
path += directory;
path.Convert_To (multibytepath);
if (CreateDirectory (multibytepath, NULL)) {
errorcode = 0;
if (log != NULL) log->Add (multibytepath);
} else {
errorcode = GetLastError();
}
// If no error or directory already exists...
if ((errorcode == 0) || (errorcode == ERROR_ALREADY_EXISTS)) {
// Recurse if not at end of string.
if (replacement != L'\0') {
*c = replacement;
valid = Create_Directory (drive, directory, c + 1, remove, log);
} else {
valid = true;
}
// If caller wants it removed (and it didn't already exist) then remove it (ie. just verify that it can be created).
if (remove && (errorcode == 0)) {
if (!RemoveDirectory (multibytepath)) FATAL_SYSTEM_ERROR;
}
} else {
valid = false;
}
} else {
valid = true;
}
return (valid);
}
/***********************************************************************************************
* Cluster_Padding -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
__int64 Cluster_Padding (unsigned filecount)
{
// NOTE: Currently, it is not known how to obtain (or if it is possible to obtain) the cluster size
// of a hard disk. According to MS documentation, the largest possible cluster size of FAT16,
// FAT32 and NTFS file systems is 64K (and is more typically 4-16K). Therefore, conservatively
// estimate the cluster size as 64K.
const unsigned clustersize = 0x10000;
__int64 padding = clustersize * filecount;
return (padding);
}
/***********************************************************************************************
* Is_Same_Path -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool Is_Same_Path (const WideStringClass &path0, const WideStringClass &path1, bool standardize)
{
if (standardize) {
WideStringClass path0copy, path1copy;
Standardize_Path (path0, path0copy);
Standardize_Path (path1, path1copy);
return (path0copy.Compare (path1copy) == 0);
} else {
return (path0.Compare (path1) == 0);
}
}
/***********************************************************************************************
* Is_Sub_Path -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool Is_Sub_Path (const WideStringClass &path0, const WideStringClass &path1, bool standardize)
{
WideStringClass path0copy, path1copy;
if (standardize) {
Standardize_Path (path0, path0copy);
Standardize_Path (path1, path1copy);
} else {
path0copy = path0;
path1copy = path1;
}
if (wcsstr (path0copy, path1copy) != NULL) {
if (path0copy.Get_Length() == path1copy.Get_Length()) {
return (true);
} else {
WCHAR c;
c = path0copy [path1copy.Get_Length()];
if ((c == L'\\') || (c == L'/')) return (true);
}
}
return (false);
}
/***********************************************************************************************
* Standardize_Path -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
WCHAR *Standardize_Path (const WideStringClass &path, WideStringClass &standardpath)
{
WideStringClass t (path);
int i, c;
// Remove leading white space.
i = 0;
while (t [i] == L' ') {
i++;
}
if (i > 0) t.Erase (0, i);
// Remove trailing white space and any trailing slashes.
c = 0;
i = t.Get_Length() - 1;
while ((i >= 0) && ((t [i] == L' ') || (t [i] == L'\\') || (t [i] == L'/'))) {
i--;
c++;
}
if (c > 0) t.Erase (i + 1, c);
// Replace back slashes with forward slashes and change to upper case.
for (i = 0; i < t.Get_Length(); i++) {
if (t [i] == L'/') t [i] = L'\\';
t [i] = towupper (t [i]);
}
standardpath = t;
return (standardpath.Peek_Buffer());
}
/***********************************************************************************************
* Remove_Trailing_Name -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
WCHAR *Remove_Trailing_Name (WideStringClass &path)
{
int i, c;
for (i = path.Get_Length() - 1, c = 1; i >= 0; i--, c++) {
if ((path [i] == L'\\') || (path [i] == L'/')) {
path.Erase (i, c);
break;
}
}
return (path.Peek_Buffer());
}
/***********************************************************************************************
* Extract_Suffix_Root -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
WCHAR *Extract_Suffix_Root (WideStringClass &path, const WideStringClass &prefixpath)
{
if (wcsstr (path, prefixpath) == path) {
int s, e, c;
s = prefixpath.Get_Length();
if ((path [s] == L'\\') || (path [s] == L'/')) s++;
if (s > 0) path.Erase (0, s);
e = 0;
c = path.Get_Length();
for (e = 0, c = path.Get_Length(); c > 0; e++, c--) {
if ((path [e] == L'\\') || (path [e] == L'/')) {
path.Erase (e, c);
break;
}
}
return (path.Peek_Buffer());
}
return (NULL);
}
/***********************************************************************************************
* Extract_Trailing_Name -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
WCHAR *Extract_Trailing_Name (WideStringClass &path)
{
int i;
for (i = path.Get_Length() - 1; i >= 0; i--) {
if ((path [i] == L'\\') || (path [i] == L'/')) {
path.Erase (0, i + 1);
break;
}
}
return (path.Peek_Buffer());
}
/***********************************************************************************************
* Directory_Exists -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool Directory_Exists (const WideStringClass &path)
{
StringClass multibytepath (path);
DWORD errorcode;
if (CreateDirectory (multibytepath, NULL)) {
errorcode = 0;
} else {
errorcode = GetLastError();
}
if (errorcode == 0) {
if (!RemoveDirectory (multibytepath)) FATAL_SYSTEM_ERROR;
return (false);
} else {
return (errorcode == ERROR_ALREADY_EXISTS);
}
}
/***********************************************************************************************
* Is_System_Directory -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool Is_System_Directory (const WideStringClass &path)
{
const int DirectoryTypes [] = {
CSIDL_DESKTOP, // 0x0000 <user name>\desktop
CSIDL_PROGRAMS, // 0x0002 <user name>\Start Menu\Programs
CSIDL_PERSONAL, // 0x0005 <user name>\Start Menu\My Documents
CSIDL_FAVORITES, // 0x0006 <user name>Favorites
CSIDL_STARTUP, // 0x0007 <user name>\Start Menu\Programs\Startup
CSIDL_RECENT, // 0x0008 <user name>\Recent
CSIDL_SENDTO, // 0x0009 <user name>\SendTo
CSIDL_STARTMENU, // 0x000b <user name>\Start Menu
CSIDL_DESKTOPDIRECTORY, // 0x0010 <user name>\Desktop
CSIDL_NETHOOD, // 0x0013 <user name>\nethood
CSIDL_FONTS, // 0x0014 windows\fonts
CSIDL_TEMPLATES, // 0x0015 <user name>\Templates
CSIDL_COMMON_STARTMENU, // 0x0016 All Users\Start Menu
CSIDL_COMMON_PROGRAMS, // 0X0017 All Users\Start Menu\Programs
CSIDL_COMMON_STARTUP, // 0x0018 All Users\Start Menu\Programs\Startup
CSIDL_COMMON_DESKTOPDIRECTORY, // 0x0019 All Users\Desktop
CSIDL_APPDATA, // 0x001a <user name>\Application Data
CSIDL_PRINTHOOD, // 0x001b <user name>\PrintHood
CSIDL_COMMON_FAVORITES, // 0x001f All Users\Favorites
CSIDL_INTERNET_CACHE, // 0x0020 <user name>\Local Settings\Temporary Internet Files
CSIDL_COOKIES, // 0x0021 <user name>\Cookies
CSIDL_HISTORY // 0x0022 <user name>\Local Settings\History
};
char multibytesystempath [_MAX_PATH];
WideStringClass systempath;
bool result;
HINSTANCE hinstLib;
// Test for Windows directory.
if (!GetWindowsDirectory (multibytesystempath, _MAX_PATH)) FATAL_SYSTEM_ERROR;
systempath = multibytesystempath;
if (Is_Sub_Path (path, systempath)) return (true);
// Test for System directory.
if (!GetSystemDirectory (multibytesystempath, _MAX_PATH)) FATAL_SYSTEM_ERROR;
systempath = multibytesystempath;
if (Is_Sub_Path (path, systempath)) return (true);
// Get a handle to the DLL module.
result = false;
hinstLib = LoadLibrary ("shfolder.dll");
if (hinstLib != NULL) {
HRESULT (__stdcall * PFNSHGETFOLDERPATHA)(HWND, int, HANDLE, DWORD, LPSTR);
PFNSHGETFOLDERPATHA = ( HRESULT ( __stdcall * )(HWND, int, HANDLE, DWORD, LPSTR)) GetProcAddress( hinstLib, "SHGetFolderPathA" );
if (PFNSHGETFOLDERPATHA != NULL) {
HRESULT hr = 0;
for (int i = 0; i < sizeof (DirectoryTypes) / sizeof(int); i++) {
// Get each of the known directories above and compare to the desired directory.
hr = (*PFNSHGETFOLDERPATHA)( NULL, DirectoryTypes [i], NULL, 0, multibytesystempath);
if (hr == S_OK) {
systempath = multibytesystempath;
if (Is_Sub_Path (path, systempath)) {
result = true;
break;
}
}
}
}
// Free the DLL module.
FreeLibrary (hinstLib);
}
return (result);
}
/***********************************************************************************************
* Get_Current_Directory -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void Get_Current_Directory (WideStringClass &path)
{
StringClass multibytepath;
if (!GetCurrentDirectory (_MAX_PATH, multibytepath.Get_Buffer (MAX_PATH))) FATAL_SYSTEM_ERROR;
path = multibytepath;
}
/***********************************************************************************************
* Generate_Temporary_Pathname -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool Generate_Temporary_Pathname (const WideStringClass &path, StringClass &multibytetemporarypathname)
{
StringClass multibytepath;
// Create temporary file.
multibytepath = path;
if (!GetTempFileName (multibytepath, "XXX", 0, multibytetemporarypathname.Get_Buffer (_MAX_PATH))) return (false);
return (true);
}
/***********************************************************************************************
* Message_Box -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void Message_Box (const WideStringClass &header, const WideStringClass &errormessage)
{
ShowCursor (true);
MessageBoxExW (NULL, ((WideStringClass) errormessage).Peek_Buffer(), ((WideStringClass) header).Peek_Buffer(), MB_OK | MB_APPLMODAL | MB_SETFOREGROUND, MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT));
ShowCursor (false);
}

View File

@@ -0,0 +1,72 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/Utilities.h $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 1/11/02 10:18a $*
* *
* $Revision:: 8 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef _UTILITIES_H
#define _UTILITIES_H
// Includes.
#include "Vector.h"
#include "Win.h"
// Defines.
#define MAX_NUMBER_STRING_LENGTH 33 // Maximum length of string returned by ltoa().
// Forward declarations.
class StringClass;
class WideStringClass;
// Public prototypes.
bool Prompt_Install_CD (const WideStringClass &volumelabal, char &sourcedriveletter);
bool Validate_Install_CD (const WideStringClass &sourcepath, const WideStringClass &installvolumename);
bool Get_Disk_Space_Available (const WideStringClass &path, __int64 &diskspace);
__int64 Cluster_Padding (unsigned filecount);
bool Validate_Path (const WideStringClass &path, int &errorcode);
bool Valid_Install_Drive (const char *drive);
bool Create_Directory (const WideStringClass &path, DynamicVectorClass <StringClass> *log = NULL);
bool Is_Same_Path (const WideStringClass &path0, const WideStringClass &path1, bool standardize = true);
bool Is_Sub_Path (const WideStringClass &path0, const WideStringClass &path1, bool standardize = true);
WCHAR *Remove_Trailing_Name (WideStringClass &path);
WCHAR *Extract_Suffix_Root (WideStringClass &path, const WideStringClass &prefixpath);
WCHAR *Extract_Trailing_Name (WideStringClass &path);
bool Directory_Exists (const WideStringClass &path);
bool Is_System_Directory (const WideStringClass &path);
void Get_Current_Directory (WideStringClass &path);
bool Generate_Temporary_Pathname (const WideStringClass &path, StringClass &multibytetemporarypathname);
void Message_Box (const WideStringClass &header, const WideStringClass &errormessage);
#endif // _UTILITIES_H

View File

@@ -0,0 +1,67 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/WOL1Dialog.cp $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 11/09/01 10:41p $*
* *
* $Revision:: 3 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// Includes.
#include "WOL1Dialog.h"
/***********************************************************************************************
* WOL1DialogClass::On_Command -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void WOL1DialogClass::On_Command (int ctrl_id, int message_id, DWORD param)
{
switch (ctrl_id) {
case IDCANCEL:
MenuDialogClass::On_Command (ctrl_id, message_id, param);
return;
default:
break;
}
InstallMenuDialogClass::On_Command (ctrl_id, message_id, param);
}

View File

@@ -0,0 +1,177 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/WOL2Dialog.cp $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 11/24/01 9:27p $*
* *
* $Revision:: 3 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// Includes.
#include "WOL2Dialog.h"
#include "Installer.h"
#include "ListCtrl.h"
#include "Resource.h"
#include "Translator.h"
// Defines.
#define ENCRYPTED_STRING_LENGTH 8
/***********************************************************************************************
* WOL2DialogClass::On_Init_Dialog -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void WOL2DialogClass::On_Init_Dialog (void)
{
ListCtrlClass *listctrl;
unsigned i;
WideStringClass name, password;
// Get the list of nicknames.
listctrl = Get_Dlg_Item (IDC_WOL2_LIST)->As_ListCtrlClass();
listctrl->Add_Column (L"", 1.0f, Vector3 (1.0f, 1.0f, 1.0f));
i = 0;
while (_Installer.Get_WOL_Account (i, name, password)) {
listctrl->Insert_Entry (i, name);
i++;
}
// Select the topmost item.
listctrl->Set_Curr_Sel (0);
}
/***********************************************************************************************
* WOL2DialogClass::On_Command -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void WOL2DialogClass::On_Command (int ctrl_id, int message_id, DWORD param)
{
switch (ctrl_id) {
case IDCANCEL:
MenuDialogClass::On_Command (ctrl_id, message_id, param);
return;
case IDOK:
{
ListCtrlClass *listctrl;
WideStringClass userpassword (Get_Dlg_Item_Text (IDC_WOL2_EDIT));
WideStringClass accountname, accountpassword;
StringClass encrypteduserpassword;
// Verify that the user password is the correct length.
if (userpassword.Get_Length() != ENCRYPTED_STRING_LENGTH) {
MessageBoxClass::Do_Dialog (TxWideStringClass (IDS_WARNING), TxWideStringClass (IDS_INVALID_PASSWORD), MessageBoxClass::MESSAGE_BOX_TYPE_OK, this);
return;
}
// Verify that the user password is alphanumeric ie. do not allow any punctuation or Asian characters.
for (int i = 0; i < userpassword.Get_Length(); i++) {
if (!iswalnum (userpassword [i])) {
MessageBoxClass::Do_Dialog (TxWideStringClass (IDS_WARNING), TxWideStringClass (IDS_INVALID_PASSWORD), MessageBoxClass::MESSAGE_BOX_TYPE_OK, this);
return;
}
}
// Verify that the user password is correct for the selected account name.
listctrl = Get_Dlg_Item (IDC_WOL2_LIST)->As_ListCtrlClass();
_Installer.Get_WOL_Account (listctrl->Get_Curr_Sel(), accountname, accountpassword);
Encrypt_Password (StringClass (userpassword), encrypteduserpassword);
if (accountpassword.Compare (WideStringClass (encrypteduserpassword)) != 0) {
MessageBoxClass::Do_Dialog (TxWideStringClass (IDS_WARNING), TxWideStringClass (IDS_INCORRECT_PASSWORD), MessageBoxClass::MESSAGE_BOX_TYPE_OK, this);
return;
}
_Installer.Set_Preferred_WOL_Account (accountname);
break;
}
}
InstallMenuDialogClass::On_Command (ctrl_id, message_id, param);
}
/***********************************************************************************************
* WOL2DialogClass::Encrypt_Password -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
StringClass &WOL2DialogClass::Encrypt_Password (const StringClass &password, StringClass &encryptedpassword)
{
const static char _basestring [] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./";
char tempbuffer [ENCRYPTED_STRING_LENGTH + 1];
unsigned upcnt = 0, dncnt = 0, cnt = 0;
WWASSERT (password.Get_Length() == ENCRYPTED_STRING_LENGTH);
for (upcnt = 0, dncnt = ENCRYPTED_STRING_LENGTH; upcnt < ENCRYPTED_STRING_LENGTH; upcnt++, dncnt--) {
if (*(password.Peek_Buffer() + upcnt) & 0x01) {
tempbuffer [upcnt] = (*(password.Peek_Buffer() + upcnt) << (*(password.Peek_Buffer() + upcnt) & 0x01)) & *(password.Peek_Buffer() + dncnt);
} else {
tempbuffer [upcnt] = (*(password.Peek_Buffer() + upcnt) << (*(password.Peek_Buffer() + upcnt) & 0x01)) ^ *(password.Peek_Buffer() + dncnt);
}
}
encryptedpassword.Get_Buffer (ENCRYPTED_STRING_LENGTH + 1);
for (cnt = 0; cnt < ENCRYPTED_STRING_LENGTH; cnt++) {
*(encryptedpassword.Peek_Buffer() + cnt) = _basestring [tempbuffer [cnt] & 0x3f];
}
*(encryptedpassword.Peek_Buffer() + cnt) = '\0';
return (encryptedpassword);
}

View File

@@ -0,0 +1,63 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/WOL2Dialog.h $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 10/09/01 8:24p $*
* *
* $Revision:: 2 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef _WOL2_DIALOG_H
#define _WOL2_DIALOG_H
// Includes.
#include "InstallMenuDialog.h"
// Dialog to instigate sign-up for a Westwood Online account.
// Classes.
class WOL2DialogClass : public InstallMenuDialogClass
{
public:
WOL2DialogClass() : InstallMenuDialogClass (IDD_DIALOG_WOL2) {}
// RTTI.
void *As_WOL2DialogClass() {return (this);}
void On_Command (int ctrl_id, int message_id, DWORD param);
protected:
void On_Init_Dialog (void);
StringClass &Encrypt_Password (const StringClass &password, StringClass &encryptedpassword);
};
#endif // _WOL2_DIALOG_H

View File

@@ -0,0 +1,60 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/WelcomeDialog.cpp $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 11/12/01 4:12p $*
* *
* $Revision:: 3 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// Includes.
#include "WelcomeDialog.h"
#include "Resource.h"
#include "Translator.h"
/***********************************************************************************************
* WelcomeDialogClass::On_Init_Dialog -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void WelcomeDialogClass::On_Init_Dialog (void)
{
Set_Dlg_Item_Text (IDC_WELCOME_STATIC1, TxWideStringClass (IDS_WELCOME_HEADER));
Set_Dlg_Item_Text (IDC_WELCOME_EDIT, TxWideStringClass (IDS_WELCOME_COPYRIGHT));
InstallMenuDialogClass::On_Init_Dialog();
}

View File

@@ -0,0 +1,59 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/WelcomeDialog.h $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 9/25/01 12:06p $*
* *
* $Revision:: 3 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef _WELCOME_DIALOG_H
#define _WELCOME_DIALOG_H
// Includes.
#include "InstallMenuDialog.h"
// Dialog to welcome user to the installation and to display copyright message.
// Classes.
class WelcomeDialogClass : public InstallMenuDialogClass
{
public:
WelcomeDialogClass() : InstallMenuDialogClass (IDD_DIALOG_WELCOME) {}
// RTTI.
void *As_WelcomeDialogClass() {return (this);}
protected:
void On_Init_Dialog (void);
};
#endif // _WELCOME_DIALOG_H

View File

@@ -0,0 +1,142 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/WhatToInstallDialog. $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 10/25/01 3:38p $*
* *
* $Revision:: 5 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// Includes.
#include "WhatToInstallDialog.h"
#include "CheckBoxCtrl.h"
#include "Resource.h"
#include "Installer.h"
#include "Translator.h"
/***********************************************************************************************
* WhatToInstallDialogClass::On_Init_Dialog -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void WhatToInstallDialogClass::On_Init_Dialog (void)
{
CheckBoxCtrlClass *check;
bool useigrsettings;
Set_Dlg_Item_Text (IDC_WHAT_TO_INSTALL_CHECK1, TxWideStringClass (IDS_INSTALL_GAME));
Set_Dlg_Item_Text (IDC_WHAT_TO_INSTALL_CHECK2, TxWideStringClass (IDS_INSTALL_WOL));
Set_Dlg_Item_Text (IDC_WHAT_TO_INSTALL_CHECK3, TxWideStringClass (IDS_PLACE_SHORTCUT));
Set_Dlg_Item_Text (IDC_WHAT_TO_INSTALL_CHECK4, TxWideStringClass (IDS_USE_GAME_ROOM_SETTINGS));
Check_Dlg_Button (IDC_WHAT_TO_INSTALL_CHECK1, true);
Check_Dlg_Button (IDC_WHAT_TO_INSTALL_CHECK2, _Installer.Is_Target_WOL_Older_Than_Source());
Check_Dlg_Button (IDC_WHAT_TO_INSTALL_CHECK3, true);
check = Get_Dlg_Item (IDC_WHAT_TO_INSTALL_CHECK4)->As_CheckBoxCtrlClass();
if (_Installer.Can_Use_IGR_Settings()) {
// If there is already a setting in the registry then use it - otherwise set it by default.
if (_RegistryManager.Use_IGR_Settings (useigrsettings)) {
check->Set_Check (useigrsettings);
} else {
check->Set_Check (true);
}
} else {
// Don't even show this option to the user, and disable it unconditionally.
check->Show (false);
check->Set_Check (false);
}
check->Enable (Is_Dlg_Button_Checked (IDC_WHAT_TO_INSTALL_CHECK2));
InstallMenuDialogClass::On_Init_Dialog();
}
/***********************************************************************************************
* WhatToInstallDialogClass::On_Command -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void WhatToInstallDialogClass::On_Command (int ctrl_id, int message_id, DWORD param)
{
switch (ctrl_id) {
case IDOK:
{
// If neither of the first two options have been selected then ask the user if he wishes to cancel.
if (!(Is_Dlg_Button_Checked (IDC_WHAT_TO_INSTALL_CHECK1) || Is_Dlg_Button_Checked (IDC_WHAT_TO_INSTALL_CHECK2))) {
InstallMenuDialogClass::On_Command (IDCANCEL, 0, 0);
return;
}
break;
}
case IDC_WHAT_TO_INSTALL_CHECK1:
// Disable option 3 (create game icon) if option 1 (install game) is not checked.
Enable_Dlg_Item (IDC_WHAT_TO_INSTALL_CHECK3, Is_Dlg_Button_Checked (IDC_WHAT_TO_INSTALL_CHECK1));
break;
case IDC_WHAT_TO_INSTALL_CHECK2:
// Disable option 4 (use game room settings) if the user is not installing WOL.
Enable_Dlg_Item (IDC_WHAT_TO_INSTALL_CHECK4, Is_Dlg_Button_Checked (IDC_WHAT_TO_INSTALL_CHECK2));
// If the user wishes to install WOL but the source version is not newer than the current version
// then issue a warning.
if (Is_Dlg_Button_Checked (IDC_WHAT_TO_INSTALL_CHECK2) && (!_Installer.Is_Target_WOL_Older_Than_Source())) {
MessageBoxClass::Do_Dialog (TxWideStringClass (IDS_WARNING), TxWideStringClass (IDS_SOURCE_WOL_OLDER), MessageBoxClass::MESSAGE_BOX_TYPE_OK, this);
return;
}
default:
break;
}
InstallMenuDialogClass::On_Command (ctrl_id, message_id, param);
}

View File

@@ -0,0 +1,67 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/WhatToInstallDialog $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 10/25/01 1:42p $*
* *
* $Revision:: 4 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef _WHAT_TO_INSTALL_H
#define _WHAT_TO_INSTALL_H
// Includes.
#include "InstallMenuDialog.h"
// Dialog to obtain from user the set of items to install.
// Classes.
class WhatToInstallDialogClass : public InstallMenuDialogClass
{
public:
WhatToInstallDialogClass() : InstallMenuDialogClass (IDD_DIALOG_WHAT_TO_INSTALL) {}
// RTTI.
void *As_WhatToInstallDialogClass() {return (this);}
void On_Command (int ctrl_id, int message_id, DWORD param);
bool Install_Game() {return (Is_Dlg_Button_Checked (IDC_WHAT_TO_INSTALL_CHECK1));}
bool Install_WOL() {return (Is_Dlg_Button_Checked (IDC_WHAT_TO_INSTALL_CHECK2));}
bool Install_Game_Shortcut() {return (Is_Dlg_Button_Checked (IDC_WHAT_TO_INSTALL_CHECK3));}
bool Use_IGR_Settings() {return (Is_Dlg_Button_Checked (IDC_WHAT_TO_INSTALL_CHECK4));}
protected:
void On_Init_Dialog (void);
};
#endif // _WHAT_TO_INSTALL_DIALOG_H

597
Code/Installer/WinMain.cpp Normal file
View File

@@ -0,0 +1,597 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/WinMain.cpp $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 1/22/02 2:17p $*
* *
* $Revision:: 12 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
// Include files.
#include "Argv.h"
#include "Bufffile.h"
#include "Chunkio.h"
#include "ErrorHandler.h"
#include "FFactory.h"
#include "Installer.h"
#include "MixFile.h"
#include "Msgloop.h"
#include "RAMFileFactory.h"
#include "Resource.h"
#include "SafeTimer.h"
#include "SaveLoad.h"
#include "Timer.h"
#include "Translator.h"
#include "Win.h"
#include "WW3D.h"
#include "WWFile.h"
#include <malloc.h>
#include <dbt.h>
// Defines.
#define AUTORUN_MUTEX_OBJECT TEXT("01AF9993-3492-11d3-8F6F-0060089C05B1")
#define APPLICATION_MUTEX_OBJECT TEXT("C6D925A3-7A9B-4ca3-866D-8B4D506C3665")
// Static variables.
// Foward declarations.
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
ATOM MyRegisterClass (HINSTANCE hInstance);
bool Is_Autorun_Running();
bool Is_Application_Running();
bool Is_Win_95_Or_Above();
bool Is_Win_2K_Or_Above();
bool Running_As_Administrator();
void Prog_End();
/***********************************************************************************************
* WinMain -- Entry point to program. *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
int APIENTRY WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
int result;
// Initialize command line parser.
ArgvClass::Init (lpCmdLine);
TranslateDBClass::Initialize();
try {
// Set global copy of program instance.
ProgramInstance = hInstance;
// Ensure Autorun or another instance of this application is not running.
if ((!Is_Autorun_Running()) && (!Is_Application_Running())) {
// WARNING: Can only raise fatal system errors (not fatal application errors) until
// the translation table has been loaded.
const char *installmixname = "InstallMix.dat";
const char *installstringsfilename = "InstallStrings.tdb";
RAMFileFactoryClass ramfilefactory;
MixFileFactoryClass mixfilefactory (installmixname, &ramfilefactory);
FileClass *file;
// Perform application initialization.
// An invalid mixfile factory indicates a read error.
if (!mixfilefactory.Is_Valid()) FATAL_SYSTEM_ERROR;
_TheFileFactory = &mixfilefactory;
// Load the translation table.
file = _TheFileFactory->Get_File (installstringsfilename);
if (file == NULL) {
// Output an appropriate Windows error message.
SetLastError (2);
FATAL_SYSTEM_ERROR;
}
file->Open (FileClass::READ);
if (file->Is_Available()) {
ChunkLoadClass cload (file);
SaveLoadSystemClass::Load (cload);
} else {
// Output an appropriate Windows error message.
SetLastError (2);
FATAL_SYSTEM_ERROR;
}
file->Close();
_TheFileFactory->Return_File (file);
// Check for valid OS.
if (!(Is_Win_95_Or_Above() || Is_Win_2K_Or_Above())) FATAL_APP_ERROR (IDS_BAD_OS);
// Check for Administrator rights under Win 2k or above.
if (Is_Win_2K_Or_Above()) {
if (!Running_As_Administrator()) FATAL_APP_ERROR (IDS_NOT_ADMINISTRATOR);
}
// Register function to be called at exit.
atexit (Prog_End);
MyRegisterClass (hInstance);
MainWindow = CreateWindow (RxStringClass (IDS_APPLICATION_MAIN_WINDOW),
StringClass (TxWideStringClass (IDS_APPLICATION_NAME)),
WS_SYSMENU|WS_CAPTION|WS_MINIMIZEBOX|WS_CLIPCHILDREN,
0, 0, 0, 0,
NULL, NULL,
hInstance, NULL);
if (MainWindow == NULL) FATAL_SYSTEM_ERROR;
ShowCursor (false);
_Installer.Install (&mixfilefactory);
ShowCursor (true);
}
result = 1;
} catch (const WideStringClass &errormessage) {
// Catch handler for fatal errors.
DestroyWindow (MainWindow);
Windows_Message_Handler();
Message_Box (TxWideStringClass (IDS_APPLICATION_ERROR), errormessage);
result = 0;
}
TranslateDBClass::Shutdown();
ArgvClass::Free();
return (result);
}
/***********************************************************************************************
* MyRegisterClass -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
ATOM MyRegisterClass (HINSTANCE hInstance)
{
static RxStringClass _classname (IDS_APPLICATION_MAIN_WINDOW);
WNDCLASSEX wcex;
wcex.cbSize = sizeof (WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = (WNDPROC)WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_INSTALLER);
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = (LPCSTR)IDS_INSTALLER;
wcex.lpszClassName = _classname;
wcex.hIconSm = LoadIcon (hInstance, (LPCTSTR)IDI_INSTALLER);
return RegisterClassEx (&wcex);
}
/***********************************************************************************************
* WndProc -- Windows message handler. *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
// Pass this message through to the input handler. If the message
// was processed and requires no further action, then return with
// this information.
if (_Installer.Get_Input() != NULL) {
LRESULT result = 0;
if (_Installer.Get_Input()->ProcessMessage (hWnd, message, wParam, lParam, result)) {
return (result);
}
}
switch (message)
{
case WM_ACTIVATEAPP:
if (wParam && !GameInFocus) {
GameInFocus = true;
} else {
if (!wParam && GameInFocus) {
GameInFocus = false;
}
}
return (0);
case WM_ERASEBKGND:
return (1);
case WM_PAINT:
ValidateRect (hWnd, NULL);
break;
case WM_CREATE:
break;
case WM_DESTROY:
PostQuitMessage (0);
break;
case WM_SYSCOMMAND:
switch (wParam) {
case SC_CLOSE:
// Windows sent us a close message - probably in response to Alt-F4. Ignore it.
return (0);
case SC_SCREENSAVE:
// Windows is about to start the screen saver. If we just return without passing
// this message to DefWindowProc then the screen saver will not be allowed to start.
return (0);
case SC_KEYMENU:
// Ignore all "menu-activation" commands.
return (0);
}
break;
case WM_KEYUP:
// Test for SHIFT + ESC.
if ((wParam & 0xff) == VK_ESCAPE && ((GetKeyState (VK_SHIFT) & 0x8000) != 0x0)) {
_Installer.Cancel_Introduction();
}
#if !NDEBUG
// Test for Print Screen (screenshot).
if ((wParam & 0xff) == VK_SNAPSHOT) {
WW3D::Make_Screen_Shot();
}
#endif
case WM_MOUSEWHEEL:
{
if (_Installer.Get_Input() != NULL) {
_Installer.Get_Input()->Add_Mouse_Wheel (HIWORD (wParam));
return (0);
}
break;
}
case WM_DEVICECHANGE:
{
PDEV_BROADCAST_HDR pdbch;
pdbch = (PDEV_BROADCAST_HDR) lParam;
if (pdbch != NULL) {
if (pdbch->dbch_devicetype == DBT_DEVTYP_VOLUME) {
// Assume that this is the CD-ROM drive.
if (wParam == DBT_DEVICEQUERYREMOVE) {
ShowWindow (hWnd, SW_MINIMIZE);
} else {
if (wParam == DBT_DEVICEARRIVAL) {
if (IsIconic (hWnd)) {
ShowWindow (hWnd, SW_RESTORE);
}
SetForegroundWindow (hWnd);
}
}
return (TRUE);
}
}
break;
}
default:
break;
}
return (DefWindowProc (hWnd, message, wParam, lParam));
}
/***********************************************************************************************
* InstallerClass::Is_Autorun_Running -- Determine whether Autorun (a sister application) is *
* running. *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool Is_Autorun_Running()
{
HANDLE autorunmutex = OpenMutex (MUTEX_ALL_ACCESS & SYNCHRONIZE, FALSE, AUTORUN_MUTEX_OBJECT);
if (autorunmutex != NULL) {
HWND window = FindWindow (RxStringClass (IDS_AUTORUN_MAIN_WINDOW), NULL);
if (window) {
CDTimerClass <SafeTimerClass> delaytimer (10 * 1000);
// Hang around for a while to see if Autorun is about to quit...
while ((delaytimer.Value() > 0) && (window != NULL)) {
window = FindWindow (RxStringClass (IDS_AUTORUN_MAIN_WINDOW), NULL);
}
}
CloseHandle (autorunmutex);
// If the Autorun window still exists bring it to the foreground.
if (window) {
if (IsIconic (window)) {
ShowWindow (window, SW_RESTORE);
}
SetForegroundWindow (window);
}
}
return (autorunmutex != NULL);
}
/***********************************************************************************************
* InstallerClass::Is_Application_Running -- Determine whether this application is running. *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool Is_Application_Running()
{
HANDLE appmutex = CreateMutex (NULL, FALSE, APPLICATION_MUTEX_OBJECT);
if (appmutex == NULL) FATAL_SYSTEM_ERROR;
// See if the application was already running.
HWND prev = FindWindow (RxStringClass (IDS_APPLICATION_MAIN_WINDOW), NULL);
if (prev) {
if (IsIconic (prev)) {
ShowWindow (prev, SW_RESTORE);
}
SetForegroundWindow (prev);
return (true);
} else {
return (false);
}
}
/***********************************************************************************************
* InstallerClass::Is_Win_95_Or_Above -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool Is_Win_95_Or_Above()
{
OSVERSIONINFO versioninfo;
BOOL result;
bool validos = false;
versioninfo.dwOSVersionInfoSize = sizeof (versioninfo);
result = GetVersionEx (&versioninfo);
if (result) {
if (versioninfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) {
validos = true;
}
}
return (validos);
}
/***********************************************************************************************
* InstallerClass::Is_Win_2K_Or_Above -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool Is_Win_2K_Or_Above()
{
OSVERSIONINFO versioninfo;
BOOL result;
bool validos = false;
versioninfo.dwOSVersionInfoSize = sizeof (versioninfo);
result = GetVersionEx (&versioninfo);
if (result) {
if (versioninfo.dwPlatformId == VER_PLATFORM_WIN32_NT) {
validos = (versioninfo.dwMajorVersion >= 5) && (versioninfo.dwMinorVersion >= 0);
}
}
return (validos);
}
/***********************************************************************************************
* InstallerClass::Running_As_Administrator -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
bool Running_As_Administrator()
{
bool fAdmin;
HANDLE hThread;
TOKEN_GROUPS *ptg = NULL;
DWORD cbTokenGroups;
DWORD dwGroup;
PSID psidAdmin;
SID_IDENTIFIER_AUTHORITY SystemSidAuthority = SECURITY_NT_AUTHORITY;
// Open a handle to the access token for this thread.
if (!OpenThreadToken (GetCurrentThread(), TOKEN_QUERY, FALSE, &hThread)) {
if (GetLastError() == ERROR_NO_TOKEN) {
// If the thread does not have an access token, examine the access token associated with the process.
if (! OpenProcessToken (GetCurrentProcess(), TOKEN_QUERY, &hThread)) {
return (false);
}
} else {
return (false);
}
}
// Query the size of the group information associated with the token. Note that we expect a FALSE result from GetTokenInformation
// because we've given it a NULL buffer. On exit cbTokenGroups will tell the size of the group information.
if (GetTokenInformation (hThread, TokenGroups, NULL, 0, &cbTokenGroups)) {
return (false);
}
// Verify that GetTokenInformation failed for lack of a large enough buffer.
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
return (false);
}
// Allocate a buffer for the group information. Since _alloca allocates on the stack, we don't have
// to explicitly deallocate it. That happens automatically when we exit this function.
if (!(ptg = (TOKEN_GROUPS*) _alloca (cbTokenGroups))) {
return (false);
}
// Ask for the group information again. This may fail if an administrator has added this account
// to an additional group between our first call to GetTokenInformation and this one.
if (!GetTokenInformation (hThread, TokenGroups, ptg, cbTokenGroups, &cbTokenGroups)) {
return (false);
}
// Create a System Identifier for the Admin group.
if (!AllocateAndInitializeSid (&SystemSidAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &psidAdmin)) {
return (false);
}
// Iterate through the list of groups for this access token looking for a match against the SID we created above.
fAdmin = false;
for (dwGroup = 0; dwGroup < ptg->GroupCount; dwGroup++) {
if (EqualSid (ptg->Groups[dwGroup].Sid, psidAdmin)) {
fAdmin = true;
break;
}
}
// Explicity deallocate the SID we created.
FreeSid (psidAdmin);
return (fAdmin);
}
/***********************************************************************************************
* Prog_End -- *
* *
* INPUT: *
* *
* OUTPUT: *
* *
* WARNINGS: *
* *
* HISTORY: *
* 08/22/01 IML : Created. *
*=============================================================================================*/
void Prog_End()
{
try {
_Installer.On_Prog_End();
} catch (const WideStringClass &errormessage) {
// Catch handler for fatal errors.
DestroyWindow (MainWindow);
Windows_Message_Handler();
Message_Box (TxWideStringClass (IDS_APPLICATION_ERROR), errormessage);
}
}

View File

@@ -0,0 +1,58 @@
/*
** Command & Conquer Renegade(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 <http://www.gnu.org/licenses/>.
*/
/***********************************************************************************************
*** Confidential - Westwood Studios ***
***********************************************************************************************
* *
* Project Name : Installer *
* *
* $Archive:: /Commando/Code/Installer/Wol1Dialog.h $*
* *
* $Author:: Ian_l $*
* *
* $Modtime:: 11/09/01 10:31p $*
* *
* $Revision:: 3 $*
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef _WOL1_DIALOG_H
#define _WOL1_DIALOG_H
// Includes.
#include "InstallMenuDialog.h"
// Dialog to instigate sign-up for a Westwood Online account.
// Classes.
class WOL1DialogClass : public InstallMenuDialogClass
{
public:
WOL1DialogClass() : InstallMenuDialogClass (IDD_DIALOG_WOL1) {}
// RTTI.
void *As_WOL1DialogClass() {return (this);}
void On_Command (int ctrl_id, int message_id, DWORD param);
};
#endif // _WOL1_DIALOG_H

157
Code/Installer/resource.h Normal file
View File

@@ -0,0 +1,157 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by Installer.rc
//
#define IDD_INSTALLER_DIALOG 102
#define IDM_ABOUT 103
#define IDM_EXIT 105
#define IDI_INSTALLER 107
#define IDR_MAINFRAME 128
#define IDD_DIALOG_WELCOME 129
#define IDD_DIALOG_LICENSE 130
#define IDD_DIALOG_SERIAL 131
#define IDD_DIALOG_MESSAGE_BOX_OK 132
#define IDD_DIALOG_WHAT_TO_INSTALL 133
#define IDD_DIALOG_MESSAGE_BOX_YES_NO 134
#define IDD_DIALOG_DIRECTORY 135
#define IDD_DIALOG_FOLDER 136
#define IDD_DIALOG_REVIEW 137
#define IDD_DIALOG_WOL1 138
#define IDD_DIALOG_FINAL 139
#define IDD_DIALOG_TRANSITION 140
#define IDD_DIALOG_COPY 141
#define IDD_DIALOG_BROWSER 143
#define IDD_DIALOG_WOL2 144
#define IDD_DIALOG_CARD_SELECTION 145
#define IDD_DIALOG_MESSAGE_BOX_RETRY_QUIT 149
#define IDS_INSTALL_CD_VOLUME_NAME 163
#define IDS_GAME_PRODUCT_KEY 164
#define IDS_WOLAPI_SKU 183
#define IDS_WOLREGISTER_SKU 184
#define IDS_GAME_EXECUTABLE_FILENAME 185
#define IDS_README_FILENAME 190
#define IDS_WORD_README_FILENAME 190
#define IDS_README_ICON_FILENAME 191
#define IDS_GAME_UNINSTALL_FILENAME 194
#define IDS_INTERNET_REGISTRATION_FILENAME 196
#define IDS_WOL_UNINSTALL_FILENAME 198
#define IDS_WWCONFIG_FILENAME 224
#define IDS_APPLICATION_MAIN_WINDOW 225
#define IDS_AUTORUN_MAIN_WINDOW 226
#define IDS_RESOURCE_APPLICATION_ERROR 227
#define IDS_GAME_INI_FILENAME 240
#define IDS_SETUP_INI_FILENAME 241
#define IDS_WOL_INI_FILENAME 242
#define IDS_WOLAPI_DLL_FILENAME 243
#define IDS_WOLBROWSER_DLL_FILENAME 245
#define IDS_TEXT_README_FILENAME 246
#define IDS_GAME_UNINSTALL_LOG_FILENAME 247
#define IDS_WOL_UNINSTALL_LOG_FILENAME 248
#define IDS_SERIAL_ENCRYPTION_FILENAME 249
#define IDS_GAME_DIRECTORY_NAME 250
#define IDS_WOL_DIRECTORY_NAME 251
#define IDS_NON_DISCLOSURE_AGREEMENT 252
#define IDS_AGREE_TO_NDA 253
#define IDS_RESOURCE_DEFAULT_GAME_PATH 254
#define IDS_RESOURCE_DEFAULT_WOL_PATH 255
#define IDS_RESOURCE_DEFAULT_GAME_FOLDER 256
#define IDS_RESOURCE_DEFAULT_WOL_FOLDER 257
#define IDS_RESOURCE_GAME_PRODUCT_NAME 258
#define IDS_RESOURCE_WOL_PRODUCT_NAME 259
#define IDS_RESOURCE_WOLREGISTER_NAME 260
#define IDS_RESOURCE_WOLBROWSER_NAME 261
#define IDS_RESOURCE_AUTO_UPDATE_TITLE 262
#define IDS_RESOURCE_README_TITLE 263
#define IDS_RESOURCE_GAME_UNINSTALL_TITLE 264
#define IDS_RESOURCE_INTERNET_REGISTRATION_TITLE 265
#define IDS_RESOURCE_WWCONFIG_TITLE 266
#define IDS_RESOURCE_WOL_UNINSTALL_TITLE 267
#define IDS_RESOURCE_VERBOSE_GAME_PRODUCT_NAME 268
#define IDS_RESOURCE_PLAY_ONLINE_WITH_GAMESPY 269
#define IDC_WELCOME_STATIC2 1001
#define IDC_WELCOME_STATIC1 1005
#define IDC_WELCOME_FRAME 1007
#define IDC_LICENSE_CHECK 1008
#define IDC_LICENSE_STATIC2 1009
#define IDC_LICENSE_QUERY 1009
#define IDC_LICENSE_STATIC1 1011
#define IDC_LICENSE_HEADING 1011
#define IDC_BUTTON_BACK 1013
#define IDC_SERIAL_EDIT1 1014
#define IDC_SERIAL_EDIT2 1016
#define IDC_SERIAL_EDIT3 1017
#define IDC_SERIAL_EDIT4 1018
#define IDC_AGREEMENT_STATIC_AGREE 1021
#define IDC_AGREEMENT_STATIC_DISAGREE 1022
#define IDC_MESSAGE_BOX_STATIC 1023
#define IDC_SERIAL_STATIC 1024
#define IDC_WHAT_TO_INSTALL_STATIC 1026
#define IDC_WHAT_TO_INSTALL_CHECK1 1027
#define IDC_WHAT_TO_INSTALL_CHECK2 1028
#define IDC_WHAT_TO_INSTALL_CHECK3 1029
#define IDC_BUTTON_BROWSE 1035
#define IDC_DIRECTORY_STATIC1 1037
#define IDC_DIRECTORY_STATIC2 1039
#define IDC_DIRECTORY_STATIC3 1040
#define IDC_DIRECTORY_EDIT 1041
#define IDC_FOLDER_EDIT 1045
#define IDC_FOLDER_STATIC1 1046
#define IDC_FOLDER_STATIC2 1047
#define IDC_FOLDER_STATIC3 1048
#define IDC_FOLDER_LIST 1049
#define IDC_REVIEW_STATIC1 1051
#define IDC_REVIEW_STATIC2 1053
#define IDC_WOL1_STATIC 1054
#define IDC_FINAL_STATIC1 1055
#define IDC_FINAL_STATIC2 1056
#define IDC_FINAL_CHECK1 1057
#define IDC_FINAL_CHECK2 1058
#define IDC_FINAL_CHECK3 1059
#define IDC_FINAL_STATIC3 1060
#define IDC_BUTTON_YES 1061
#define IDC_BUTTON_NO 1062
#define IDC_TRANSITION_STATIC1 1070
#define IDC_EVA_UPDATING1 1070
#define IDC_TRANSITION_STATIC2 1071
#define IDC_EVA_UPDATING2 1071
#define IDC_TRANSITION_STATIC3 1072
#define IDC_PLEASE_STANDBY 1072
#define IDC_COPY_VIEWER 1073
#define IDC_COPY_DESCRIPTION 1074
#define IDC_COPY_STATUS 1075
#define IDC_COPY_STATUS1 1075
#define IDC_LICENSE_EDIT 1076
#define IDC_COPY_PERCENTAGE 1077
#define IDC_BROWSER_TREE 1078
#define IDC_BROWSER_STATIC 1079
#define IDC_COPY_HEADER 1080
#define IDC_REVIEW_EDIT 1081
#define IDC_WOL2_LIST 1084
#define IDC_WOL2_EDIT 1085
#define IDC_WOL2_STATIC1 1086
#define IDC_WOL2_STATIC2 1087
#define IDC_CARD_SELECTION_LIST 1088
#define IDC_WHAT_TO_INSTALL_CHECK4 1090
#define IDC_WELCOME_EDIT 1092
#define IDC_COPY_STATUS2 1093
#define IDC_BUTTON_RETRY 1094
#define IDC_BUTTON_QUIT 1095
#define IDC_START_POSITION 1096
#define IDC_BIO_MONITOR_AND_LOCAL_RADAR_ACTIVATING 1097
#define IDC_BIO_MONITOR_ACTIVATING 1097
#define IDC_INITIALIZING_OBJECTIVES_SYSTEM 1098
#define IDC_UPDATING_WEAPON_STATUS 1099
#define IDC_TARGETING_SYSTEM_ONLINE 1100
#define IDC_SCANNING_LOCAL_RADAR 1102
#define IDC_STATIC -1
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 150
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1103
#define _APS_NEXT_SYMED_VALUE 110
#endif
#endif

11709
Code/Installer/string_ids.h Normal file

File diff suppressed because it is too large Load Diff