home *** CD-ROM | disk | FTP | other *** search
/ Compatibles PC Magazine 80 / PCMAG.iso / volumm / install / setup.mst < prev    next >
Encoding:
Text File  |  1994-07-18  |  35.3 KB  |  1,012 lines

  1. '**************************************************************************
  2. '*                       INSTALLATION DE VOLUMM4D
  3. '**************************************************************************
  4.  
  5. '' $DEFINE DEBUG  ''Define for script development/debugging
  6.  
  7. '$INCLUDE 'setupapi.inc'
  8. '$INCLUDE 'msdetect.inc'
  9.  
  10. ''Dialog ID's
  11. CONST LOGOVOLUMM        = 1
  12. CONST INSTALLATIONVOL   = 2
  13.  
  14. CONST FIRST             = 10
  15. CONST QUITTER           = 20
  16.  
  17. CONST WELCOME       = 100
  18. CONST ASKQUIT       = 200
  19. CONST DESTPATH      = 300
  20. CONST EXITFAILURE   = 400
  21. CONST EXITQUIT      = 600
  22. CONST EXITSUCCESS   = 700
  23. CONST OPTIONS       = 800
  24. CONST BADPATH       = 6400
  25. CONST LANGUECHOICE  = 5000
  26. CONST LANGUECHOICEHLP  = 5010
  27. CONST INSTALLCHOICE  = 5020
  28. CONST INSTALLCHOICEHLP  = 5030
  29. CONST INSTALLCUSTOM = 6410
  30. CONST INSTALLCUSTOMHLP = 6420
  31. CONST HELPWELCOME   = 1000
  32. CONST VERPATH       = 1100
  33. CONST EXITFAILNOTWIN31 = 1200
  34. CONST EXITFAILNOTENH = 1300
  35. CONST EXITFAILNOTPAGING = 1325
  36. CONST EXITFAILNOTINTEL = 1350
  37. CONST FREECELLINST  = 1400
  38. CONST FREECELLINSTNOWIN32S = 1450
  39. CONST FREECELLPATH  = 1500
  40. CONST HELPFREECELL  = 1600
  41. CONST WANTOVERVIEW  = 7000
  42.  
  43.  
  44. ''Bitmap ID
  45. CONST LOGO = 1
  46.  
  47. GLOBAL DESTSYS$      ''Windows\System directory.
  48. GLOBAL DEST32S$      ''Windows\System\Win32s directory
  49. GLOBAL DESTVOLUMM$     ''Freecell directory
  50.  
  51. GLOBAL FONTES$
  52. GLOBAL MAPPING$
  53. GLOBAL IMAGES$
  54. GLOBAL LBM$
  55. GLOBAL MAQUETTES$
  56.  
  57. GLOBAL TYPEWIN$
  58. GLOBAL REPINI$
  59. GLOBAL REP$
  60. GLOBAL REPOK$
  61. GLOBAL DEMOPATH$
  62. GLOBAL LANGUE
  63. GLOBAL BC$
  64. DECLARE SUB Install
  65. DECLARE SUB UpdateSystemIni
  66. DECLARE SUB RebootSystem
  67. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  68. DECLARE FUNCTION TestCheckBox (BoxNum%) AS STRING
  69. DECLARE FUNCTION GetV4DPath (reset%) AS STRING
  70. DECLARE FUNCTION CustomInst (Path$, Win32Size%) AS STRING
  71. DECLARE FUNCTION MakeSystemIni LIB "INIUPD.DLL" (arg1$, arg2$) AS INTEGER
  72. DECLARE FUNCTION RestartWindows LIB "INIUPD.DLL" AS INTEGER
  73. DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER
  74. DECLARE FUNCTION PagingEnabled LIB "INIUPD.DLL" AS INTEGER
  75. DECLARE FUNCTION ShareEnabled LIB "INIUPD.DLL" AS INTEGER
  76. DECLARE FUNCTION IsWin32sLoaded LIB "INIUPD.DLL" (arg1$) AS INTEGER
  77. DECLARE FUNCTION ExitWindowsExec LIB "USER.EXE" (arg1$, arg2$) AS INTEGER
  78. DECLARE FUNCTION WinExec LIB "kernel" (szCmd$,cbBuf%) AS INTEGER
  79.  
  80. INIT:
  81.  
  82.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  83.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  84.     szOldVer$ ="1.00.000     "          ''Reserve space in string for version
  85.     WIN32ENABLED% = 0
  86.     GLOBAL AlwaysCopy%
  87.     AlwaysCopy% = 0
  88.     GLOBAL MiniInstall%
  89.     GLOBAL CDInstall%
  90.     GLOBAL ReqSpace
  91.     MiniInstall%=0
  92.     CDInstall%=1
  93.     ReqSpace=13500000
  94.     LANGUE=0
  95.     ON ERROR GOTO ERRNORMAL
  96.  
  97.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  98.  
  99.     SetBitmap CUIDLL$, INSTALLATIONVOL
  100.      sz$ = UIStartDlg(CUIDLL$, LANGUECHOICE, "FRadioDlgProc", LANGUECHOICEHLP, HELPPROC$)
  101.      BC$=GetSymbolValue("ButtonChecked")
  102.      UIPop 1
  103.      IF BC$="2" THEN
  104.          LANGUE=1
  105.     ELSE
  106.         LANGUE=0
  107.     ENDIF
  108.     IF LANGUE=0 THEN
  109.         SetTitle "Win32s and VOLUMM4D 3.0 Installation"
  110.     ELSE
  111.         SetTitle "Installation de Win32s et VOLUMM4D 3.0"
  112.     ENDIF
  113.     OVERVIEW:
  114.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  115.     DEMOPATH$ = MID$(SrcDir$, 1, 1)
  116.     DEMOPATH$ = DEMOPATH$ + ":\VOLUMM\VOLUMM4D\"
  117.  
  118.     sz$ = UIStartDlg(CUIDLL$, WANTOVERVIEW+LANGUE, "FInfoDlgProc", HELPWELCOME+LANGUE, HELPPROC$)
  119.     IF sz$ = "CONTINUE" THEN
  120.         UIPop 1
  121.     ELSEIF sz$ = "BACK" THEN
  122.         truc%=WinExec(DEMOPATH$+"SCRNCAMP /SC "+DEMOPATH$+"OVERVIEW.SCM",5)
  123.          GOTO OVERVIEW
  124.      ELSE
  125.         GOSUB ASKQUIT
  126.          GOTO OVERVIEW
  127.     END IF
  128. '    IF LANGUE=0 THEN
  129. '        i%=DoMsgBox("If you have a sound card, you can assist to a multimedia presentation of VOLUMM4D, before proceeding with the installation", "VOLUMM4D 3.0 Installation", 1+MB_TASKMODAL)
  130. '    ELSE
  131. '        i%=DoMsgBox("Si vous Ωtes ΘquipΘ d'une carte son, vous pouvez assister α une prΘsentation de VOLUMM4D avant de proceder α l'installation", "VOLUMM4D 3.0 Installation", 1+MB_TASKMODAL)
  132. '    ENDIF
  133. '    if i%=1    THEN
  134. '        SrcDir$ = GetSymbolValue("STF_SRCDIR")
  135. '        DEMOPATH$ = MID$(SrcDir$, 1, 1)
  136. '        DEMOPATH$ = DEMOPATH$ + ":\VOLUMM\VOLUMM4D\"
  137. '        truc%=WinExec(DEMOPATH$+"SCRNCAMP /SC "+DEMOPATH$+"OVERVIEW.SCM",5)
  138. '        IF LANGUE=0 THEN
  139. '            i%=DoMsgBox("Do you want to start the installation ?", "VOLUMM4D 3.0 Installation", 1+MB_TASKMODAL)
  140. '        ELSE
  141. '            i%=DoMsgBox("Voulez vous dΘmarrer l'installation ?", "VOLUMM4D 3.0 Installation", 1+MB_TASKMODAL)
  142. '        ENDIF
  143. '        IF i%<>1 THEN
  144. '            ExitCode% = EXITFAILURE
  145. '            GOTO QUIT
  146. '        ENDIF
  147. '    ENDIF
  148.  
  149.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  150.     IF szInf$ = "" THEN
  151.     szInf$ = GetSymbolValue("STF_CWDDIR") + "setup.inf"
  152.     END IF
  153.     ReadInfFile szInf$
  154.  
  155.     IF MiniInstall%=1 THEN
  156.         ReqSpace=6000000
  157.         END IF          
  158.     DESTSYS$ = GetWindowsSysDir()
  159.     DEST32S$ = DESTSYS + "WIN32S\"
  160. WELCOMEFIRST:
  161.     sz$ = UIStartDlg(CUIDLL$, FIRST+LANGUE, "FInfoDlgProc", HELPWELCOME+LANGUE, HELPPROC$)
  162.     IF sz$ = "CONTINUE" THEN
  163.     UIPop 1
  164.     ELSE
  165.     GOSUB ASKQUIT
  166.     GOTO WELCOMEFIRST
  167.     END IF
  168.  
  169. '$IFDEF DEBUG
  170.     i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  171.     WinDrive$ = MID$(GetWindowsDir, 1, 1)
  172.     IF IsDriveValid(WinDrive$) = 0 THEN
  173.          IF LANGUE=0 THEN
  174.             i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  175.         ELSE
  176.             i% = DoMsgBox("Le lecteur Windows ('"+WinDrive$+"') n'est pas un lecteur valide.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  177.         ENDIF
  178.     GOTO QUIT
  179.     END IF
  180. '$ENDIF ''DEBUG
  181.  
  182. CHECK:
  183.     IF GetWindowsMajorVersion < 3 THEN
  184.     ExitCode% = EXITFAILNOTWIN31
  185.     GOTO QUIT
  186.     END IF
  187.     IF GetWindowsMajorVersion = 3 AND GetWindowsMinorVersion < 1 THEN
  188.     ExitCode% = EXITFAILNOTWIN31
  189.     GOTO QUIT
  190.     END IF
  191.     IF GetWindowsMajorVersion >= 4 THEN
  192.     ExitCode% = EXITSUCCESS
  193.     WIN32ENABLED% = 1
  194.     GOTO FREECELL
  195.     END IF
  196.     IF GetWindowsMode < 2  THEN
  197.     IF OnWindowsNT() THEN
  198.        ExitCode% = EXITFAILNOTINTEL '' Running on Windows NT (on RISC)
  199.     ELSE
  200.        ExitCode% = EXITFAILNOTENH   '' Standard Mode Windows
  201.     END IF
  202.     GOTO QUIT
  203.     END IF
  204.     IF OnWindowsNT() THEN
  205.     ExitCode% = EXITSUCCESS
  206.     WIN32ENABLED% = 1
  207.     GOTO FREECELL
  208.     END IF
  209.     ExitCode% = EXITSUCCESS
  210.  
  211.     '' Get version of Win32s to be installed from version info in file
  212.     szNewVer$ = GetVersionOfFile( GetSymbolValue("STF_SRCDIR") + "WIN32S16.DLL" )
  213.  
  214.     '' Check if Win32s is partially installed
  215.     sz$ = GetIniKeyString (DESTSYS$ + "WIN32S.INI", "Win32s", "Setup")
  216.     '' If WIN32S.INI specifies Setup=0, then force complete Win32s file overwrite
  217.     IF sz$ = "0" THEN
  218.     AlwaysCopy% = 1
  219.     GOTO WELCOME
  220.     END IF
  221.     '' If WIN32S.INI is missing, try and reinstall Win32s files/recreate WIN32S.INI
  222.     IF sz$ <> "1" THEN
  223.     GOTO WELCOME
  224.     END IF
  225.  
  226.     '' If Win32s is already installed, get running version number
  227.     i% = DoesFileExist( DESTSYS$ + "W32SYS.DLL", femExists )
  228.     IF i% = 1 THEN
  229.     i% = IsWin32sLoaded( szOldVer$ )
  230.     END IF
  231.  
  232.     IF i% = 0 THEN
  233.     GOTO WELCOME
  234.     END IF
  235.     IF szNewVer$ > szOldVer$ THEN
  236.     GOTO WELCOME
  237.     END IF
  238.     WIN32ENABLED% = 1
  239.     GOTO FREECELL
  240.  
  241. WELCOME:
  242. ''    sz$ = UIStartDlg(CUIDLL$, FIRST+LANGUE, "FInfoDlgProc", HELPWELCOME+LANGUE, HELPPROC$)
  243. ''    IF sz$ = "CONTINUE" THEN
  244. ''    UIPop 1
  245. ''    ELSE
  246. ''    GOSUB ASKQUIT
  247. ''    GOTO WELCOME
  248. ''    END IF
  249.  
  250.  
  251. GETWIN32SPATH:
  252.     IF PagingEnabled() = 0 THEN
  253.         IF LANGUE=0 THEN
  254.             i% = DoMsgBox("Use the Control Panel 386 Enhanced icon and configure Windows using the Virtual Memory option.", "Win32s requires Virtual Memory", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  255.         ELSE
  256.             i% = DoMsgBox("Utilisez l'icone 386 Θtendu du Panneau de controle et configurez Windows avec l'option mΘmoire virtuelle.", "Win32s ne peut fonctionner sans MΘmoire virtuelle", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  257.         ENDIF
  258.     ExitCode% = EXITFAILURE '' Enhanced mode but not paging
  259.     GOTO QUIT
  260.     END IF
  261.  
  262.     IF ShareEnabled() = 0 THEN
  263.          IF LANGUE=0 THEN
  264.             i%=DoMsgBox("Exit Windows, add SHARE.EXE to your AUTOEXEC.BAT file and reeboot your PC, then restart SETUP.","Win32s installation : SHARE.EXE required", MB_TASKMODAL+MB_ICONEXCLAMATION+MB_OK)
  265.         ELSE
  266.             i%=DoMsgBox("Quittez Windows, ajoutez SHARE.EXE α votre fichier AUTOEXEC.BAT et rΘinitialisez votre PC, puis relancez SETUP.","Installation de Win32s: chargement de SHARE.EXE obligatoire", MB_TASKMODAL+MB_ICONEXCLAMATION+MB_OK)
  267.         ENDIF
  268. ExitCode% = EXITFAILURE '' Pas de share.Exe
  269.     GOTO QUIT
  270.    
  271.     END IF
  272.  
  273.     SetSymbolValue "EditTextIn", DESTSYS$
  274.     SetSymbolValue "EditFocus", "END"
  275.  
  276. GETPATHL1:
  277.     sz$ = UIStartDlg(CUIDLL$, VERPATH+LANGUE, "FDispDlgProc", HELPWELCOME+LANGUE, HELPPROC$)
  278.  
  279.     IF sz$ = "CONTINUE" THEN
  280.     IF IsDirWritable(DESTSYS$) = 0 THEN
  281.         GOSUB BADPATH
  282.         GOTO GETPATHL1
  283.     END IF
  284.     UIPop 1
  285.     ELSEIF sz$ = "REACTIVATE" THEN
  286.     GOTO GETPATHL1
  287.     ELSEIF sz$ = "BACK" THEN
  288.     UIPop 1
  289.     GOTO WELCOME
  290.     ELSE
  291.     GOSUB ASKQUIT
  292.     GOTO GETPATHL1
  293.     END IF
  294.  
  295. COPYFILES:
  296.     CreateIniKeyValue DESTSYS$ + "WIN32S.INI", "Win32s", "Setup", "0", cmoOverwrite
  297.  
  298.     '' Indicate Win32s install failure until all files known to be copied.
  299.     ExitCode% = EXITFAILURE
  300.     ERR = 0
  301.     CreateDir DEST32S$, cmoNone
  302.     Install
  303.     UpdateSystemIni
  304.     '' Terminate if unhandled fatal error
  305.     IF ERR <> 0 THEN
  306.     GOTO QUIT
  307.     END IF
  308.  
  309.     CreateIniKeyValue DESTSYS$ + "WIN32S.INI", "Win32s", "Setup", "1", cmoOverwrite
  310.     CreateIniKeyValue DESTSYS$ + "WIN32S.INI", "Win32s", "Version", szNewVer$, cmoOverwrite
  311.     CreateIniKeyValue DESTSYS$ + "WIN32S.INI", "Nls", "AnsiCP", "1252", cmoOverwrite
  312.     IF LANGUE=0 THEN
  313.        i% = DoMsgBox("Win32s Files fully installed.", "Microsoft Win32s Installation", MB_OK+MB_TASKMODAL)
  314.     ELSE
  315.         i% = DoMsgBox("Fichiers de Win32s entiΦrement installΘs.", "Installation de Microsoft Win32s", MB_OK+MB_TASKMODAL)
  316.     ENDIF
  317.     '' Indicate Win32s correctly copied and installed.
  318.     ExitCode% = EXITSUCCESS
  319.  
  320. FREECELL:
  321.     oldcopymode=SetCopyMode (1)
  322.      ''Ne pas oublier de tester la fonction GetCopyListCost
  323.      DESTVOLUMM$ = MID$(DESTSYS$,1,3) + "WIN32APP\VOLUMM4D\"
  324.      sz$ = UIStartDlg(CUIDLL$, INSTALLCHOICE+LANGUE, "FRadioDlgProc", INSTALLCHOICEHLP+LANGUE, HELPPROC$)
  325.      BC$=GetSymbolValue("ButtonChecked")
  326.      UIPop 1
  327.      IF BC$="2" THEN
  328.          MiniInstall%=1
  329.         CDInstall%=1
  330.         ReqSpace=1000000
  331.      ELSE
  332.         MiniInstall%=0
  333.         CDInstall%=0
  334.         ReqSpace=7000000
  335.      ENDIF
  336. ResetV4DPath=0
  337. GETFREEPATH:
  338. '    SetSymbolValue "EditTextIn", DESTVOLUMM$
  339. '    SetSymbolValue "EditFocus", "END"
  340. ResetV4DPath=1
  341. GETFREEPATHL1:
  342. sz$=GetV4DPath(1)
  343. ResetV4DPath=0
  344. if sz$="EXIT" then
  345.     goto QUIT
  346.     ENDIF
  347. GOTO COPYFREECELL
  348. '    sz$ = UIStartDlg(CUIDLL$, FREECELLPATH+LANGUE, "FEditDlgProc", HELPFREECELL+LANGUE, HELPPROC$)
  349.  
  350. '    IF sz$ = "CONTINUE" THEN
  351. '    DESTVOLUMM$ = GetSymbolValue("EditTextOut")
  352.     
  353. '    IF MID$(DESTVOLUMM$, LEN(DESTVOLUMM$), 1) <> "\" THEN
  354. '        DESTVOLUMM$ = DESTVOLUMM$ + "\"
  355. '    END IF
  356.     ''Validate new path.
  357. '    IF IsDirWritable(DESTVOLUMM$) = 0 THEN
  358. '        GOSUB BADPATH
  359. '        GOTO GETFREEPATHL1
  360. '    END IF
  361. '    UIPop 1
  362.  
  363. '    GOTO COPYFREECELL
  364.  '   ELSEIF sz$ = "REACTIVATE" THEN
  365. '    GOTO GETFREEPATHL1
  366.  '   ELSEIF sz$ = "EXIT" THEN
  367. '    UIPop 1
  368. '    GOTO QUIT
  369. '    END IF
  370.  
  371. COPYFREECELL:
  372.         if MiniInstall=2 then
  373.             TOTO$=CustomInst(DESTVOLUMM$,0)
  374.             IF TOTO$ = "EXIT" THEN
  375.                 GOTO QUIT
  376.             ELSEIF TOTO$="BACK" THEN
  377.                 GOTO GETFREEPATHL1
  378.             ENDIF
  379.         ENDIF
  380.  
  381.     FONTES$ = DESTVOLUMM$ + "FONTS\"
  382.     LBM$ = DESTVOLUMM$ + "LBM\"
  383.      IMAGES$ = DESTVOLUMM$ + "IMAGES\"
  384.      MAPPING$ = DESTVOLUMM$ + "MAPPINGS\"
  385.     MAQUETTES$ = DESTVOLUMM$ + "MODELS\"
  386.     ClearCopyList
  387.     CreateDir DESTVOLUMM$, cmoNone
  388.      CreateDir IMAGES$, cmoNone
  389.      CreateDir MAPPING$, cmoNone
  390.      CreateDir MAQUETTES$, cmoNone
  391.  
  392.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  393.  
  394.     ERR = 0
  395. '     IF TestCheckBox(1)="ON" THEN
  396.      IF MiniInstall%= 0 THEN
  397.         AddSectionFilesToCopyList "IMAGESVITAL", SrcDir$, DESTVOLUMM$
  398.         AddSectionFilesToCopyList "PROGRAMMES", SrcDir$, DESTVOLUMM$
  399.         AddSectionFilesToCopyList "HELP", SrcDir$, DESTVOLUMM$
  400.         AddSectionFilesToCopyList "MODELS", SrcDir$, MAQUETTES$
  401.         IF LANGUE=0 THEN
  402.             AddSectionFilesToCopyList "PROGENG", SrcDir$, DESTVOLUMM$
  403.         ELSE
  404.             AddSectionFilesToCopyList "PROGFRA", SrcDir$, DESTVOLUMM$
  405.         ENDIF
  406.     ELSEIF MiniInstall%=1 THEN
  407.             AddSectionFilesToCopyList "IMAGESVITAL", SrcDir$, DESTVOLUMM$
  408.     ELSEIF MiniInstall% = 2 THEN 'Custom Installation
  409.         IF GetListItem("CheckItemsState",2)= "ON"    THEN
  410.             AddSectionFilesToCopyList "LeatherMapp", SrcDir$, MAPPING$+"LEATHER\"
  411.             AddSectionFilesToCopyList "MAPROUGH", SrcDir$, MAPPING$+"ROUGH\"
  412. '            AddSectionFilesToCopyList "MappList", SrcDir$, MAPPING$
  413.             AddSectionFilesToCopyList "MAPSKY", SrcDir$, MAPPING$+"SKY\"
  414.             AddSectionFilesToCopyList "TilesMapp", SrcDir$, MAPPING$+"TILES\"
  415.             AddSectionFilesToCopyList "MAPWALL", SrcDir$, MAPPING$+"WALL\"
  416.             AddSectionFilesToCopyList "MAPWOOD", SrcDir$, MAPPING$+"WOOD\"
  417.             AddSectionFilesToCopyList "MAPWATER", SrcDir$, MAPPING$+"WATER\"
  418.             AddSectionFilesToCopyList "MAPMARBLE", SrcDir$, MAPPING$+"MARBLE\"
  419.             AddSectionFilesToCopyList "MAPFIRE", SrcDir$, MAPPING$+"FIRE\"
  420.             AddSectionFilesToCopyList "MAPSTONE", SrcDir$, MAPPING$+"STONE\"
  421.             AddSectionFilesToCopyList "MAPVARIED", SrcDir$, MAPPING$+"VARIED\"
  422.             AddSectionFilesToCopyList "MAPFILTER", SrcDir$, MAPPING$+"FILTER\"
  423.             ENDIF
  424.         IF GetListItem("CheckItemsState",3)= "ON"    THEN
  425.             AddSectionFilesToCopyList "MODELS", SrcDir$, MAQUETTES$
  426.             ENDIF
  427.         IF GetListItem("CheckItemsState",4)= "ON"    THEN
  428.             AddSectionFilesToCopyList "IMAGES", SrcDir$, IMAGES$            
  429.             ENDIF
  430.         IF GetListItem("CheckItemsState",5)= "ON"    THEN
  431.             AddSectionFilesToCopyList "IMAGESL", SrcDir$, IMAGES$
  432.             ENDIF
  433.         IF GetListItem("CheckItemsState",6)= "ON"    THEN
  434.             AddSectionFilesToCopyList "ANIMS", SrcDir$, DESTVOLUMM$ + "ANIMS\"
  435.             ENDIF
  436.     END IF
  437.     ERR = 0
  438.  
  439.     DstDrvLtr$=MID$(DESTVOLUMM$, 1, 1)
  440.     NumDstDrv=ASC(DstDrvLtr$)-ASC("A")+1
  441.     ReqSpace=GetCopyListCost("EXTRA","COST","NEEDED")
  442.     ReqSpace=VAL(GetListItem("COST",NumDstDrv))
  443.  
  444.     DriveSpace=GetFreeSpaceForDrive(DstDrvLtr$)
  445.     IF  DriveSpace < ReqSpace THEN
  446.         IF LANGUE=0 THEN
  447.             MsgDrvSpace$=" There is only "+STR$(DriveSpace)+" bytes free on the "+DstDrvLtr$+" drive :"+STR$(ReqSpace)+" bytes are required."
  448.         ELSE
  449.             MsgDrvSpace$="Il y a seulement "+STR$(DriveSpace)+" octets libres sur "+DstDrvLtr$+":"+STR$(ReqSpace)+" octets sont nΘcessaires."
  450.         ENDIF
  451.         i%=DoMsgBox(MsgDrvSpace$, "VOLUMM4D 3.0 Installation", MB_OK+MB_TASKMODAL)
  452.         GOTO GETFREEPATHL1
  453.         END IF
  454.  
  455.    CopyFilesInCopyList
  456.     
  457.     '' If error copying FreeCell, not a fatal error. Win32s is already installed.
  458.    IF ERR <> 0 THEN
  459.     ERR = 0
  460.     GOTO QUIT
  461.     END IF
  462.     ERR = 0
  463.      IF (MiniInstall%=1) THEN
  464.          EXEPATH$=SrcDir$
  465.         EXEPATH$ = MID$(SrcDir$, 1, 1)
  466.         EXEPATH$ = EXEPATH$ + ":\VOLUMM\VOLUMM4D\"
  467.     ELSE
  468.         EXEPATH$=DESTVOLUMM$
  469.     ENDIF
  470.     'IF (MiniInstall% = 1) OR (MiniInstall% = 0 AND GetListItem("CheckItemsState",1)= "ON") THEN
  471.     IF TestCheckBox(1)="ON" THEN
  472.         CreateProgmanGroup "VOLUMM4D", "", cmoNone
  473.        ShowProgmanGroup   "VOLUMM4D", 1, cmoNone
  474.        CreateProgmanItem  "VOLUMM4D", "Modeler", EXEPATH$ + "MODELER.EXE", "", cmoOverwrite
  475.        CreateProgmanItem  "VOLUMM4D", "Renderer", EXEPATH$ + "V2.EXE", "", cmoOverwrite
  476.         CreateProgmanItem  "VOLUMM4D", "Player", EXEPATH$ + "VPLAY.EXE", "", cmoOverwrite
  477.         IF LANGUE=0 THEN
  478.             CreateProgmanItem  "VOLUMM4D", "Tutorial", EXEPATH$ + "TUTORENG.HLP", "", cmoOverwrite
  479.            CreateProgmanItem  "VOLUMM4D", "Modeler Documentation", EXEPATH$ + "ANV1.HLP", "", cmoOverwrite
  480.             CreateProgmanItem  "VOLUMM4D", "Renderer Documentation", EXEPATH$ + "V2ENG.HLP", "", cmoOverwrite
  481.             CreateProgmanItem  "VOLUMM4D", "Player Documentation", EXEPATH$ + "VPENG.HLP", "", cmoOverwrite
  482.         ELSE
  483.             CreateProgmanItem  "VOLUMM4D", "Guide utilisateur", EXEPATH$ + "TUTORFRA.HLP", "", cmoOverwrite
  484.             CreateProgmanItem  "VOLUMM4D", "Documentation Modeler", EXEPATH$ + "FRV1.HLP", "", cmoOverwrite
  485.             CreateProgmanItem  "VOLUMM4D", "Documentation Renderer", EXEPATH$ + "V2FRA.HLP", "", cmoOverwrite
  486.             CreateProgmanItem  "VOLUMM4D", "Documentation Player", EXEPATH$ + "VPFRA.HLP", "", cmoOverwrite
  487.         ENDIF
  488.          DEMOPATH$=SrcDir$
  489.         DEMOPATH$ = MID$(SrcDir$, 1, 1)
  490.         DEMOPATH$ = DEMOPATH$ + ":\VOLUMM\VOLUMM4D\"
  491.         IF LANGUE=0 THEN
  492.             CreateProgmanItem  "VOLUMM4D", "VOLUMM4D Overview", DEMOPATH$+"SCRNCAMP.EXE /SC "+DEMOPATH$+"OVERVIEW.SCM", "", cmoOverwrite
  493.             CreateProgmanItem  "VOLUMM4D", "Visualize functions", DEMOPATH$+"SCRNCAMP.EXE /SC "+DEMOPATH$+"VISUAL.SCM", "", cmoOverwrite
  494.             CreateProgmanItem  "VOLUMM4D", "Modelize functions", DEMOPATH$+"SCRNCAMP.EXE /SC "+DEMOPATH$+"MODEL.SCM", "", cmoOverwrite
  495.             CreateProgmanItem  "VOLUMM4D", "Material functions", DEMOPATH$+"SCRNCAMP.EXE /SC "+DEMOPATH$+"MATIERE.SCM", "", cmoOverwrite
  496.             CreateProgmanItem  "VOLUMM4D", "Animation functions", DEMOPATH$+"SCRNCAMP.EXE /SC "+DEMOPATH$+"anim.SCM", "", cmoOverwrite
  497.             CreateProgmanItem  "VOLUMM4D", "Content", DESTVOLUMM$+"CDROM.WRI", "", cmoOverwrite
  498.             CreateProgmanItem  "VOLUMM4D", "Purchase Order", DESTVOLUMM$+"COMMANDE.WRI", "", cmoOverwrite
  499.         ELSE
  500.             CreateProgmanItem  "VOLUMM4D", "PrΘsentation GΘnΘrale", DEMOPATH$+"SCRNCAMP.EXE /SC "+DEMOPATH$+"OVERVIEW.SCM", "", cmoOverwrite
  501.             CreateProgmanItem  "VOLUMM4D", "Fonctions Visualisation", DEMOPATH$+"SCRNCAMP.EXE /SC "+DEMOPATH$+"VISUAL.SCM", "", cmoOverwrite
  502.             CreateProgmanItem  "VOLUMM4D", "Fonctions Modelisation", DEMOPATH$+"SCRNCAMP.EXE /SC "+DEMOPATH$+"MODEL.SCM", "", cmoOverwrite
  503.             CreateProgmanItem  "VOLUMM4D", "DΘfinition des materiaux", DEMOPATH$+"SCRNCAMP.EXE /SC "+DEMOPATH$+"MATIERE.SCM", "", cmoOverwrite
  504.             CreateProgmanItem  "VOLUMM4D", "Fonctions Animation", DEMOPATH$+"SCRNCAMP.EXE /SC "+DEMOPATH$+"anim.SCM", "", cmoOverwrite
  505.             CreateProgmanItem  "VOLUMM4D", "Contenu", DESTVOLUMM$+"CDROM.WRI", "", cmoOverwrite
  506.             CreateProgmanItem  "VOLUMM4D", "Bon de Commande", DESTVOLUMM$+"COMMANDE.WRI", "", cmoOverwrite
  507.         ENDIF
  508.         REPINI$ = GetWindowsDir()
  509.  
  510.         REP$=MID$(DESTVOLUMM$,LEN(DESTVOLUMM$),1)
  511.         IF REP$="\" THEN
  512.             REPOK$=MID$(DESTVOLUMM$,1,LEN(DESTVOLUMM$)-1)
  513.         ELSE
  514.             REPOK$=DESTVOLUMM$
  515.         END IF
  516.         REPINI$=MakePath(REPINI$,"VOLUMM4D.INI")
  517.     
  518.         CreateIniKeyValue REPINI$, "VOLUMM4D", "CHEMIN_DATA", REPOK$, cmoOverwrite
  519.         'Si pas MiniInstall EXEPATH$ et DESTVOLUMM$ identiques
  520.         'Sinon EXEPATH$ pointe sur le CD ROM
  521.         REP$=MID$(EXEPATH$,LEN(EXEPATH$),1)
  522.        IF REP$="\" THEN
  523.             REPOK$=MID$(EXEPATH$,1,LEN(EXEPATH$)-1)
  524.        ELSE
  525.             REPOK$=EXEPATH$
  526.        END IF
  527.         CreateIniKeyValue REPINI$, "VOLUMM4D", "CHEMIN", REPOK$, cmoOverwrite
  528.         CreateIniKeyValue REPINI$, "VOLUMM4D", "VERSION","3.1.01", cmoOverwrite
  529.         CreateIniKeyValue REPINI$, "VOLUMM4D", "DBUF","5000", cmoOverwrite
  530.         IF (LANGUE=0) THEN
  531.             CreateIniKeyValue REPINI$, "VOLUMM4D", "LANGUE","ENG", cmoOverwrite
  532.         ELSE
  533.             CreateIniKeyValue REPINI$, "VOLUMM4D", "LANGUE","FRA", cmoOverwrite
  534.         ENDIF
  535.        CreateIniKeyValue REPINI$, "V1_ENV", "MainWindow", "633 1 0 479", cmoOverwrite
  536.         CreateIniKeyValue REPINI$, "V1_ENV", "NbWin", "1", cmoOverwrite
  537.        CreateIniKeyValue REPINI$, "WIN_1", "PH", "0", cmoOverwrite
  538.         CreateIniKeyValue REPINI$, "WIN_1", "TH", "0", cmoOverwrite
  539.         CreateIniKeyValue REPINI$, "WIN_1", "ZOOM", "1000", cmoOverwrite
  540.         CreateIniKeyValue REPINI$, "WIN_1", "PERS", "2000", cmoOverwrite
  541.         CreateIniKeyValue REPINI$, "WIN_1", "CIBLE", "0.000000 0.000000 0.000000", cmoOverwrite
  542.     
  543.         CreateIniKeyValue REPINI$, "V2_ENV", "MainWindow", "528 498 404 641", cmoOverwrite
  544.         CreateIniKeyValue REPINI$, "V2_ENV", "REDIM_WINDOW", "1", cmoOverwrite
  545.         CreateIniKeyValue REPINI$, "V2_ENV", "LOUPE_WINDOW", "1", cmoOverwrite
  546.         CreateIniKeyValue REPINI$, "V2_ENV", "SAVE_OPTS_ON_QUIT", "1", cmoOverwrite
  547.         CreateIniKeyValue REPINI$, "V2_ENV", "RECAPITULATIF", "1", cmoOverwrite
  548.         CreateIniKeyValue REPINI$, "V2_ENV", "MAX_OCTREE_DEPTH", "4", cmoOverwrite
  549.         CreateIniKeyValue REPINI$, "V2_ENV", "OCTREE_MAX_NODE_ELEM", "8", cmoOverwrite
  550.         CreateIniKeyValue REPINI$, "V2_ENV", "MAX_ANTIALIAS_DEPTH", "3", cmoOverwrite
  551.         CreateIniKeyValue REPINI$, "V2_ENV", "DITHER256", "0", cmoOverwrite
  552.         CreateIniKeyValue REPINI$, "V2_ENV", "LAST_RPJ", "DEFAULT", cmoOverwrite
  553.  
  554.        CreateIniKeyValue REPINI$, "VPLAY_ENV", "MainWindow", "334 46 180 217", cmoOverwrite
  555.         CreateIniKeyValue REPINI$, "VPLAY_ENV", "DITHER256", "0", cmoOverwrite
  556.     ENDIF
  557.     '' Only put up success dialog if icon added to group
  558.     'truc%=WinExec("WRITE "+DEMOPATH$+"cdrom.wri",5)
  559. IF ERR = 0 THEN
  560.      IF LANGUE=0 THEN
  561.          i% = DoMsgBox("VOLUMM4D 3.0 installation done.", "VOLUMM4D 3.0 Installation", MB_OK+MB_TASKMODAL)
  562.     ELSE
  563.         i% = DoMsgBox("Installation de VOLUMM4D 3.0 terminΘe.", "VOLUMM4D 3.0 Installation", MB_OK+MB_TASKMODAL)
  564.     ENDIF
  565.       ExitCode% = 700
  566.     IF Has87MathChip() = 0 THEN
  567.         PrType%=GetProcessorType()
  568.         IF LANGUE=0 THEN
  569.             MsgProc$="without a mathematic coprocessor. For best usage of  VOLUMM4D we suggest that you add a "
  570.             IF PrType=3 THEN
  571.                 MsgProc$="Your PC have a 386 processor type "+MsgProc$+" 387 coprocessor."
  572.             ELSEIF PrType=4 THEN
  573.                     MsgProc$="Your PC have a 486 SX processor type "+MsgProc$+" 487 coprocessor or a DX2 overdrive."
  574.                     ELSE
  575.                         MsgProc$="Your PC have a processor "+MsgProc$+" coprocessor."
  576.             END IF
  577.             i% = DoMsgBox(MsgProc$, "VOLUMM4D 3.0 Installation", MB_OK+MB_TASKMODAL)
  578.         ELSE
  579.             MsgProc$="sans coprocesseur mathΘmatique.Pour que vous tiriez au mieux parti de VOLUMM4D nous vous recommandons d'y adjoindre un "
  580.             IF PrType=3 THEN
  581.                 MsgProc$="Votre PC est equipΘ d'un processeur de type 386 "+MsgProc$+" coprocesseur 387."
  582.             ELSEIF PrType=4 THEN
  583.                     MsgProc$="Votre PC est equipΘ d'un processeur de type 486 SX "+MsgProc$+" coprocesseur 487 ou un overdrive DX2."
  584.                     ELSE
  585.                         MsgProc$="Votre PC est equipΘ d'un processeur "+MsgProc$+" coprocesseur."
  586.             END IF
  587.             i% = DoMsgBox(MsgProc$, "Installation de VOLUMM4D 3.0", MB_OK+MB_TASKMODAL)
  588.         END IF
  589.     END IF
  590. END IF
  591.  
  592. QUIT:
  593.     '' Install error handler for final message box routines
  594.     ON ERROR GOTO ERRQUIT
  595.     IF ERR = 0 THEN
  596.     dlg% = ExitCode%
  597.     ELSEIF ERR = STFQUIT THEN
  598.     dlg% = EXITQUIT
  599.     ExitCode% = EXITQUIT
  600.     ELSE
  601.     dlg% = EXITFAILURE
  602.     ExitCode% = EXITQUIT
  603.     END IF
  604.  
  605. QUITL1:
  606.     IF WIN32ENABLED% = 1 THEN
  607.     UIPop 1
  608.     END
  609.     END IF
  610.  
  611.     sz$ = UIStartDlg(CUIDLL$, dlg%+LANGUE, "FInfo0DlgProc", 0, "")
  612.     IF sz$ = "REACTIVATE" THEN
  613.     GOTO QUITL1
  614.     END IF
  615.     UIPop 1
  616.  
  617.     IF ExitCode% = EXITSUCCESS THEN
  618.     RebootSystem
  619.     CreateIniKeyValue DESTSYS$ + "WIN32S.INI", "Win32s", "Setup", "0", cmoOverwrite
  620.     IF LANGUE=0 THEN
  621.         i% = DoMsgBox("Win32s is not properly configured and Win32s Setup must be run again.", "Unable to Restart Windows", MB_ICONEXCLAMATION+MB_OK+MB_TASKMODAL)
  622.     ELSE
  623.         i% = DoMsgBox("Win32s n'est pas configurΘ correctement L'installation doit Ωtre relancΘe.", "Impossible de rΘinitialiser Windows", MB_ICONEXCLAMATION+MB_OK+MB_TASKMODAL)
  624.     ENDIF
  625.     END IF
  626.  
  627.     END
  628.  
  629. '' Fatal error handler for error message routine
  630. ERRQUIT:
  631.     IF LANGUE=0 THEN
  632.         i% = DoMsgBox("Setup sources were corrupted!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  633.      ELSE
  634.          i% = DoMsgBox("Les fichiers sources sont corrompu!", "Message Setup", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  635.      ENDIF
  636.     END
  637.  
  638. '' Bypass run-time errors. Let final dialog box display fatal error message.
  639. ERRNORMAL:
  640.     '' Check if user cancelled setup
  641.     IF ERR = STFQUIT THEN
  642.     GOTO QUIT
  643.     END IF
  644.     RESUME NEXT
  645.  
  646.  
  647. BADPATH:
  648.     sz$ = UIStartDlg(CUIDLL$, BADPATH+LANGUE, "FInfo0DlgProc", 0, "")
  649.     IF sz$ = "REACTIVATE" THEN
  650.     GOTO BADPATH
  651.     END IF
  652.     UIPop 1
  653.     RETURN
  654.  
  655.   ASKQUIT:
  656.     sz$ = UIStartDlg(CUIDLL$, QUITTER+LANGUE, "FQuitDlgProc", 0, "")
  657.  
  658.     IF sz$ = "EXIT" THEN
  659.     UIPopAll
  660.     ERROR STFQUIT
  661.     ELSEIF sz$ = "REACTIVATE" THEN
  662.     GOTO ASKQUIT
  663.     ELSE
  664.     UIPop 1
  665.     END IF
  666.     RETURN
  667.  
  668.  
  669.  
  670. '**
  671. '** Purpose:
  672. '**     Builds the copy list and performs all installation operations.
  673. '** Arguments:
  674. '**     none.
  675. '** Returns:
  676. '**     none.
  677. '*************************************************************************
  678. SUB Install STATIC
  679.  
  680.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  681.  
  682.     '' Check if overwrite required.
  683.     IF AlwaysCopy% = 1 THEN
  684.     '' Use file layout sections that specify ALWAYS overwrite files
  685.     AddSectionFilesToCopyList "_WindowsSystem", SrcDir$, DESTSYS$
  686.     AddSectionFilesToCopyList "_WindowsSystemWin32s", SrcDir$, DESTSYS$ + "WIN32S\"
  687.     ELSE
  688.     '' Use file layout sections that specify OLDER file version/time check
  689.     AddSectionFilesToCopyList "WindowsSystem", SrcDir$, DESTSYS$
  690.     AddSectionFilesToCopyList "WindowsSystemWin32s", SrcDir$, DESTSYS$ + "WIN32S\"
  691.     END IF
  692.     SetRestartDir GetWindowsDir()
  693.  
  694.     CopyFilesInCopyList
  695.  
  696. END SUB
  697.  
  698. SUB UpdateSystemIni STATIC
  699.  
  700.     VxDPath$ = DEST32S$ + "W32S.386"
  701.     SystemIniPath$ = GetWindowsDir()
  702.  
  703.     t% = MakeSystemIni(SystemIniPath$, VxdPath$)
  704.  
  705. END SUB
  706.  
  707. SUB RebootSystem STATIC
  708.  
  709. '   Check if any files were locked during install.  If the RestartList
  710. '   is not empty, ExitExecRestart() will restart Windows, cleanup setup
  711. '   files, and copy over locked files before Windows restarts.
  712.     i% = RestartListEmpty()
  713.     IF i% = 0 THEN
  714. '      ExitExecRestart() only returns if applications refuse to be shutdown.
  715. '      Win32s is installed but will not operate until Windows is restarted
  716. '      and the Win32s VxD is loaded.
  717.        i% = ExitExecRestart()
  718.      ELSE
  719. '      If the RestartList list is empty, it is necessary to restart windows
  720. '      directly.  The MSSETUP program creates _MSRSTRT.EXE and _MSSETUP.BAT
  721. '      in the restart directory.  This program should be exec'd to handle
  722. '      proper MSSETUP cleanup (temp files) and restart Windows.
  723.        i% = ExitWindowsExec( GetWindowsDir() + "_MSRSTRT.EXE", "_MSSETUP.BAT" )
  724.      ENDIF
  725.  
  726. END SUB
  727.  
  728.  
  729. '**
  730. '** Purpose:
  731. '**     Appends a file name to the end of a directory path,
  732. '**     inserting a backslash character as needed.
  733. '** Arguments:
  734. '**     szDir$  - full directory path (with optional ending "\")
  735. '**     szFile$ - filename to append to directory
  736. '** Returns:
  737. '**     Resulting fully qualified path name.
  738. '*************************************************************************
  739. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  740.     IF szDir$ = "" THEN
  741.     MakePath = szFile$
  742.     ELSEIF szFile$ = "" THEN
  743.     MakePath = szDir$
  744.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  745.     MakePath = szDir$ + szFile$
  746.     ELSE
  747.     MakePath = szDir$ + "\" + szFile$
  748.     END IF
  749. END FUNCTION
  750.  
  751. '**
  752. '** Purpose:
  753. '**     Displays the custom installation dialog box
  754. '** Arguments:
  755. '**     szDir$  - full directory path (with optional ending "\")
  756. '**     szFile$ - filename to append to directory
  757. '** Returns:
  758. '**     Resulting fully qualified path name.
  759. '*************************************************************************
  760. FUNCTION CustomInst (Path$, Win32Size%) STATIC AS STRING
  761. SrcDir$ = GetSymbolValue("STF_SRCDIR")
  762.  
  763. IF LANGUE=0 THEN
  764.     KBFREE$=" Kb Free"    
  765.     KBNEEDED$=" Kb Needed"
  766. ELSE
  767.     KBFREE$=" Ko Libres"    
  768.     KBNEEDED$=" Ko NΘcessaires"
  769. ENDIF
  770. IMAGES$ = Path$ + "IMAGES\"
  771. MAPPING$ = Path$ + "MAPPINGS\"
  772. MAQUETTES$ = Path$ + "MODELS\"
  773. SetSymbolValue "StatusItemsText", ""
  774. SetSymbolValue "CheckItemsState", ""
  775. SetSymbolValue "DriveStatusText", ""
  776.  
  777. DstDrvLtr$=MID$(Path$, 1, 1)
  778. DriveSpace=GetFreeSpaceForDrive(DstDrvLtr$)
  779. NumDstDrv=ASC(DstDrvLtr$)-ASC("A")+1
  780. Win32sCost&=0
  781. if Win32Size%=1 THEN
  782.     WinDrive$ = MID$(GetWindowsDir, 1, 1)    
  783.     NumWinDrv=ASC(WinDrive$)-ASC("A")+1
  784.     ClearCopyList 'Win32S
  785.     AddSectionFilesToCopyList "_WindowsSystem", SrcDir$, DESTSYS$
  786.     AddSectionFilesToCopyList "_WindowsSystemWin32s", SrcDir$, DESTSYS$ + "WIN32S\"
  787.     Win32sCost&=GetCopyListCost("EXTRA","COST","NEEDED")
  788.     Win32sCost&=VAL(GetListItem("COST",NumWinDrv))
  789.     if WinDrive$<>DstDrvLtr$ THEN
  790.         WinDriveSpace=GetFreeSpaceForDrive(WinDrive$)    
  791.     ELSE
  792.         WinDriveSpace=-1
  793.     ENDIF
  794. ELSE
  795.     WinDriveSpace=-1    
  796. ENDIF
  797.  
  798. ClearCopyList 'vital file always installed
  799. AddSectionFilesToCopyList "IMAGESVITAL", SrcDir$, DESTVOLUMM$
  800. AddSectionFilesToCopyList "PROGRAMMES", SrcDir$, DESTVOLUMM$
  801. AddSectionFilesToCopyList "HELP", SrcDir$, DESTVOLUMM$
  802. IF LANGUE=0 THEN
  803.     AddSectionFilesToCopyList "PROGENG", SrcDir$, DESTVOLUMM$
  804. ELSE
  805.     AddSectionFilesToCopyList "PROGFRA", SrcDir$, DESTVOLUMM$
  806. ENDIF
  807. VitalCost&=GetCopyListCost("EXTRA","COST","NEEDED")
  808. VitalCost&=VAL(GetListItem("COST",NumDstDrv))
  809. AddListItem "StatusItemsText", STR$(VitalCost&/1024)+KBNEEDED$
  810.  
  811. ClearCopyList  'mappings
  812. AddSectionFilesToCopyList "LeatherMapp", SrcDir$, MAPPING$+"LEATHER\"
  813. AddSectionFilesToCopyList "MAPROUGH", SrcDir$, MAPPING$+"ROUGH\"
  814. 'AddSectionFilesToCopyList "MappList", SrcDir$, MAPPING$
  815. AddSectionFilesToCopyList "MAPSKY", SrcDir$, MAPPING$+"SKY\"
  816. AddSectionFilesToCopyList "TilesMapp", SrcDir$, MAPPING$+"TILES\"
  817. AddSectionFilesToCopyList "MAPWALL", SrcDir$, MAPPING$+"WALL\"
  818. AddSectionFilesToCopyList "MAPWOOD", SrcDir$, MAPPING$+"WOOD\"
  819. AddSectionFilesToCopyList "MAPWATER", SrcDir$, MAPPING$+"WATER\"
  820. AddSectionFilesToCopyList "MAPMARBLE", SrcDir$, MAPPING$+"MARBLE\"
  821. AddSectionFilesToCopyList "MAPFIRE", SrcDir$, MAPPING$+"FIRE\"
  822. AddSectionFilesToCopyList "MAPSTONE", SrcDir$, MAPPING$+"STONE\"
  823. AddSectionFilesToCopyList "MAPVARIED", SrcDir$, MAPPING$+"VARIED\"
  824. AddSectionFilesToCopyList "MAPFILTER", SrcDir$, MAPPING$+"FILTER\"
  825. MappCost&=GetCopyListCost("EXTRA","COST","NEEDED")
  826. MappCost&=VAL(GetListItem("COST",NumDstDrv))
  827. AddListItem "StatusItemsText", STR$(MappCost&/1024)+KBNEEDED$
  828.  
  829. ClearCopyList      'models
  830. AddSectionFilesToCopyList "MODELS", SrcDir$, MAQUETTES$
  831. ModelCost&=GetCopyListCost("EXTRA","COST","NEEDED")
  832. ModelCost&=VAL(GetListItem("COST",NumDstDrv))
  833. AddListItem "StatusItemsText", STR$(ModelCost&/1024)+KBNEEDED$
  834.  
  835. ClearCopyList 'small images
  836. AddSectionFilesToCopyList "IMAGES", SrcDir$, IMAGES$
  837. ImagesCost&=GetCopyListCost("EXTRA","COST","NEEDED")
  838. ImagesCost&=VAL(GetListItem("COST",NumDstDrv))
  839. AddListItem "StatusItemsText",STR$(ImagesCost&/1024)+KBNEEDED$
  840.  
  841. ClearCopyList 'large images
  842. AddSectionFilesToCopyList "IMAGESL", SrcDir$, IMAGES$
  843. ImagesLCost&=GetCopyListCost("EXTRA","COST","NEEDED")
  844. ImagesLCost&=VAL(GetListItem("COST",NumDstDrv))
  845. AddListItem "StatusItemsText", STR$(ImagesLCost&/1024)+KBNEEDED$
  846.  
  847. 'les HELP SONT INSTALLES SYSTEMATIQUEMENT
  848. 'ClearCopyList      'help files
  849. 'AddSectionFilesToCopyList "HELP", SrcDir$, Path$
  850. 'HelpCost&=GetCopyListCost("EXTRA","COST","NEEDED")
  851. 'HelpCost&=VAL(GetListItem("COST",NumDstDrv))
  852. 'AddListItem "StatusItemsText", "Needs "+STR$(HelpCost&/1024)+" Kb."
  853.  
  854.  
  855. ClearCopyList 'anims
  856. AddSectionFilesToCopyList "ANIMS", SrcDir$, Path$ + "ANIMS\"
  857. AnimCost&=GetCopyListCost("EXTRA","COST","NEEDED")
  858. AnimCost&=VAL(GetListItem("COST",NumDstDrv))
  859. AddListItem "StatusItemsText", STR$(AnimCost&/1024)+KBNEEDED$
  860.  
  861.     AddListItem "CheckItemsState", "ON" ''Executables et doc
  862.    AddListItem "CheckItemsState", "ON" ''mappings
  863.     AddListItem "CheckItemsState", "ON" ''models files
  864.     AddListItem "CheckItemsState", "ON" ''small images
  865.     AddListItem "CheckItemsState", "OFF" ''large images
  866.     AddListItem "CheckItemsState", "OFF" ''animation
  867.     IF LANGUE=0 THEN
  868.           AddListItem "DriveStatusText", "Install Drive: ["+DstDrvLtr$+":]"
  869.     ELSE
  870.         AddListItem "DriveStatusText", "Destination: ["+DstDrvLtr$+":]"
  871.     ENDIF
  872.     AddListItem "DriveStatusText", "6 Mb needed"
  873.     AddListItem "DriveStatusText", STR$(DriveSpace/1024)+KBFREE$
  874.  
  875.     IF WinDriveSpace=-1 OR Win32Size%=0 THEN
  876.         AddListItem "DriveStatusText", ""
  877.         AddListItem "DriveStatusText", ""
  878.         AddListItem "DriveStatusText", ""
  879.     ELSE
  880.         AddListItem "DriveStatusText", "Windows Drive ["+WinDrive$+":]"
  881.         AddListItem "DriveStatusText", STR$(Win32sCost&/1024)+KBNEEDED$
  882.         AddListItem "DriveStatusText", STR$(WinDriveSpace/1024)+KBFREE$
  883.     ENDIF
  884.     AddListItem "DriveStatusText", Path$
  885.     CustomInst="OK"
  886.      BOUCLECUSTOM:
  887.     IF WinDrive$<>DstDrvLtr$ THEN
  888.         TotalNeed&=0
  889.     ELSE
  890.         if Win32Size%=1 THEN
  891.             TotalNeed&=Win32sCost& 'Taille de win32s en plus sur le lecteur destination
  892.         ELSE
  893.             TotalNeed&=0
  894.         ENDIF
  895.     ENDIF
  896.     IF GetListItem("CheckItemsState",1)= "ON"    THEN
  897.         TotalNeed&=TotalNeed&+VitalCost&
  898.         ENDIF
  899.     IF GetListItem("CheckItemsState",2)= "ON"    THEN
  900.         TotalNeed&=TotalNeed&+MappCost&
  901.         ENDIF
  902.     IF GetListItem("CheckItemsState",3)= "ON"    THEN
  903.         TotalNeed&=TotalNeed&+ModelCost&
  904.         ENDIF
  905.     IF GetListItem("CheckItemsState",4)= "ON"    THEN
  906.         TotalNeed&=TotalNeed&+ImagesCost&
  907.         ENDIF
  908.     IF GetListItem("CheckItemsState",5)= "ON"    THEN
  909.         TotalNeed&=TotalNeed&+ImagesLCost&
  910.         ENDIF
  911.     IF GetListItem("CheckItemsState",6)= "ON"    THEN
  912.         TotalNeed&=TotalNeed&+AnimCost&
  913.         ENDIF
  914. ReplaceListItem "DriveStatusText", 2, STR$(TotalNeed&/(1024))+KBNEEDED$
  915.      sz$ = UIStartDlg("mscuistf.dll", 6410+LANGUE, "FCustInstDlgProc", 6420+LANGUE, "FHelpDlgProc")
  916.      ''BC$=GetSymbolValue("ButtonChecked")
  917.      IF sz$ <> "CONTINUE" THEN 
  918.          'ReplaceListItem "DriveStatusText", 7,sz$
  919.         IF MID$(sz$,1,3) = "CHK" THEN
  920.             NumCHK%=VAL(MID$(sz$,LEN(sz$),1))
  921.             IF GetListItem("CheckItemsState",NumCHK)= "OFF"    THEN
  922.                 ReplaceListItem "CheckItemsState", NumCHK% ,"ON"
  923.             ELSE
  924.                 ReplaceListItem "CheckItemsState", NumCHK% , "OFF"
  925.             ENDIF
  926.         ELSEIF sz$ = "EXIT" THEN
  927.             CustomInst="EXIT"
  928.             GOTO sortie
  929.         ELSEIF sz$ = "BACK" THEN
  930.               CustomInst="BACK"
  931.             GOTO sortie
  932.         ENDIF
  933.          GOTO BOUCLECUSTOM
  934.         ENDIF
  935.     IF GetListItem("CheckItemsState",1)= "OFF" AND VitalCost&<>0 THEN
  936.         IF LANGUE=0 THEN
  937.             i% = DoMsgBox("If you don't install the executable and help files. You will need the CD in DRIVE to use VOLUMM4D. Is that OK ?","WARNING",MB_TASKMODAL+MB_ICONQUESTION+1)
  938.         ELSE
  939.             i% = DoMsgBox("Si vous n'installer pas les executables. Vous devrez avoir le CD-ROM dans le lecteur pour utiliser VOLUMM4D. Ok ?", "ATTENTION", MB_TASKMODAL+MB_ICONQUESTION+1)
  940.         ENDIF
  941. '        IF LANGUE=0 THEN
  942. '            i% = DoMsgBox("The executable and help files are not installed in this path. Are you sure you want to continue ?","NECESSARY MINIMUM INSTALLATION",MB_TASKMODAL+MB_ICONQUESTION+1)
  943. '        ELSE
  944. '            i% = DoMsgBox("Les programmes et documentations ne sont pas installΘs dans ce repertoire. Etes-vous sur de vouloir continuer ?", "INSTALLATION MINIMUM NECESSAIRE", MB_TASKMODAL+MB_ICONQUESTION+1)
  945. '        ENDIF
  946.         if i%<>1 THEN
  947.             goto BOUCLECUSTOM
  948.             ENDIF
  949.         ENDIF
  950. sortie:
  951. ReqSpace=TotalNeed&
  952. UIPop 1
  953.  
  954. END FUNCTION
  955.  
  956. FUNCTION GetV4DPath (reset%) STATIC AS STRING
  957. if reset=1 then
  958. GETV4DPATH:
  959.     SetSymbolValue "EditTextIn", DESTVOLUMM$
  960.     SetSymbolValue "EditFocus", "END"
  961. endif
  962. GETV4DPATHL1:
  963. sz$ = UIStartDlg("mscuistf.dll", FREECELLPATH+LANGUE, "FEditDlgProc", HELPFREECELL+LANGUE, "FHelpDlgProc")
  964. IF sz$ = "CONTINUE" THEN
  965.     DESTVOLUMM$ = GetSymbolValue("EditTextOut")
  966.     IF MID$(DESTVOLUMM$, LEN(DESTVOLUMM$), 1) <> "\" THEN
  967.         DESTVOLUMM$ = DESTVOLUMM$ + "\"
  968.     END IF
  969.     ''Validate new path.
  970.     IF IsDirWritable(DESTVOLUMM$) = 0 THEN
  971.         GOSUB BADPATH
  972.         GOTO GETV4DPATHL1
  973.     END IF
  974.     UIPop 1
  975.     GetV4DPath=sz$
  976.     RETURN
  977. ELSEIF sz$ = "REACTIVATE" THEN
  978.     GOTO GETV4DPATHL1
  979. ELSEIF sz$ = "EXIT" THEN
  980.     UIPop 1
  981.     GetV4DPath="EXIT"
  982.     RETURN
  983. END IF
  984. goto sortie
  985. BADPATH:
  986.     sz$ = UIStartDlg("mscuistf.dll", 6400+LANGUE, "FInfo0DlgProc", 0, "")
  987.     IF sz$ = "REACTIVATE" THEN
  988.     GOTO BADPATH
  989.     END IF
  990.     UIPop 1
  991.     RETURN
  992. sortie:
  993. END FUNCTION
  994. '**
  995. '** Purpose:
  996. '**     Teste la case α coche BoxNum de la procΘdure personalisΘ
  997. '**     avec support de l'installation minimum pour eviter les erreur d'Item List vide
  998. '** Returns:
  999. '**     ON/OFF.
  1000. '*************************************************************************
  1001. FUNCTION TestCheckBox (BoxNum%) STATIC AS STRING
  1002. IF (MiniInstall% <> 2) THEN
  1003.     IF BoxNum%=1 THEN
  1004.         TestCheckBox="ON"
  1005.     ELSE
  1006.         TestCheckBox="OFF"
  1007.     ENDIF
  1008. ELSE
  1009.     TestCheckBox=GetListItem("CheckItemsState",BoxNum%) 
  1010. ENDIF
  1011. END FUNCTION
  1012.