source: AE/Installer/trunk/source/globals.h@ 501

Last change on this file since 501 was 500, checked in by iritscen, 15 years ago

Changed 'Installer replacement failed' message so user can choose not to quit.
Fixed BSL mod package-detecting bug and other dubious flag-detecting code.
Added check for required Installer version when scanning package info files.

File size: 2.8 KB
RevLine 
[487]1/***************************************************************************\
2| Project: AE Installer |
3| By: Gumby & Iritscen |
4| File: Globals.h |
5| Function: Contains most of the includes needed by the source, and some |
6| defines, structs, and prototypes that help bridge certain |
7| source files that need to talk to each other. |
8| Created: 04/11/2009 21:05:00 |
9\***************************************************************************/
10
11
12#pragma mark INCLUDES
13#include <fstream>
14#include <string>
15#include <stdio.h>
16#include <iostream>
17#include <cctype>
18#include <vector>
19#include <errno.h>
20#include <sstream>
21#include "boost/thread.hpp"
22#include "boost/tokenizer.hpp"
23#include "boost/lexical_cast.hpp" // int -> string
24#include "boost/algorithm/string.hpp"
25#include "boost/filesystem.hpp" // includes all needed Boost.Filesystem declarations
26using namespace boost::filesystem;
27using namespace std;
28#ifdef WIN32
29#include <windows.h>
30#else // assume we're on Mac
31#include <stdlib.h>
32#include <dirent.h>
33#endif
34#include "wx/wxprec.h"
35#ifdef __BORLANDC__
36#pragma hdrstop
37#endif
38#ifndef WX_PRECOMP
39#include "wx/wx.h"
40#endif
41
42#pragma mark DEFINES
[500]43#define INSTALLER_VERSION "1.1" // only place in source we need to set this
[487]44#define UPDATE_LOG_READ_ERR -1
45#define UPDATE_INST_REPL_ERR -2
46#define UPDATE_MNTH_REQD_ERR -3
47#define UPDATE_NO_UPD_AVAIL 0
48#define UPDATE_SIMP_AVAIL 1
49#define UPDATE_GLOB_AVAIL 2
50#define UPDATE_INST_AVAIL 3
51#define UPDATE_CONT_UPD 4
52
53#pragma mark STRUCTS
54struct ModPackage
55{
56 bool isInstalled; // replace with function
[500]57 string installerVersion;
[487]58 string name;
59 string modStringName;
60 int modStringVersion;
61 bool hasOnis;
62 bool hasDeltas;
63 bool hasBSL;
64 bool hasAddon;
65 bool hasDats;
66 string category;
67 string creator;
68 bool isEngine;
69 string readme;
70 bool globalNeeded;
71 ModPackage();
72
73 bool operator < (const ModPackage &fs) const
74 { return (name < fs.name);}
75
76 bool operator > (const ModPackage &fs) const
77 { return (name > fs.name);}
78
79 bool operator == (const ModPackage &fs) const
80 { return (name == fs.name);}
81};
82
83struct Install_info_cfg
84{
85 string AEVersion, InstallerVersion, DaodanVersion, OniSplitVersion, WinGUIVersion, MacGUIVersion;
86 bool patch, globalizationRequired;
87 vector<string> deleteList;
88
89 Install_info_cfg();
90};
91
92
93#pragma mark PROTOTYPES
94void recompileAll(vector<string>);
95int globalizeData(void);
96bool CheckForGlobalization(bool);
97int GetUpdateStatus(Install_info_cfg *, Install_info_cfg *, bool *);
98bool ProcessInstallerUpdate(Install_info_cfg *, Install_info_cfg *);
99bool ProcessAEUpdate(Install_info_cfg *, Install_info_cfg *, bool *);
100void callRefreshMods(void);
101string escapePath(string input);
102void setStatusArea(string);
103void setProgressBar(int);
104void copy_directory(const path &from_dir_ph, const path &to_dir_ph);
105void copy(const path &from_file_ph, const path &to_file_ph);
Note: See TracBrowser for help on using the repository browser.