// File principale della installazione Campo32 declare // Windows API #include "sddialog.h" #include "WINSUB.H" // Dichiarazioni di costanti per questo script #include "DECLARE.RUL" // File di include con gli ID dei dialog usati in questo script #include "PRADIAGS.H" NUMBER nHandle, nResult, nReinstall, nNewInstall; STRING szText, szModifiedPath, szDongle, szInstType,szReinstallPath,szCampoIni; BOOL bSetupStandard, bInstallEnv, bInstallFirm, bInstallDemo, bInstallDemoData, bInstallNetWrkChk; BOOL bInstallData, bInstallPrg, bUseDongleServer, bInstallServer; // Function declarations. prototype _SetupScreen(); prototype _CheckRequirements(); //---------------------------------- NUMBER nDirection; program Step_start: //---------------------------------- defaults bSetupStandard = TRUE; nReinstall = 0; nNewInstall = 0; bInstallPrg = TRUE; bInstallData = FALSE; _ProgramPrologue(); #define SPACE_REQUIRED 120000 // Disk space in bytes. #ifdef __DEMO__ #define APP_NAME "Campo Demo" #define PROGRAM_FOLDER_NAME "Campo Demo" #else #define APP_NAME "Campo" #define PROGRAM_FOLDER_NAME "Campo" #endif #define APPBASE_PATH "\\" #define COMPANY_NAME "A.G.A. Informatica srl" #define PRODUCT_NAME "Campo" #define PRODUCT_VERSION "4.0" #define DEINSTALL_KEY "SampleDeinstKey" #define PRODUCT_KEY "ba0.exe" #define DATATYPE_FILE "datatype." Disable( BACKGROUND ); // Set installation info., which is required for registry entries. InstallationInfo( COMPANY_NAME, PRODUCT_NAME, PRODUCT_VERSION, PRODUCT_KEY ); _SetupScreen(); Enable( DIALOGCACHE ); _CheckRequirements(); Step_welcome: nDirection=0; Disable( BACKBUTTON ); Welcome( "", 0 ); Enable( BACKBUTTON ); Step_setuptype: _SelectSetupType(nDirection); if (nDirection=BACK) then goto Step_welcome; endif ; Step_license: #ifndef __DEMO__ szText=SRCDIR ^ "licenza.txt"; nDirection=SdLicense( "","","",szText); #endif if nDirection=BACK then goto Step_setuptype; endif; Step_chooseinst: _SelectSetupMode(nDirection); if (nDirection=BACK) then goto Step_license; endif; Step_choosewhere: _SelectProgramDestination(nDirection); if (nDirection=BACK) then goto Step_chooseinst; endif; if (nReinstall > 0 && szReinstallPath != "") then bInstallEnv = TRUE; goto Step_installPrg; endif; Step_choosecomp: _SelectWhatToInstall(nDirection); if nDirection=BACK then goto Step_choosewhere; endif; Step_netprg: _SelectNetConfig(nDirection); if (nDirection =BACK) then goto Step_choosecomp; endif; Step_choosewhereD: _SelectDataDestination(nDirection); if nDirection=BACK then goto Step_netprg; endif; Step_choosedata: _SelectDataType(nDirection); if nDirection=BACK then goto Step_choosewhereD; endif; Step_chooseDongleServer: _SelectDongleServer(nDirection); if nDirection=BACK then goto Step_choosedata; endif; Step_whereDongleServer: _FindAutoStartFolder(nDirection); _SelectDongleServerDestination(nDirection); if nDirection=BACK then goto Step_chooseDongleServer; endif; // *********************************** // * installation Step_newORupdate: Step_confirm: _ConfirmInstallation(nDirection); if nDirection=BACK then goto Step_whereDongleServer; endif; Step_installData: _InstallData(nDirection); if (nDirection=BACK) then goto Step_newORupdate; endif; Step_installPrg: _InstallInitialFiles(nDirection); if (nDirection=BACK) then goto Step_newORupdate; endif; Step_installServerAutoStart: _InstallServerAutoStart(nDirection); if (nDirection=BACK) then goto Step_newORupdate; endif; Step_LaunchBa1: ChangeDirectory(szAppPath); _ResetDongleServer(szDongle); LaunchAppAndWait("ba1.exe","-6 -uADMIN",WAIT); _RestoreDongleServer(szDongle); Step_LaunchServer: if bInstallServer then ChangeDirectory(szAppPath ^ "\\servers"); LaunchApp("Lerch.exe", ""); endif; _ProgramEpilogue(); exit; #include "setup1.rul" #include "setup2.rul" #include "setup3.rul" #include "setup4.rul" #include "winsub.rul" #include "sddialog.rul"