home *** CD-ROM | disk | FTP | other *** search
Wrap
// ---------------------------------------------------------------------------------------------------------------------------------------------------------- // Setup Studio 2.6 COPYRIGHT 1993-1995 HEXANETâ - Header file for C and C++ Languages. // ---------------------------------------------------------------------------------------------------------------------------------------------------------- // Please, include this file to your main setup project // // Index: ( number corresponds to line ) // // 1 - Information functions // General 48 // Drives 72 // Directory 87 // Files 96 // 2 - Low level files and dirs management // Binary files 127 // Ascii files 142 // Directories 156 // 3 - SDK similar functions // INI files managment 169 // Programm execution 180 // 4 - Setup specific helpers // Sections informations 211 // Files names managment 218 // Directories managment 236 // 5 - Setup high level functions // Initialization 266 // DDE with Progman 275 // Specific functions 287 // Interface managment 214 // 6 - New release functions // 384 // // ---------------------------------------------------------------------------------------------------------------------------------------------------------- #ifdef __cplusplus extern "C" { #endif #ifndef _ssetup_h #define _ssetup_h // INITIALIZATION FUNCTIONS // extern void WINAPI SetupInitForFunctions( LPCSTR szYourName, LPCSTR szPassword ); // Required if you want to use functions directly ( without SetupInitialize ) [new] //------------------------------------------------------------------------------------------------------------------------------------------------------------ // 1 - Information functions //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //------------------------------------------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------- // General System information functions //------------------------------------------------------------------------------------------------------- #define BDETECT_WIN386 0 // 386 mode #define BDETECT_VGA640 1 // VGA 640 pixels at least #define BDETECT_VGA800 2 // VGA 800 pixels at least #define BDETECT_VGA1024 3 // VGA 1024 pixels at least #define BDETECT_16COLORS 4 // 16 colors at least #define BDETECT_256COLORS 5 // 256 colors at least #define BDETECT_COPRO 6 // Math. coprocessor #define BDETECT_286 7 // 286 CPU #define BDETECT_386 8 // 386 CPU #define BDETECT_486 9 // 486 CPU #define BDETECT_MOUSE 10 // Mouse extern BOOL WINAPI bDetect( int CVALUE ); // Return TRUE if the element is present #define LDETECT_BUFFERS 0 // Buffers declared in CONFIG.SYS #define LDETECT_FILES 1 // Files declared in CONFIG.SYS #define LDETECT_DRIVES 2 // Number of drives #define LDETECT_FREERES 3 // Free system resources available ( percent ) #define LDETECT_FREERAM 4 // Free memory available extern long WINAPI lDetect( int CVALUE ); // Return the long value of item //------------------------------------------------------------------------------------------------------- // Drives information functions //------------------------------------------------------------------------------------------------------- #define DRIVETYPE_REMOTE 0 // Network unit #define DRIVETYPE_FIXED 1 // HD #define DRIVETYPE_REMOVABLE 2 // FD #define DRIVETYPE_UNKNOWN 3 // Unknown type extern UINT WINAPI AskForDriveType( UINT drive ); // Return drive type ( drive is 1, 2 .... ) extern long WINAPI AskForDriveSpace( UINT drive ); // Return drive free space in KOctets ( drive is 1, 2... ) extern BOOL WINAPI IsDriveValid( LPCSTR szDriveLetter ); // Return TRUE if szDriveLetter is an avalaible drive here extern int WINAPI GetDriveNumber( LPCSTR szPath ); // Return number of a drive ( as a PATH ) //------------------------------------------------------------------------------------------------------- // Directory information functions //------------------------------------------------------------------------------------------------------- extern BOOL WINAPI DoesDirExist( LPCSTR szDirName ); // Return TRUE if szDirName exists //------------------------------------------------------------------------------------------------------- // Files information functions //------------------------------------------------------------------------------------------------------- extern BOOL WINAPI DoesFileExist( LPCSTR szFileName, BOOL FormalSearch ); // search for a file, if Formal is TRUE, the function // only test the directory specified, else the function // search for the file in current dir., in PATH and // Windows and Windows system directory. extern BOOL WINAPI GetAbsoluteFileName( LPCSTR szFileName, LPSTR szBuffer ); // Return path and name of an existing file (2.5) //------------------------------------------------------------------------------------------------------- // Module ( DLL or EXE ) information functions //------------------------------------------------------------------------------------------------------- extern UINT WINAPI CountModuleUsage( LPCSTR szModule ); // Return number of instances of a module extern BOOL WINAPI IsDLLLoaded( LPCSTR szModule ); // TRUE if module is loaded //------------------------------------------------------------------------------------------------------- // Environment information functions //------------------------------------------------------------------------------------------------------- extern BOOL WINAPI GetEnvVariable(LPCSTR szVariableName, LPSTR szBuffer ); // Retrieve an environment variable ( "PATH" for example ) (2.5) extern int WINAPI CountPathsInPATH( ); // Count number of paths in PATH variable extern BOOL WINAPI GetPathFromPATH(int iPath, LPSTR szBuffer); // Return a path from PATH variable ( first is 1 ) (2.5) //------------------------------------------------------------------------------------------------------------------------------------------------------------ // 2 - Low level file and dir managment /////////////////////////////////////////////////////////////////////////////////////////////// //------------------------------------------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------- // Binary files //------------------------------------------------------------------------------------------------------- extern BOOL WINAPI RenameFile ( LPCSTR szOldFile, LPCSTR szNewFile ); // Rename a file extern BOOL WINAPI DeleteFile( LPCSTR szFile ); // Delete a file extern BOOL WINAPI TouchFile( LPCSTR szFileName, LPCSTR szNewDate ); // Change file date ( if szNewDate is "", the current date is used ) extern BOOL WINAPI SetReadOnly( LPCSTR szFileName, BOOL bRO ); // Set file Read Only, System and Hidden extern long WINAPI GetFileLength( LPCSTR szFileName ); // Return size of a file in bytes extern BOOL WINAPI ReCreateFile( LPCSTR szOriginalName, LPCSTR szPieceFileName ); // Copy a piece of file in a file ( do not use with pieces // of LZ compressed file ) //------------------------------------------------------------------------------------------------------- // Ascii files //------------------------------------------------------------------------------------------------------- extern BOOL WINAPI CreateAsciiFile( LPCSTR szFileName ); // Create a text file extern long WINAPI CountFileLines( LPCSTR szFileName ); // Return number of lines in a text file extern BOOL WINAPI GetStringFromFile( LPCSTR szFileName, long lIndex, LPSTR szBuffer ); // Return a line of a text file (2.5) extern long WINAPI GetLineFromString( LPCSTR szFileName, LPCSTR szString, long lStart ); // Return index of a line in text file extern UINT WINAPI FindStringInTextFile( LPCSTR szFileName, LPCSTR szString ); // Return number of lines begining with szString extern BOOL WINAPI DeleteString( LPCSTR szFile, int iIndex ); // Delete a string of a file extern BOOL WINAPI AddString( LPCSTR szFile, LPCSTR szValue ); // Add a string in a text file extern BOOL WINAPI SetLineInFile( LPCSTR szFileName, LPCSTR szString, long lIndex ); // Change a string in a file //------------------------------------------------------------------------------------------------------- // Directory managment functions //------------------------------------------------------------------------------------------------------- extern BOOL WINAPI CreateDir( LPCSTR szDirName ); // Create a directoy ( can also create all root directories specified ) extern BOOL WINAPI DeleteDir( LPCSTR szDirName ); // Delete 1 directory and files (2.5) //------------------------------------------------------------------------------------------------------------------------------------------------------------ // 3 - SDK similar functions useful for Setup programms ( for VB users )//////////////////////////////////////////////// //------------------------------------------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------- // INI files managment //------------------------------------------------------------------------------------------------------- extern int WINAPI GetWinIniInt ( LPCSTR szSection, LPCSTR szKey, int iDefault ); // Read an int in WIN.INI extern BOOL WINAPI GetWinIniString ( LPCSTR szSection, LPCSTR szKey, LPCSTR szDefault, LPSTR szBuffer ); // Read a string in WIN.INI (2.5) extern int WINAPI GetIniInt ( LPCSTR szFile, LPCSTR szSection, LPCSTR szKey, int iDefault ); // Read an int in your INI file extern BOOL WINAPI GetIniString ( LPCSTR szFile, LPCSTR szSection, LPCSTR szKey, LPCSTR szDefault, LPSTR szBuffer );// Read a string in your INI file (2.5) extern BOOL WINAPI SetWinnIniString ( LPCSTR szSection, LPCSTR szKey, LPCSTR szValue ); // Write a string in WIN.INI extern BOOL WINAPI SetIniString ( LPCSTR szFile, LPCSTR szSection, LPCSTR szKey, LPCSTR szValue ); // Write a string in your INI file //------------------------------------------------------------------------------------------------------- // Programms execution //------------------------------------------------------------------------------------------------------- #define RESTART_QUIT 0 // Quit windows and stay at DOS prompt #define RESTART_REBOOT 0x43 // Quit Windows and reboot #define RESTART_RESTART 0x42 // Quit Windows and restart Windows extern void WINAPI QuitWindows( UINT cMode ); // Quit windows ( and restart if choosed ) #define APPEXECUTE_SNORMAL 0 // Show normal and activate app. #define APPEXECUTE_SICON 1 // Show iconized and activate app. #define APPEXECUTE_SMAX 2 // Show maximized and activate app #define APPEXECUTE_SNOACTIVATE 3 // Show normal and do not activate app. extern BOOL WINAPI AppExecute( LPCSTR szAppName, UINT cShowMode ); // execute a DOS or Windows application extern BOOL WINAPI DosTempExec( LPCSTR szAppName , LPCSTR szParams ); // Run a critical programm in DOS mode ( This function must // be used to copy sytem shared DLL ( like COMMDLG.DLL )) //------------------------------------------------------------------------------------------------------------------------------------------------------------ // 4 - Setup specific helpers ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //------------------------------------------------------------------------------------------------------------------------------------------------------------ // Note: // // These functions may help you to create the Setup Interface before the files transfer. // You need to initialise the DLL before any call to these functions // //------------------------------------------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------- // Sections information //------------------------------------------------------------------------------------------------------- extern long WINAPI GetSectionSize( LPCSTR szSectionName ); // Return the size in KOctets of a section extern long WINAPI GetConfigurationSize( void ); // Return the size in KOctets of all selected sections //------------------------------------------------------------------------------------------------------- // File name mangment ( useful to create Parsed Edit controls ) //------------------------------------------------------------------------------------------------------- #define FILENAME_SINGLEFILE 0 // Filename must not contain directory specification #define FILENAME_DIRWITHSLASH 1 // Dirname must contain a final slash #define FILENAME_DIRWITHOUTSLASH 2 // Dirname must not contain a final slash #define FILENAME_DIRANDFILE 3 // Dirname + Filename #define CHECK_NOCHECK 0 // No check #define CHECK_FILEEXIST 1 // The file must exist #define CHECK_ROOTDIRSEXIST 2 // All root directories ( without the last ) must exist #define CHECK_ALLDIREXIST 3 // All directories must exist #define CHECK_DIRANDFILE 4 // All directories and the file must exist extern BOOL WINAPI IsFileName( LPCSTR szFileName, UINT IsFileType , UINT iCheckMode); // Return TRUE if szFileName is valid extern BOOL WINAPI FormatFileNameValid( LPCSTR szFileNameIn, BOOL bWithFinalSlash, LPSTR szBuffer ); // Check/Change szFileName (2.5) //------------------------------------------------------------------------------------------------------- // Setup specific directories (you probably don' t need it) //------------------------------------------------------------------------------------------------------- extern void WINAPI GetOriginalDir( LPSTR szBuffer ); // Place in szBuffer the directory where setup was launched extern void WINAPI GetSetupTempDir( LPSTR szBuffer ); // Place in szBuffer the setup temp sytem directory //------------------------------------------------------------------------------------------------------------------------------------------------------------ // 5 - Setup high level functions //////////////////////////////////////////////////////////////////////////////////////////////////////////// //------------------------------------------------------------------------------------------------------------------------------------------------------------ // Note: // // You need to initialise the DLL before any call to these functions // //------------------------------------------------------------------------------------------------------------------------------------------------------------ // // Many functions are not required to create a setup programm. // At least you should call: // // SetupInitialize( "TEST", "", LANGUAGE_ENGLISH, SrcDir, DestDir) ----> Initialize the DLL // AddSectionToCopyList( "Files", "dir" ) ----> Choose a Section to copy // DeleteSystemDir() ----> To clean up the drive // //------------------------------------------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------- // Initialization functions //------------------------------------------------------------------------------------------------------- extern BOOL WINAPI SetupInitialize( LPCSTR szYourName, LPCSTR szPassword, int Language , LPCSTR szSrcDir, LPCSTR szDestDir );// First initializtion function extern BOOL WINAPI SetLogFile( LPCSTR szLogFileName ); // Specifie Log File for Setup ( if szLogFileName = "", LogFile is not used ); extern BOOL WINAPI SetSharedBatchFile( LPCSTR szBatchFileName, LPCSTR szSysDir );// Specifie the file for shared system files //------------------------------------------------------------------------------------------------------- // DDE Link with Progman functions //------------------------------------------------------------------------------------------------------- extern void WINAPI AddItemToProgman( LPCSTR szGroupName, LPCSTR szExeName, LPCSTR szTitle, LPCSTR szTextInfo );// Add item to PROGMAN extern BOOL WINAPI AddProgmanGroup( LPCSTR szGroupName ); // Add a group to Progman extern BOOL WINAPI ShowProgmanGroup( LPCSTR szGroupName ); // Show a group extern BOOL WINAPI DeleteProgmanGroup( LPCSTR szGroupName ); // Delete a group extern BOOL WINAPI AddProgmanItem( LPCSTR szProgName, LPCSTR szTitle ); // Add an item to Progman extern BOOL WINAPI DeleteProgmanItem( LPCSTR szItemName ); // Delete an item of a group extern BOOL WINAPI QuitProgman( void ); // Quit Progman //------------------------------------------------------------------------------------------------------- // Specific functions //------------------------------------------------------------------------------------------------------- extern BOOL WINAPI AddSectionToCopyList( LPCSTR szSection, LPCSTR szDestDir ); // Select a section // These are the values returned by GoSetup Function - #define SETUP_SUCCESSFUL 1 // Transfert is OK #define SETUP_USERBYPASS 2 // User bypassed a file #define SETUP_FAILINCOPYING 3 // Fail in copy ( fatal ) #define SETUP_USERABORT 4 // User abort transfer ( fatal ) #define SETUP_CANTCREATEDIR 5 // Can' t create destination directoy ( fatal ) #define SETUP_WRONGSIZE 6 // File size verification error ( Verify mode only - fatal ) #define SETUP_INTERNALERROR 7 // Error in YOUR programm... ( fatal ) // These are the messages sent by GoSetup Function to hwnd: #define SN_FILENOTFOUND WM_USER + 381 // File not found in disk - not fatal - lp is FileName #define SN_SRCDIRCHANGE WM_USER + 382 // User change source directory - retrieve new dir with AskForSrcDir #define SN_NEWDISKREQUIRED WM_USER + 383 // Dialog box " New disk required is shown " - lp = new disk label #define SN_FILEINSTALLED WM_USER + 384 // File isntalled: lp is destination filename [NEW] extern UINT WINAPI GoSetup( HWND hwnd, BOOL bUseFinish ); // Main setup transfer file function extern BOOL WINAPI DeleteSystemDir( void ); // Delete setup temp sytem directory extern BOOL WINAPI AddPath( LPCSTR szNewPath ); // Add a PATH in autoexec.bat ( support DOS 6 multi boot ) extern BOOL WINAPI GetWinFileAssociation( LPCSTR szFileExtName, LPSTR szBuffer ); // Return program for a data file (2.5) extern BOOL WINAPI CreateWinFileAssociation( LPCSTR szFileExtName, LPCSTR szExeFile ); // Create a new Winfile data file association extern BOOL WINAPI ShowWaitCursor( void ); // Show the Wait Cursor extern BOOL WINAPI HideWaitCursor( void ); // Hide the Wait Cursor //------------------------------------------------------------------------------------------------------- // Interface functions //------------------------------------------------------------------------------------------------------- #define BROSSE_PBLANC 1 // Define BRUSH color for background.... ( WHITE ) #define BROSSE_PNOIR 2 // ... ( BLACK ) #define BROSSE_GRIS100 3 // ... ( VERY LIGHT GREY ) #define BROSSE_PGRISC 4 // ... ( LIGHT GREY ) #define BROSSE_GRIS150 5 // ... ( MIDDLE GREY ) #define BROSSE_PGRISF 6 // ... ( DARK GREY ) #define BROSSE_CYAN25 7 // ... ( VERY LIGHT CYAN ) #define BROSSE_CYAN50 8 // ... ( LIGHT CYAN ) #define BROSSE_CYAN100 9 // ... ( MEDIUM CYAN ) #define BROSSE_PCYANC 10 // ... ( CYAN ) #define BROSSE_PCYANF 11 // ... ( DARK CYAN ) #define BROSSE_CYAN200 12 // ... ( VERY DARK CYAN ) #define BROSSE_BLEU50 13 // ... ( LIGHT BLUE ) #define BROSSE_BLEUVERT 14 // ... ( LIGHT BLUE GREEN ) #define BROSSE_BLEU150 15 // ... ( MEDIUM BLUE ) #define BROSSE_PBLEUC 16 // ... ( BLUE ) #define BROSSE_BLEU200 17 // ... ( DARK BLUE ) #define BROSSE_PBLEUF 18 // ... ( VERY DARK BLUE ) #define BROSSE_BLEU250 19 // ... ( BLUE BLACK ) #define BROSSE_VERT25 20 // ... ( VERY LIGHT GREEN ) #define BROSSE_VERT50 21 // ... ( LIGHT GREEN ) #define BROSSE_VERT100 22 // ... ( MEDIUM GREEN ) #define BROSSE_PVERTC 23 // ... ( SALAD GREEN ) #define BROSSE_VERT200 24 // ... ( LIGHT DARK GREEN ) #define BROSSE_VERT250 25 // ... ( MEDIUM DARK GREEN ) #define BROSSE_PVERTF 26 // ... ( DARK GREEN ) #define BROSSE_KAKI 27 // ... ( KHAKI ) #define BROSSE_JAUNE50 28 // ... ( VERY LIGHT YELLOW ) #define BROSSE_JAUNE100 29 // ... ( LIGHT YELLOW ) #define BROSSE_PJAUNEC 30 // ... ( YELLOW ) #define BROSSE_JAUNE150 31 // ... ( DARK YELLOW ) #define BROSSE_ORANGE 32 // ... ( ORANGE ) #define BROSSE_BEIGE 33 // ... ( BEIGE ) #define BROSSE_PJAUNEF 34 // ... ( VERY DARK YELLOW ) #define BROSSE_MARRON 35 // ... ( BROWN ) #define BROSSE_ROSE100 36 // ... ( PINK ) #define BROSSE_ROUGE100 37 // ... ( LIGHT RED ) #define BROSSE_PROUGEC 38 // ... ( RED ) #define BROSSE_PROUGEF 39 // ... ( DARK RED ) #define BROSSE_FUSH50 40 // ... ( VERY LIGHT MAGENTA ) #define BROSSE_FUSH100 41 // ... ( LIGHT MAGENTA ) #define BROSSE_PFUSHC 42 // ... ( MAGENTA ) #define BROSSE_PFUSHF 43 // ... ( DARK MAGENTA ) #define BROSSE_3DRECT 44 // ... ( SPECIAL - 3D RECTANGLE ) #define BROSSE_3DCIRCLE 45 // ... ( SPECIAL - 3D CIRCLE ) #define BROSSE_3DLOZANGE 46 // ... ( SPECIAL - 3D DIAMOND ) extern BOOL WINAPI SetPatternBrush( HINSTANCE hi, UINT iBitmap ); // Create a user brush with a bitmap ( 8*8 pixels only ) extern BOOL WINAPI SetPatternBrushStandard( UINT iModel ); // Create a brush using a BROSSE_* extern BOOL WINAPI SetupSetTitle( LPCSTR szDialogTitle ); // Set the title of dialog boxes ( Registered version only ) [NEW] extern BOOL WINAPI SetupSetBeepMode ( BOOL bDiskBeepMode ); // Select or not the BEEP mode [NEW] extern BOOL WINAPI SetLogo( HINSTANCE hi, UINT iSetupLogo ); // Specifie a BITMAP to use as a LOGO ( LIGHT MAGENTA is transparent color ). extern BOOL WINAPI SetLogoType( BOOL bTextType ); // If bTextType is TRUE, Setup will use the text as the LOGO, else it will use the bitmap. extern BOOL WINAPI SetTextLogo( LPCSTR szLogoText, LPCSTR szFont, UINT iLogoSize, COLORREF clrLogo, BOOL b3D, BOOL bItalic ); // Specifie the LOGO text title extern BOOL WINAPI SetTextDetail( LPCSTR szLogoText, LPCSTR szFont, UINT iLogoSize, COLORREF clrLogo, BOOL b3D, BOOL bItalic ); // Specifie the LOGO text detail [NEW] extern BOOL WINAPI SetVerifyMode( BOOL bVerify ); // Select or deselect the File Size Verification mode ( if size is bad, setup will abort ). #define LANGUAGE_ENGLISH 0 // Language definition ( use French or English ) #define LANGUAGE_FRENCH 1 // ... #define LANGUAGE_GERMAN 2 // NOT AVAILABLE FOR THIS VERSION !!! #define LANGUAGE_SPANISH 3 // NOT AVAILABLE FOR THIS VERSION !!! extern BOOL WINAPI SetupSetLanguage( UINT cSetupLanguage ); // Choose a language ( french or english ) [NEW] extern BOOL WINAPI ShowMainWindow( HWND hOriginalWnd ); // The main function wich paint your window as a Setup Like window ( for PAINT ) //------------------------------------------------------------------------------------------------------------------------------------------------------------ // 6 - New functions ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //------------------------------------------------------------------------------------------------------------------------------------------------------------ extern void WINAPI CenterDialogBox( HWND m_hWnd ); // Center a dialog box ( take care of its parent window ) extern void WINAPI GiveTheHand( void ); // Give the hand during a long treatment. extern BOOL WINAPI CopyFile( LPCSTR szSrcFile, LPCSTR szDestFile); // Copy a file ( replace ExpandAndCopyFile ) extern BOOL WINAPI IsFileNewer( LPCSTR szFileIn, LPCSTR szFileOut); // TRUE if <szFileIn> is newer than <szFileOut> extern void WINAPI GetBackupName( LPCSTR szFileIn, LPSTR szNewName); // Fill <szNewName> with a not used file name. extern BOOL WINAPI BackupFile( LPCSTR szFileIn ); // Backup a file. extern void WINAPI SetupBrowseDir( HWND hWnd, LPSTR szBuffer ); // Display a browse dialog box [2.4] // VB Functions [2.4] (See corresponding functions for details) ---REMOVED--- //extern void WINAPI VBFormatFileNameValid( LPCSTR szFileNameIn, BOOL bWithFinalSlash, LPSTR szBuffer ); //extern void WINAPI VBGetAbsoluteFileName( LPCSTR szFileName, LPSTR szBuffer ); //extern void WINAPI VBGetPathFromPATH( int iPath, LPSTR szBuffer ); //extern void WINAPI VBGetEnvVariable( LPCSTR szVariableName, LPSTR szBuffer ); //extern void WINAPI VBGetIniString ( LPCSTR szFile, LPCSTR szSection, LPCSTR szKey, LPCSTR szDefault, LPSTR szBuffer ); //extern void WINAPI VBGetWinFileAssociation( LPCSTR szFileExtName, LPSTR szBuffer ); //extern void WINAPI VBGetStringFromFile( LPCSTR szFileName, long lIndex, LPSTR szBuffer ); extern BOOL WINAPI SetupHasWin4Look( void ); // (2.5) // ---------------------- END OF SETUP STUDIO ( CSETUP.DLL ) 2.6 INCLUDE FILE ------------------------------------------------------- #endif #ifdef __cplusplus } #endif