[487] | 1 | /***************************************************************************\
|
---|
| 2 | | Project: AE Installer |
|
---|
| 3 | | By: Gumby & Iritscen |
|
---|
| 4 | | File: Installer.h |
|
---|
| 5 | | Function: Contains the real meat of the installation process. |
|
---|
| 6 | | Created: 24/05/2009 19:39:00 |
|
---|
| 7 | \***************************************************************************/
|
---|
| 8 |
|
---|
[325] | 9 | #ifndef DOUBLE_HEADER
|
---|
| 10 | #define DOUBLE_HEADER
|
---|
| 11 |
|
---|
| 12 | #include <string>
|
---|
| 13 | #include <vector>
|
---|
[487] | 14 | #include <iostream>
|
---|
| 15 | #include "globals.h"
|
---|
| 16 | #ifdef WIN32
|
---|
| 17 | #ifndef __GUICON_H__
|
---|
| 18 | #define __GUICON_H__
|
---|
| 19 | #endif
|
---|
[325] | 20 | #include <fstream>
|
---|
[487] | 21 | #include <windows.h>
|
---|
| 22 | #include <stdio.h>
|
---|
| 23 | #include <fcntl.h>
|
---|
| 24 | #include <io.h>
|
---|
[325] | 25 |
|
---|
[487] | 26 | void RedirectIOToConsole();
|
---|
| 27 | // maximum mumber of lines the output console should have
|
---|
| 28 | static const WORD MAX_CONSOLE_LINES = 500;
|
---|
| 29 | #endif
|
---|
[325] | 30 |
|
---|
[487] | 31 |
|
---|
| 32 | #pragma mark GLOBALS
|
---|
[325] | 33 | static string SLASHSLASH = "//";
|
---|
| 34 | static string DIRSLASH = "\\";
|
---|
[487] | 35 | extern bool busy;
|
---|
| 36 | extern string strInstallCfg;// = "../GameDataFolder/Add.cfg";
|
---|
| 37 | extern Install_info_cfg currentAE, updateAE;
|
---|
| 38 | extern bool splitInstances;
|
---|
| 39 | extern string strImportOption;
|
---|
| 40 | extern string strOniSplit;
|
---|
| 41 | extern vector<ModPackage> globalPackages;
|
---|
| 42 | extern string strEUFN; // I don't mind long variable names, but even I think strEditionUpdateFolderName is a bit much
|
---|
| 43 | #ifndef WIN32
|
---|
| 44 | void Sleep(int ms); // crudely converts the Windows sleep() call, which operates in ms, to the Mac sleep() call that operates in seconds
|
---|
| 45 | #endif
|
---|
[325] | 46 |
|
---|
[461] | 47 |
|
---|
[487] | 48 | #pragma mark PROTOTYPES
|
---|
[325] | 49 | int mainMenu(void);
|
---|
[487] | 50 | vector<string> getInstallString(string = strInstallCfg);
|
---|
[325] | 51 | int installPackages(void);
|
---|
| 52 | int uninstallPackages(void);
|
---|
| 53 | int listInstalledPackages(void);
|
---|
| 54 | int printInstallerInfo(void);
|
---|
| 55 | ModPackage fileToModPackage(fstream&);
|
---|
[487] | 56 | bool StringIsLegalPathForDeletion(string);
|
---|
| 57 | vector<ModPackage> getPackages(string packageDir = "./packages");
|
---|
| 58 | void MakePathLocalToGlobalize(string*);
|
---|
| 59 | bool SortBySize(string, string);
|
---|
[325] | 60 | void tokenize(const string&, vector<string>&, const string& delimiters = " ");
|
---|
[499] | 61 | void StripNewlines(string *);
|
---|
[325] | 62 | void clearOldDats(void);
|
---|
| 63 | void writeInstalledMods( vector<string> );
|
---|
[462] | 64 | void copyBSL( string, vector<string>&, ModPackage );
|
---|
[487] | 65 | bool ReadInstallInfoCfg(fstream *, Install_info_cfg *);
|
---|
[461] | 66 |
|
---|
[325] | 67 | /* End of File */
|
---|
| 68 |
|
---|
[487] | 69 | //End of File
|
---|
[325] | 70 |
|
---|
| 71 | #endif
|
---|