/**********************************************/
/*                                            */    
/* defines.h                                  */
/*                                            */
/* global data                                */
/*                                            */
/* scol v 4                                   */
/*                                            */
/**********************************************/


// Modifications History
//
//$ LB (28/08/2001) : add EnumNetscape6Paths script function


#ifndef _DEFINES_H
#define _DEFINES_H



/*********************************************************************/
/*                                                                   */
/*     ENVIRONNEMENT VALUES                                          */
/*                                                                   */
/*********************************************************************/

//loïc : add APP_SIZE 
#define APP_SIZE        atoi (getvar ("APP_SIZE"))
#define APP_VERSION_SUP (getvar("APP_VERSION_SUP"))
#define APP_VERSION_INF (getvar("APP_VERSION_INF"))
#define APP_TITTLE      (getvar("APP_TITTLE"))
#define APP_RELEASE     (getvar("APP_RELEASE"))
#define EXENAME         (getvar("EXENAME"))
#define EXEARGS         (getvar("EXEARGS"))
#define PROGRAMGROUP    (getvar("PROGRAMGROUP"))
#define SETUPNAME       (getvar("SETUPNAME"))
#define INTRO           (getvar("INTRO"))

//#define SETUPNAME APP_TITTLE " v" APP_VERSION_SUP "." APP_VERSION_INF " - " APP_RELEASE
//#define INTRO "  This program will install " SETUPNAME " on this computer.\n  This program is free to use but stays the property of Cryo-Online. You use it at your own risks and we cannot be held responsible for any damage directly or indirectly done by this software and any of it's components to your computer, home appliance, brain, dog or whatever.\n  If you agree with the above statements click on Continue. Learn more about this licence agreement in the included file \"licence.txt\"."









/*********************************************************************/
/*                                                                   */
/*     STRUCT AND DATA                                               */
/*                                                                   */
/*********************************************************************/

typedef struct LangType
{
  int langid;
  char* langname;
} LangType;

extern LANGID langid;
extern int reboot;

#define NLangID 72
extern LangType langtype[NLangID];




extern HWND MainHWND;
extern DWORD MainHWNDwidth;
extern DWORD MainHWNDheight;
extern DWORD MainHWNDtop;
extern DWORD MainHWNDleft;
extern HINSTANCE Instance;


extern BOOL Mini;
extern BOOL Silent;
extern BOOL Force;
extern BOOL Debug;

#define WINDIR (getvar("WINDIR"))
#define SYSDIR (getvar("SYSDIR"))
#define SRCDIR (getvar("SRCDIR"))
#define DSTDIR (getvar("DSTDIR"))

extern char License [1024];














/*********************************************************************/
/*                                                                   */
/*     SETUP.INI FUNCTIONS CODES                                     */
/*                                                                   */
/*********************************************************************/


#define ICREATEDIR           0 // create a directory in Dest+Src
#define ICOPYA               1 // copy Src in Dest absolute (no default dir)
#define ICOPY                2 // copy SRCDIR+Src in DSTDIR+Dest 
#define ICOPYS               3 // copy SRCDIR+Src in Dest 
#define ICOPYD               4 // copy Src in DSTDIR+Dest
#define IMOVEA               5 // move Src in Dest absolute (no default dir)
#define IMOVE                6 // move SRCDIR+Src in DSTDIR+Dest 
#define IMOVES               7 // move SRCDIR+Src in Dest 
#define IMOVED               8 // move Src in DSTDIR+Dest
//scol v 4 : doesn't need this anymore
//#define IREGISTER            9 // register the DLL Dest+Src
#define IEnumNetscape6Paths  9  // if Netscape(s) 6 is(are)found, put the path in a variable and return 1. 0 if not.
#define ICREATEGROUP         10 // Create a group in the start menu with the name Src
#define ICREATELINK          11 // Create a shortcut to DSTDIR+Src with Dest as the name
#define ICOPYDIRTODEST       12 // Copy SRCDIR+Src to DSTDIR+Src
#define ISERIAL              13 // Enter a serial number and put it in  Dest+"usmress.ini"
#define ICREATESRCLINK       14 // Create a shortcut to SRCDIR+Src with Dest as the name
#define IADDPACK             15 // add a partition to usmpack.ini
#define ISet                 16 // Set a variable
#define IGet                 17 // Get a variable
#define IGoto                18 // Goto a new section and execute it.
#define IQuit                19 // Quits the install application
#define IGetSerial           20 // Get a serial number
#define IShowFile            21 // Show a file (like the licence.txt...)
#define IGetSystemVars       22 // Gets the system & windows directories
#define IShowInstallDlg      23 // Shows the startup dialog box
#define IIf                  24 // If / [Else] / Endif
#define IElse                25 // Else / Endif
#define IEndif               26 // Ignored (present for syntaxic reasons)
#define IExist               27 // Test if the file exists
#define IEnumNetscapePaths   28 // if Netscape(s) is(are)found, put the path in a variable and return 1. 0 if not.
#define IReturn              29 // Returns from the current section.
#define IMsgBoxOK            30 // Mesagebox with 1 button (ok)
#define IMsgBoxOKCancel      31 // messagebox w/ 2 buttons (ok cancel)
#define IDetectTCPIP         32 // detects the presence of TCP/IP
#define IStrcat              33 // Adds a string to one another.
#define IStrcmp              34 // Compares two strings (true if equal)
#define IRun                 35 // Launch an exe 
#define IDelete              36 // Erases a file 
#define IUnregister          37 // Unregisters a dll
#define IDeltree             38 // deletes a directory tree
#define IGetPgmGroup         39 // get the path where the programs links are stored
#define IDelPgmGroup         40 // deletes a pgmgroup
#define ISetUninstall        41 // Registers the uninstall program
#define IRegisterFont        42 // Registers a font in the system
#define IUnregisterFont      43 // UnRegisters a font in the system
#define IFindInFile          44 // Finds a line begining with [source] in file [dest]
#define IParseFile           45 // calls the [dest] section for each line in the file [source] , the temp line is in the var [TempLine] and [TempStripped]
#define IDetectSCOL          46 // Detects if scol is currently installed on the computer and set the variable SCOLpath to the path where usmwin.exe is.
#define IAppendFile          47 // Adds source to file [dest]
#define IGetTempFileName     48 // Store a temp filename in [source]
#define IInclude             49 // Include and executes the file [source] starting at section [dest]
#define IDelUninstall        50 // Unregisters the uninstall program
#define ISetupType           51 // Asks the user for the setup type ...
#define IClr                 52 // destroys a variable
#define IStricmp             53 // Compares two strings case insensitivly (true if equal)
#define IMsgBoxYESNO         54 // le retour de la boite de dialogue...
#define IRunWait             55 // Run source with dest arg.
#define IDelScmAsso          56 // Delete association with ".scm" files...
#define IShowWin             57 // Shows MainWindow
#define IHideWin             58 // Shows MainWindow
#define ICD                  59 // change directory
#define IGetScolSettings     60 // Get scol settings (sic!)
#define IGetSMTPServer       61 // Get SMTP server 
#define IIsScolUpdated       62 // Has SCOL been updated??? (check the usm.ini file)
#define IIsScolRunning       63 // Has SCOL benn launched
#define IImportOldScol       64 // Import old scol settings 
#define IDeleteAllFiles      65 // Delete all files in the directory 
#define ICheckForDLL         66 // Tries to load source as a dll
#define IIsMini              67 // Is it a mini install??
#define ISetText             68 // Sets the text in the waiter dialog
#define IQuitErr             69 // Quit with error
#define IIsSilent            70 // Is it a silent install??
#define IInstallSuccess      71 // Update the success entry in the registry (intel...)
#define ICreateDesktopLink   72 // Creates a link to a file on the desktop...
#define IDestroyDesktopLink  73 // Creates a link to a file on the desktop...
#define IIsEnoughSpace       74 // Check for Needed space on DSTDIR
#define ICreateStartLink     75 // Creates a link to startup menu
#define IDestroyStartLink    76 // Creates a link to startup menu
#define IGetVersion		     77 // Get a version number (major+minor) in a file ; result stored in MAJMIN
#define IIsGreater		     78 // True if string1 > string2
#define IIsLower		     79 // True if string1 < string2
#define IMkStr			     80 // Put a string between " ; result stored in QTSTR
#define ICopyWord		     81 // Create in WORD variable the given string in strbuild format
#define IKillScol            82 // kill all scol processes detected
#define IIsRebootNeeded      83 // return 1 if computer needs to reboot
#define IReboot              84 // make the computer reboot
#define ICOPYSAFE            85 // make a copy. if direct copy fails, check filenames version and don't copy after reboot
#define IMOVESAFE            86 // same as IcopySAFE
#define ICOPYDIRTODESTSAFE   87 // same as ICOPYSAFE, but for a directory
#define IBKGApplyBackground  88
#define IBKGApplyText        89
#define IBKGApplyLogo        90
#define IIsUserAuthorized    91
#define ICreateDSN			 92
#define IGetForcedIP		 93
#define ISetForcedIP		 94
#define ISetDNSname			 95
#define IReplaceFile		 96
#define IIsForced			 97
#define IIntcmp              98 // Compares two strings as integers
#define IIfPos               99 // True if lastresult > 0


extern int LastResult;

typedef struct Operation
{
  int code;
  char * syntax;
  int nparams;
} Operation;
              

//$ LB (28/08/2001) : add EnumNetscape6Paths script function ==> N_OP = 93
#define N_OP 100
extern Operation Operations[N_OP];                                               

typedef struct Variable
{
  char * name;
  char * value;
} Variable;

#define NVARS 400
extern Variable vars[NVARS];

typedef struct FileOperation
{
  char * source;
  char * dest;
  char * srcval;
  char * dstval;
  int code;
  BOOL src,dst;
} FileOperation;

extern FILE* INIFile;

extern BOOL StopINI;
extern BOOL StopALL;
extern Uninstall;
extern char Installdir[MAX_PATH];



//$ LB mars 2001
//add infos to print correctly the progress bar
extern int iProgressBarPos;


extern int oldinstallfailled;


#endif