// 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, bInstallModules, bInstallEnv, bInstallFirm, bInstallDemo, bInstallDemoData, bInstallNetWrk, bInstallNetWrkChk; BOOL bInstallData, bInstallPrg, bUseDongleServer, bInstallServer, bXPServicesInstalled; // Function declarations. prototype _SetupScreen(); prototype _CheckRequirements(); //---------------------------------- NUMBER nDirection; program Step_start: //---------------------------------- defaults bSetupStandard = TRUE; nReinstall = 0; nNewInstall = 0; bInstallPrg = TRUE; bInstallData = FALSE; bInstNTEutron = FALSE; bInstNTHardlock = FALSE; bCannotExecute = FALSE; bXPServicesInstalled = FALSE; _ProgramPrologue(); #define SPACE_REQUIRED 120000 // Disk space in bytes. #ifdef __DEMO__ #define APP_NAME "OneRed Demo" #define PROGRAM_FOLDER_NAME "OneRed Demo" #else #define APP_NAME "OneRed" #define PROGRAM_FOLDER_NAME "OneRed" #endif #define APPBASE_PATH "\\" #define COMPANY_NAME "A.G.A. Informatica srl" #define PRODUCT_NAME "OneRed" #define PRODUCT_VERSION "2.2 " #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 ; 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_chooseNTDongle: _SelectDongleXP(nDirection); if nDirection=BACK then goto Step_chooseDongleServer; endif; Step_whereDongleServer: _FindAutoStartFolder(nDirection); _SelectDongleServerDestination(nDirection); if nDirection=BACK then goto Step_chooseNTDongle; endif; if nDirection=NEXT then if bInstallNetWrk then goto Step_installnet; endif; endif; // *********************************** // * local installation Step_newORupdate: _AddOrOverwrite(nDirection); if nDirection=BACK then goto Step_whereDongleServer; endif; Step_confirm1: _ConfirmInstallation(nDirection); if nDirection=BACK then goto Step_newORupdate; 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: if bInstallModules then ChangeDirectory(szAppPath); _ResetDongleServer(szDongle); LaunchAppAndWait("ba1.exe","-6 -uADMIN",WAIT); _RestoreDongleServer(szDongle); endif; Step_LaunchServer: if bInstallServer then ChangeDirectory(szAppPath ^ "\\servers"); LaunchApp("Lerch.exe", ""); endif; _ProgramEpilogue(); exit; // *********************************** // * network installation (OneRed WST) Step_installnet: _ConfirmInstallation(nDirection); if nDirection=BACK then goto Step_whereDongleServer; endif; Step_installKeyServices: _InstallDongleXP(nDirection); if nDirection=BACK then goto Step_whereDongleServer; endif; nStep_installData: _InstallData(nDirection); if (nDirection=BACK) then goto Step_whereDongleServer; endif; Step_installwrkst: _NewNetWorkPlace(nDirection); if (nDirection=BACK) then goto Step_whereDongleServer; endif; _ProgramEpilogue(); exit; #include "setup1.rul" #include "setup2.rul" #include "setup3.rul" #include "setup4.rul" #include "winsub.rul" #include "sddialog.rul"