home *** CD-ROM | disk | FTP | other *** search
/ Larousse Encyclopedie de L'Espace et de L'Univers / LirisInteractive-LarousseEncyclopedieEspaceUnivers-French-Win31.iso / dksetup / dksetup.mst < prev    next >
Text File  |  1997-02-18  |  36KB  |  944 lines

  1. '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2. '   DKSETUP.MST     Generic Setup File
  3. '
  4. '   VERSION
  5. '   -------
  6. CONST STR_VERSION = "V 2.10.012"
  7. '
  8. '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  9. 'Change History
  10. '--------------
  11. 'Version    Date        By  Description
  12. '-------    ----        --  -----------
  13. '2.10.012   10/06/96    SB Added code for installing DirectX II...
  14. '2.10.011   04/06/96    SB Fixed Bug with Developer... initalised bscrunged
  15. '2.10.010   23/05/96    SB  Created the Developer Dialog for installing either Scrunged or Text mode
  16. '2.10.009   02/04/96    CR  Re-Organised the groups of system drivers. No longer installs VFW
  17. '                           or the MSADPCM sound drivers on Windows 95.
  18. '2.10.008   10/04/96    CR  Stopped the user from being able to install to A:\.
  19. '                           It caused a crash on Win95.
  20. '2.10.007   03/04/96    CR  Removed the path in the device=dva.386 entry which is
  21. '                           put into system.ini. The Code is in UpdateWingDrivers in
  22. '                           Dkgen.inc. This stops a crash when installing Windows followed by
  23. '                           our product and then Office.
  24. '2.10.006   22/03/96    CR  Change the define WITH_SAMPLER_NOCM to WITH_FULL_SAMPLER.
  25. '                           This now installs the full sampler into the \LAROUSSE\SAMPLER dir.
  26. '2.10.005   14/03/96    CR  Hide the Program Group window while adding the program icons.
  27. '2.10.004   27/02/96    CR  Changed most of the define names to make them more consistent.
  28. '2.10.003   27/02/96    CR  Added the INST_QTW define for installing QuickTime for Windows.
  29. '2.10.002   22/02/96    CR  The Fonts section in setup.inf needs a dummy placeholder
  30. '                           called NOFONT.ZZZ. Fonts are not registered for uninstall.
  31. '2.10.001   20/02/96    CR  Changed the setup files to separate Product Specific,
  32. '                           Localise Only and Generic information.
  33. '
  34. '16/02/96 Made the cursor 'Busy' while creating the program group/items.
  35. '14/02/96 Add the Sampler Icon name to the MMAPP.ini when using WITH_SAMPLER_NOCOM,
  36. '         so that uninstall can delete the Sampler Icon.
  37. '12/02/96 Added option to bundle sampler WITHOUT the Custom Menu.
  38. '25/01/96 Add WITH_ORDERING_INFO and MUSEUM_TITLE defines.
  39. '22/01/96 Fix the dialogs in the TestSystem function in Dkgen.inc.
  40. '15/12/95 Fix the Set Restart Directory problem when installing Win32s
  41. '14/12/95 Only delete files from the previous install if it was in a
  42. '         different directory. Otherwise it deletes the files just installed!
  43. '05/12/95 Reset the default install path when selecting back from the custom
  44. '         install dialog box and clear the copy list.
  45. '04/12/95 Move the mmapp.ini entry updates after the install.
  46. '31/11/95 Check the msacm.ini to make sure the audio compression is enabled.
  47. '29/11/95 Add the line in DKCODE\VERSION.INI to the main ini file. This is only
  48. '         used by the sampler3 product at the moment.
  49. '21/11/95 Can now handle a product + sampler3 bundle disc.
  50. '13/11/95 Add the Setup Version number to the About dialog box in the Setup.
  51. '08/11/95 Use the test for cirrus logic dirvers all of the time, not just
  52. '         when bundled with a sampler.
  53. '03/11/95 Cater for Win32s install and general tidy up of this script file.
  54. '         Unfortunately still need to use comments to select / deselect
  55. '         the specific font code parts.
  56. '18/08/95 rc and this have no min install. Changed dlg boxes custom,
  57. '         custom help and speed
  58. '18/08/95 Register notes most recent lang used
  59. '11/08/95 Register created using inf file
  60. '26/07/95 Uninstall code added
  61. '07/07/95 Correct dkgen.inc so unregisters use of ctl3d
  62. '04/07/95 Make sure files in bin section of inf file 'always' overwrite
  63. '28/07/95 Ini file not created for minimum install, uses file provided in dkcode
  64. '27/06/95 Test for directory names max 8 chars
  65. '26/06/95 For minimum install, ini file is now not installed
  66. '19/06/95 Moved test for cirrus drivers to mst file as only applies to sampler
  67. '05/06/95 Fonts installed on users machine
  68. '01/06/95 No choice about adding icon to prog man, altered dkgen.inc & rc file
  69. '            (custom, customhelp & speed dlg boxes need changing)
  70. '22/05/95 Code for bundling with sampler
  71. '22/05/95 Large readme need Write (will need to change dlg box in rc file)
  72. '15/05/95 No warning that directory does not exist
  73. '03/05/95 Ini file put in executable directory rather than Windows dir to stop
  74. '            clash with foreign products with same name files
  75. '
  76. '------------------------------------------------------------------------------
  77. '
  78. ' All of the defines which are used to control the flow of Setup are listed here.
  79. '
  80. 'SCRUNGED_OR_TEXT              Product will run in scrunge mode not test mode.
  81. '                                                   If not defined then assumes scrunged.
  82. '                       The ini file is different.
  83. ' WITH_UNINSTALL        Installs Uninstall with the product.
  84. ' WITH_ORDERING_INFO    Installs Ordering Information with the product.
  85. ' WITH_SAMPLER          Installs the Sampler with the product.
  86. '                       This sampler goes into the product directory.
  87. '                       This sampler has a Custom Menu.
  88. ' WITH_FULL_SAMPLER     Installs the full Sampler with the product.
  89. '                       This sampler goes into the sampler directory \LAROUSSE\SAMPLER.
  90. '                       This sampler has its own icon and can be uninstalled separately.
  91. '                       The sampler files are listed in the SAMPBIN section of setup.inf.
  92. ' NEEDS_MUSEUM_LIFT     Installs the museum lift. (DKSWTCH.EXE)
  93. ' NEEDS_WIN32S          Installs Win32s.
  94. ' NEEDS_WING            Installs WinG.
  95. ' NEEDS_QTW             Installs QuickTime for Windows using Apple's own installer.
  96. ' NEEDS_VFW             Installs Video for Windows.
  97. ' NEEDS_SOUND           Installs ADPCM sound drivers.
  98. '
  99. '------------------------------------------------------------------------------
  100. ''$DEFINE DEBUG
  101. '$INCLUDE 'dkgen.inc'
  102. '
  103.  
  104. '$IFDEF NEEDS_WIN32S
  105.     ' Include extra Win32s specific routines
  106.     '$INCLUDE 'win32s.inc'
  107. '$ENDIF
  108.  
  109. DECLARE SUB CreateReg()
  110. DECLARE SUB Install()
  111. DECLARE SUB AddFilesToCopyList(szInstallType$)
  112. DECLARE SUB UpdateFonts()
  113. DECLARE FUNCTION IsCDROMDrive LIB "dkutils.dll" (wDrive%) As INTEGER
  114. DECLARE FUNCTION DeleteFiles LIB "dkutils.dll" (szDiffPath$, szProdName$, szDKREgIni$) AS INTEGER
  115. DECLARE FUNCTION DeleteDir LIB "dkutils.dll" (szDiffPath$) AS INTEGER
  116. DECLARE FUNCTION DeleteSection LIB "dkutils.dll" (szProdName$, szDKREgIni$) AS INTEGER
  117. DECLARE FUNCTION TestForCirrus LIB "dkutils.dll" () As INTEGER
  118. DECLARE FUNCTION GetCdVolumeLabel LIB "dkutils.dll" ( szCdVolumeLabel$, szCdDrive$ ) As INTEGER
  119. DECLARE FUNCTION InstallFont LIB "dkutils.dll" (szFont$) AS INTEGER
  120.  
  121.  
  122. Init:
  123.    Initialise STR_PRODUCTNAME, DEFAULT_INSTALL_PATH, STR_MSGCAPTION
  124.  
  125. WelcomeDlg:
  126.     if Welcome() = NAV_BACK then
  127.         ' Don nothing - cant go back
  128.     end if
  129.  
  130.     if TestSystem() = NAV_BACK then
  131.         goto WelcomeDlg
  132.     end if
  133.  
  134.  
  135.     '+++
  136.     '$IFDEF NEEDS_WIN32S
  137.  
  138.         if bInstalledWin32s = 0 then
  139.             goto InstallWin32s
  140.         endif
  141.  
  142.         FinishedWin32s:
  143.     '$ENDIF
  144.     '---
  145.  
  146.     '+++
  147.     '$IFDEF NEEDS_QTW
  148.  
  149.         ret% = InstallQTW()     ' Install QuickTime for Windows
  150.     '$ENDIF
  151.     '---
  152.  
  153.     '   TestCirrus:
  154.     if TestForCirrus() = 1 then
  155.         dButton = DoMsgBox(STR_CIRRUS, szMsgCaption$, MB_OK+MB_TASKMODAL+MB_ICONINFORMATION)
  156.     end if
  157.  
  158.  
  159.     '$IFDEF NEEDS_SOUND
  160.         ' Update the Sound driver ini entries
  161.         if UpdateADPCMDrivers() = NAV_BACK then
  162.             goto WelcomeDlg
  163.         end if
  164.     '$ENDIF
  165.  
  166. ' The Developer Dialogue stuff...
  167. '$IFDEF SCRUNGED_OR_TEXT
  168. beginDevelopDiag:
  169.     szButton = UIStartDlg(CUIDLL_FILENAME, DLG_DEVELOPER, "FQuitDlgProc", 0, "")
  170.     select case szButton
  171.     case "REACTIVATE"
  172.         goto beginDevelopDiag
  173.     case "EXIT" , "CANCEL"
  174.         bscrunged=0 ' Text Mode
  175.         UIPop 1
  176.     case "CONTINUE"
  177.         bscrunged=1 ' Scrunge Mode
  178.         UIPop 1
  179.     end select
  180. '$ELSE
  181.     bscrunged=1
  182. '$ENDIF
  183.  
  184. ExpressCustomDlg:
  185.     ' defaults to Express
  186.     'if szExpressCustomChoice = "EXPRESS" then
  187.     '    SetSymbolValue "RadioDefault", "1"
  188.     'else
  189.     '    SetSymbolValue "RadioDefault", "1"
  190.     'end if
  191.  
  192. ECDlgLoop:
  193.     szButton = UIStartDlg(CUIDLL_FILENAME, DLG_SPEED, "FRadioDlgProc", DLG_WHIZZHELP, PROC_HELP)
  194.  
  195.     select case szButton
  196.     case "REACTIVATE"
  197.         goto ECDlgLoop
  198.     case "BACK"
  199.         UIPop 1
  200.         goto WelcomeDlg
  201.     case "CONTINUE" ' Install
  202.         UIPop 1
  203.         if GetSymbolValue("ButtonChecked") = "1" then
  204.             szExpressCustomChoice = "EXPRESS"
  205.             goto ExpressInstallLoop
  206.         else
  207.             szExpressCustomChoice = "CUSTOM"
  208.             goto CustomInstallLoop
  209.         end if
  210.     case "EXIT" , "CANCEL"
  211.         AskQuit
  212.         goto ECDlgLoop
  213.     end select
  214.  
  215.  
  216. CustomInstallLoop:
  217. GetPathDlg:
  218.     SetSymbolValue "EditTextIn", szDestPath
  219.     szOldDestPath = szWinDrive + ":" + DEFAULT_INSTALL_PATH
  220.     SetSymbolValue "EditFocus", "ALL"
  221.  
  222. GetPathDlgLoop:
  223.     szButton = UIStartDlg(CUIDLL_FILENAME, DLG_DESTPATH, "FEditDlgProc", DLG_PATHHELP, PROC_HELP)
  224.  
  225.     select case szButton
  226.     case "REACTIVATE"
  227.         goto GetPathDlgLoop
  228.  
  229.     case "BACK"
  230.         UIPop 1
  231.         szDestPath = szOldDestPath
  232.         ClearCopyList
  233.         goto ECDlgLoop
  234.  
  235.     case "CONTINUE"
  236.         UIPop 1
  237.         szDestPath = GetSymbolValue("EditTextOut")
  238.  
  239.         ' Add backslash if missing
  240.         if mid$(szDestPath, 2, 1) = ":" and mid$(szDestPath, 3, 1) <> "\" then
  241.             szTemp$ = mid$(szDestPath, 1, 2) + "\" + mid$(szDestPath, 3, len(szDestPath)-2)
  242.             szDestPath = szTemp
  243.         end if
  244.  
  245.         ' Add drive letter and :\ if missing
  246.         if mid$(szDestPath, 2, 1) <> ":" then
  247.             if mid$(szDestPath, 1,1) <> "\" then
  248.                 szDestPath = mid$(szWinPath, 1,1) + ":\" + szDestPath
  249.             else
  250.                 szDestPath = mid$(szWinPath, 1,1) + ":" + szDestPath
  251.             end if
  252.         elseif IsDriveValid(mid$(szDestPath, 1,1)) = 0 then
  253.             szDestPath = szOldDestPath
  254.             UIPop 1
  255.             BadPath
  256.             goto GetPathDlg
  257.         end if
  258.  
  259.         slength% = len(szDestPath)
  260.  
  261.         'Check dir names not > 8 chars
  262.         dirlength% = 0
  263.         i% = 3
  264.         while i% <> slength%
  265.             i% =i%+1
  266.             dirlength% = dirlength% +1
  267.             if mid$(szDestPath, i%, 1)="\" then
  268.                 if dirlength% > 9 then
  269.                     szDestPath = szOldDestPath
  270.                     dButton = DoMsgBox( STR_DIRTOOLONG, STR_MSGCAPTION, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  271.                     goto GetPathDlg
  272.                  else
  273.                     dirlength% = 0
  274.                 endif
  275.             end if
  276.         wend
  277.         if dirlength% > 8 then
  278.             szDestPath = szOldDestPath
  279.             dButton = DoMsgBox( STR_DIRTOOLONG, STR_MSGCAPTION, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  280.             goto GetPathDlg
  281.         endif
  282.  
  283.  
  284.         ' check for "foreign" chars in path
  285.         found% = 0
  286.         for i% = 1 to slength%
  287.             if asc(mid$(szDestPath, i%, 1)) > 126 then
  288.                 found% = 1
  289.             end if
  290.         next i%
  291.         if found% = 1 then
  292.             szDestPath = szOldDestPath
  293.             UIPop 1
  294.             BadPath
  295.             goto GetPathDlg
  296.         end if
  297.  
  298.         wDrive% = asc(mid$(szDestPath, 1,1)) - asc("A")
  299.         if IsCDROMDrive(wDrive%) > 0 then
  300.             szDestPath = szOldDestPath
  301.             UIPop 1
  302.             BadPath
  303.             goto GetPathDlg
  304.         end if
  305.  
  306.         if IsDriveNetwork(mid$(szDestPath,1,1)) = 1 then
  307.             szDestPath = szOldDestPath
  308.             UIPop 1
  309.             NetworkDrive
  310.             goto GetPathDlg
  311.         end if
  312.  
  313.         ' Put in to avoid a:\ crash below
  314.         if mid$(szDestPath,1,3) = "A:\" then
  315.             szDestPath = szOldDestPath
  316.             UIPop 1
  317.             BadPath
  318.             goto GetPathDlg
  319.         end if
  320.  
  321.         ' IsDirWritable() Crashes on Win95 if looking at A:\ with no disk in!
  322.         if IsDirWritable(szDestPath) = 0 then
  323.             szDestPath = szOldDestPath
  324.             UIPop 1
  325.             BadPath
  326.             goto GetPathDlg
  327.         end if
  328.  
  329.  
  330.   '      if DoesDirExist(szDestPath) = 0 then
  331.   '          dButton = DoMsgBox( STR_DIRNOTEXIST, STR_MSGCAPTION, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  332.   '          if dButton = 7 then
  333.   '              goto GetPathDlg
  334.   '          end if
  335.   '      end if
  336.  
  337.         UIPop 1
  338.  
  339.     case "EXIT" , "CANCEL"
  340.         AskQuit
  341.         goto GetPathDlg
  342.     end select
  343.  
  344. GetCustomChoicesDlg:
  345.     SetSymbolValue "CheckItemsState", ""
  346. '    AddListItem "CheckItemsState", szMinimalInstall
  347. '    AddListItem "CheckItemsState", szAddPMItem
  348. GetCustomChoicesLoop:
  349.  
  350.     ClearCopyList
  351. '    if szMinimalInstall = "OFF" then
  352.         AddFilesToCopyList "FULL"
  353. '    else
  354. '        AddFilesToCopyList "MINIMAL"
  355. '    end if
  356.  
  357.     dDestDrive = asc(mid$(szDestPath, 1,1)) - asc("A")+1
  358.     dWinDrive = asc(mid$(szWinPath, 1,1)) - asc("A")+1
  359.  
  360.     SetSymbolValue "DriveStatusText", ""
  361.     AddListItem "DriveStatusText", mid$(szDestPath, 1,1) + ":"
  362.     AddListItem "DriveStatusText", str$(GetDiskSpaceNeeded(dDestDrive) / 1024) + " K"
  363.     AddListItem "DriveStatusText", str$(GetFreeSpaceForDrive(mid$(szDestPath, 1,1))/1024) + " K"
  364.  
  365.     if dDestDrive = dWinDrive then
  366.         AddListItem "DriveStatusText", ""
  367.         AddListItem "DriveStatusText", ""
  368.         AddListItem "DriveStatusText", ""
  369.     else
  370.         AddListItem "DriveStatusText", mid$(szWinPath, 1,1) + ":"
  371.         AddListItem "DriveStatusText", str$(GetDiskSpaceNeeded(dWinDrive)/ 1024 ) + " K"
  372.         AddListItem "DriveStatusText", str$(GetFreeSpaceForDrive(mid$(szWinPath, 1,1))/1024) + " K"
  373.     end if
  374.  
  375.     AddListItem "DriveStatusText", szDestPath
  376.  
  377. ChooseInstall:
  378.  
  379.     szButton = UIStartDlg(CUIDLL_FILENAME, DLG_CUSTOM, "FCustInstDlgProc", DLG_CUSTOMHELP, PROC_HELP)
  380.  
  381. '    szMinimalInstall = GetListItem("CheckItemsState", 1)
  382. '    szAddPMItem = GetListItem("CheckItemsState", 2)
  383.  
  384.     select case szButton
  385.     case "REACTIVATE"
  386.         goto GetCustomChoicesLoop
  387.     case "BACK"
  388.         UIPop 1
  389.         goto GetPathDlg
  390.     case "CONTINUE"
  391.         UIPop 1
  392.     case "EXIT" , "CANCEL"
  393.         AskQuit
  394.         goto GetCustomChoicesLoop
  395.     end select
  396.  
  397.     ClearCopyList
  398. '    if szMinimalInstall = "OFF" then
  399.         AddFilesToCopyList "FULL"
  400. '    else
  401. '        AddFilesToCopyList "MINIMAL"
  402. '    end if
  403.     goto CommonInstallLoop
  404.  
  405. ExpressInstallLoop:
  406.     AddFilesToCopyList "FULL"
  407.     goto CommonInstallLoop
  408.  
  409. CommonInstallLoop:
  410.     InitCommonInstall
  411.  
  412.     if szMinimalInstall = "ON" and GetFreeSpaceForDrive(mid$(szDestPath,1,1)) < MINIMUM_DISK_SPACE then
  413.         error ERR_NODISKSPACE
  414.     elseif GetFreeSpaceForDrive(mid$(szDestPath,1,1)) < GetDiskSpaceNeeded( asc(mid$(szDestPath, 1,1))-asc("A")+1 ) then
  415.         error ERR_NODISKSPACE
  416.     end if
  417.  
  418.     '+++
  419.     '$IFDEF NEEDS_WING
  420.  
  421.         UpdateWinGDrivers
  422.     '$ENDIF
  423.     '---
  424.  
  425.     '+++
  426.     '$IFDEF NEEDS_VFW
  427.  
  428.         ' Don't need to install VFW on Windows 95, it is already there.
  429.         if not OS_Windows95 then
  430.  
  431.             UpdateIndeoAVIDrivers
  432.         end if
  433.  
  434.     '$ENDIF
  435.     '---
  436.  
  437.     UpdateFonts ' Installs specific fonts
  438.  
  439.     Install     ' Installs all of the necessary files.
  440.  
  441.     dCursor = ShowWaitCursor()
  442.  
  443.     ' Always create the DK Registry and enter the details
  444.     CreateIniKeyValue "Win.ini", "MMAPP", WIN_INI_ENTRY, szWinDrive+":"+DKREG_INI_PATH, cmoOverwrite
  445.     CreateReg
  446.  
  447.     ' Get the current window handle for setting its properties later
  448.     hwndSetup = GetActiveWindow
  449.  
  450.     CreateProgmanGroup STR_COMPANYNAME, "", cmoNone
  451.     ShowProgmanGroup   STR_COMPANYNAME, 1, cmoNone
  452.  
  453.     ' Set the main window properties to bring the main window to the front.
  454.     ' This is so the user cannot start the app now, but will see the prog group after setup!
  455.     i% = SetWindowPos(hwndSetup, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE+SWP_NOMOVE)
  456.  
  457.  
  458. '+++
  459. '$IFDEF WITH_SAMPLER
  460.  
  461. '    if szMinimalInstall = "ON" then
  462. '        szSamplerPath$ = MakePath( mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1), SAMPLER_PATH)
  463. '        szSamplerPath$ = MakePath(szSamplerPath$, SAMPLER_EXE_FILE)
  464. '        szInf$ = MakePath(szSrcBinPath, APPLICATION_MENU_FILE) + " " + MakePath(szSrcBinPath, APPLICATION_EXE_FILE) + " " + MakePath(szSrcBinPath, APPLICATION_PENGE_FILE) + " " + szSamplerPath$
  465. '        CreateProgmanItem STR_COMPANYNAME, STR_PRODUCTNAME, szInf, szInf, cmoOverwrite
  466. '        CreateProgmanItem STR_COMPANYNAME, STR_README, EDITOR_EXE + MakePath(szSrcBinPath, APPLICATION_README_FILE), "", cmoOverwrite
  467. '    else
  468.         szSamplerPath$ = MakePath(szDestPath, SAMPLER_EXE_FILE)
  469.         szInf$ = MakePath(szDestPath, APPLICATION_MENU_FILE) + " " + MakePath(szDestPath, APPLICATION_EXE_FILE) + " " + MakePath(szDestPath, APPLICATION_PENGE_FILE) + " " + szSamplerPath$
  470.         CreateProgmanItem STR_COMPANYNAME, STR_PRODUCTNAME, szInf, szInf, cmoOverwrite
  471.         CreateProgmanItem STR_COMPANYNAME, STR_README, EDITOR_EXE + MakePath(szDestPath, APPLICATION_README_FILE), "", cmoOverwrite
  472.         '$IFDEF WITH_ORDERING_INFO
  473.         CreateProgmanItem STR_COMPANYNAME, STR_ORDER, EDITOR_EXE + MakePath(szWinDrive + ":" + DKREG_INI_DIR, ORDER_FILE), "", cmoOverwrite
  474.         '$ENDIF
  475. '    end if
  476.  
  477. '$ELSE
  478.     'NO SAMPLER
  479. '    if szMinimalInstall = "ON" then
  480. '        szInf$ = MakePath(szSrcBinPath, APPLICATION_EXE_FILE) + " " + MakePath(szSrcBinPath, "dkpage")'APPLICATION_PENGE_FILE)
  481. '        CreateProgmanItem STR_COMPANYNAME, STR_PRODUCTNAME, szInf, szInf, cmoOverwrite
  482. '        CreateProgmanItem STR_COMPANYNAME, STR_README, EDITOR_EXE + MakePath(szSrcBinPath, APPLICATION_README_FILE), "", cmoOverwrite
  483. '    else
  484.         szInf$ = MakePath(szDestPath, APPLICATION_EXE_FILE) + " " + MakePath(szDestPath, "dkpage")'APPLICATION_PENGE_FILE)
  485.         CreateProgmanItem STR_COMPANYNAME, STR_PRODUCTNAME, szInf, szInf, cmoOverwrite
  486.         CreateProgmanItem STR_COMPANYNAME, STR_README, EDITOR_EXE + MakePath(szDestPath, APPLICATION_README_FILE), "", cmoOverwrite
  487.  
  488.         '$IFDEF WITH_ORDERING_INFO
  489.         CreateProgmanItem STR_COMPANYNAME, STR_ORDER, EDITOR_EXE + MakePath(szWinDrive + ":" + DKREG_INI_DIR, ORDER_FILE), "", cmoOverwrite
  490.         '$ENDIF
  491.  
  492.         '$IFDEF WITH_FULL_SAMPLER
  493.         CreateProgmanItem STR_COMPANYNAME, STR_SAMPLER, MakePath(szFullSampPath, SAMPLER_EXE_FILE), "", cmoOverwrite
  494.         CreateProgmanItem STR_COMPANYNAME, STR_SAMPLER_README, MakePath(szFullSampPath, SAMPLER_README_FILE), "", cmoOverwrite
  495.         '$ENDIF
  496.  
  497. '    end if
  498. '$ENDIF
  499. '---
  500.  
  501.     '+++
  502.     '$IFDEF WITH_UNINSTALL
  503.  
  504.         'Uninstall icon
  505.         szDKUninstall$ = szWinDrive + ":" +  DKREG_INI_DIR
  506.         szInf$ = MakePath( szDKUninstall, UNINSTALL_EXE_FILE)
  507.         CreateProgmanItem STR_COMPANYNAME, STR_UNINSTALL, szInf, szInf, cmoOverwrite
  508.     '$ENDIF
  509.     '---
  510.  
  511. '$IFDEF DEBUG
  512.  
  513.     DumpCopyList MakePath(szDestPath, "copylist.txt")
  514.  
  515. '$ENDIF
  516.  
  517. ' Here is the code for DirectX...
  518. 'It requires the program simple.exe to be copied to the temp directory, along with the DirectX DLL's and the DirectX direcory to be located under DKSetup
  519. '$IFDEF NEEDS_DIRECTX
  520.  
  521.         szDirectCommand="simple.exe "+szSrcSetupPath
  522.         intreply=RUN (szDirectCommand)
  523.         dButton = DoMsgBox( "Please Wait While DirectX II Installs","DirectX Setup", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  524.         bInstalledWin32s = 1
  525.  
  526. '$ENDIF
  527.  
  528.  
  529.     RestoreCursor( dCursor )
  530.  
  531.     If EndCommonInstall( APPLICATION_README_FILE, 0, EDITOR_EXE ) = NAV_EXIT then
  532.         stop
  533.         end
  534.     endif
  535.  
  536. quit:
  537.     on error goto quit
  538.  
  539.     select case ERR
  540.  
  541.     case 0
  542.         hDlg = DLG_SUCCESS
  543.     case STFQUIT
  544.         hDlg = DLG_BADEXIT
  545.     case ERR_NODISKSPACE
  546.         hDlg = DLG_NODISKSPACE
  547.     case else
  548.         hDlg = DLG_ABORT
  549.     end select
  550.  
  551.     UIPop 10
  552. quit2:
  553.     szButton = UIStartDlg(CUIDLL_FILENAME, hDlg, "FInfo0DlgProc", 0, "")
  554.     select case szButton
  555.     case "REACTIVATE"
  556.         goto quit2
  557.     end select
  558.  
  559.     UIPop 1
  560.     DeInitialise
  561.     stop
  562.     end
  563.  
  564. quitError:
  565.     dButton = DoMsgBox (STR_QUITERROR, STR_MSGCAPTION, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  566.     DeInitialise
  567.     stop
  568.     end
  569.  
  570.  
  571. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  572.  
  573. Sub Install() STATIC
  574.  
  575.     cursor% = ShowWaitCursor()
  576.     CreateDir szDestPath, cmoNone
  577.  
  578.     '$IFNDEF NEEDS_WIN32S
  579.         SetRestartDir szDestPath    '   Already set if needs Win32s
  580.     '$ENDIF
  581.  
  582.     RestoreCursor(cursor%)
  583.  
  584.     CopyFilesInCopyList  'creates dir even if min install
  585.  
  586.     '+++
  587.     '$IFDEF NEEDS_VFW
  588.  
  589.         ' Don't need to install VFW on Windows 95, it is already there.
  590.         if OS_Windows95 = 0 then
  591.  
  592.             Run ("regedit.exe /s " + MakePath(szWinPath, "mplayer.reg"))
  593.             Run ("regedit.exe /s " + MakePath(szWinSysPath, "OLE2.reg"))
  594.  
  595.             '+++
  596.             '$IFNDEF NEEDS_WIN32S
  597.                 ' NOT with WIN32S
  598.                 Run ("regedit.exe /s " + MakePath(szWinSysPath, "cleanup.reg"))
  599.             '$ENDIF
  600.             '---
  601.  
  602.             Run ("profdisp.exe")
  603.  
  604.         end if
  605.     '$ENDIF
  606.     '---
  607.  
  608.     if INI_FILE_SOURCE = "AppPath" then
  609.         szAppINIPath = MakePath(szDestPath, APPLICATION_INI_FILE)
  610.     else
  611.         szAppINIPath = MakePath(szWinPath, APPLICATION_INI_FILE)
  612.     end if
  613.  
  614.        '=d:\                                    =d:\dksetup                =dksetup
  615.     szPengePath = mid$(szSrcSetupPath, 1,len(szSrcSetupPath)-len(SOURCE_SETUP_SUBDIR)-2) ' -2 removes backslash
  616.  
  617. '+++
  618. '$IFDEF WITH_SAMPLER
  619.         szSampINIPath = MakePath(szDestPath, SAMPLER_INI_FILE)
  620.         'data =
  621.         szSampData = szPengePath + "\" + SAMPLER_PATH
  622.         CreateIniKeyValue szSampINIPath, PRODUCT_INI_DIR_SECTION_NAME, PRODUCT_INI_DIR_ENTRY_NAME, szSampData, cmoOverwrite
  623.         'volumelabel =
  624.         szCdDrive$ = mid$( szSrcSetupPath, 1, 1 )
  625.         szCdVolumeLabel$ = STRING$( 20, 32 )
  626.         if( GetCdVolumeLabel( szCdVolumeLabel$, szCdDrive$ ) ) then
  627.             CreateIniKeyValue MakePath(szDestPath, SAMPLER_INI_FILE), PRODUCT_INI_DIR_SECTION_NAME, "VolumeLabel", szCdVolumeLabel$, cmoOverwrite
  628.         endif
  629. '$ENDIF
  630. '---
  631.  
  632. '+++
  633. '$IFDEF WITH_FULL_SAMPLER
  634.         szSampINIPath = MakePath(szFullSampPath, SAMPLER_INI_FILE)
  635.         'data =
  636.         szSampData = szPengePath + "\" + SAMPLER_PATH
  637.         CreateIniKeyValue szSampINIPath, PRODUCT_INI_DIR_SECTION_NAME, PRODUCT_INI_DIR_ENTRY_NAME, szSampData, cmoOverwrite
  638. ' Don't want to force a specific cd for the full sampler!
  639. '        'volumelabel =
  640. '        szCdDrive$ = mid$( szSrcSetupPath, 1, 1 )
  641. '        szCdVolumeLabel$ = STRING$( 20, 32 )
  642. '        if( GetCdVolumeLabel( szCdVolumeLabel$, szCdDrive$ ) ) then
  643. '            CreateIniKeyValue MakePath(szDestPath, SAMPLER_INI_FILE), PRODUCT_INI_DIR_SECTION_NAME, "VolumeLabel", szCdVolumeLabel$, cmoOverwrite
  644. '        endif
  645. '$ENDIF
  646. '---
  647.  
  648. '+++
  649. ''$IFDEF SCRUNGED
  650. if bscrunged then
  651. '    if szMinimalInstall = "OFF"  then
  652.         'data =
  653.         CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, PRODUCT_INI_DIR_ENTRY_NAME, szPengePath, cmoOverwrite
  654. '    endif
  655.  
  656. ''$ELSE
  657. else
  658.     'DEBUG VERSION
  659.     'data =
  660.     CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, PRODUCT_INI_DIR_ENTRY_NAME, MakePath(szPengePath,"data"), cmoOverwrite
  661.     'pages =
  662.     CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, "Pages", MakePath(szPengePath,"dkpage"), cmoOverwrite
  663.     CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, "Scrunge", "0", cmoOverwrite
  664.     CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, "Developer", "1", cmoOverwrite
  665.     CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, "Debug", "1", cmoOverwrite
  666.  
  667. ''$ENDIF
  668. endif
  669. '---
  670.  
  671. if APPLICATION_EXE_FILE = "sampler.exe" then
  672.     ' Add version entry from version.ini if found
  673.     szSampVersion = GetIniKeyString( MakePath( szSrcBinPath, "VERSION.INI" ), "VERSION", "VERSION" )
  674.     if len( szSampVersion ) > 0 then
  675.         CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, "Version", szSampVersion, cmoOverwrite
  676.     endif
  677. endif
  678.  
  679.     ' Add any custom ini entries in the function in product.inc
  680.     CustomIniEntries
  681.  
  682. End Sub
  683.  
  684. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  685. Sub AddFilesToCopyList(szInstallType$) STATIC
  686.     cursor% = ShowWaitCursor()
  687.  
  688.     szDKUninstall$ = szWinDrive + ":" +  DKREG_INI_DIR
  689.  
  690.     'Shared Files : For ORDER.WRI & FOR MUSEUM TITLES (DKSWTCHW.EXE) Put in \MMAPP
  691.     '$IFDEF WITH_ORDERING_INFO OR NEEDS_MUSEUM_LIFT
  692.     AddSectionFilesToCopyList SETUP_INI_SH_BINARIES_SECTION_NAME, szSrcBinPath, szDKUninstall
  693.     '$ENDIF
  694.  
  695.     '+++
  696.     '$IFDEF WITH_FULL_SAMPLER
  697.  
  698.         AddSectionFilesToCopyList SAMPLER_BINARIES_SECTION_NAME, szSrcBinPath, szFullSampPath
  699.  
  700.     '$ENDIF
  701.     '---
  702.  
  703.     '+++
  704.     '$IFDEF WITH_UNINSTALL
  705.  
  706.         AddSectionFilesToCopyList "UNINSTALL", szSrcBinPath, szDKUninstall
  707.  
  708.     '$ENDIF
  709.     '---
  710.  
  711. '+++
  712. '$IFDEF SCRUNGED_OR_TEXT
  713.  
  714.     if bscrunged = 0 then
  715.         AddSectionFilesToCopyList "BIN TEXT", szSrcBinPath + "\TEXT", szDestPath
  716.     else
  717.         AddSectionFilesToCopyList "BIN SCRUNGED", szSrcBinPath + "\SCRUNGE", szDestPath
  718.     end if
  719.  
  720. '$ENDIF
  721. '---
  722. '    select case szInstallType
  723. '    case "FULL"
  724.     AddSectionFilesToCopyList SETUP_INI_BINARIES_SECTION_NAME, szSrcBinPath, szDestPath
  725.  
  726. '    case "MINIMAL"
  727. '        ' nothing
  728. '    end select
  729.  
  730.  
  731.     '+++
  732.     '$IFDEF NEEDS_WING
  733.         AddSectionFilesToCopyList SETUP_INI_WING_BINARIES_NAME, szSrcBinPath, szWinSysPath
  734.         AddSectionFilesToCopyList SETUP_INI_WING32_BINARIES_NAME, szSrcBinPath, szWinSysPath
  735.     '$ENDIF
  736.     '---
  737.  
  738.     '+++
  739.     '$IFDEF NEEDS_VFW
  740.  
  741.         ' Don't need to install VFW on Windows 95, it is already there.
  742.         if OS_Windows95 = 0 then
  743.  
  744.             AddSectionFilesToCopyList "VfW Runtime", szSrcBinPath, szWinSysPath
  745.             AddSectionFilesToCopyList "MPlayer", szSrcBinPath, szWinPath
  746.             AddSectionFilesToCopyList "AVICodecs", szSrcBinPath, szWinSysPath
  747.  
  748.             '+++
  749.             '$IFNDEF NEEDS_WIN32S
  750.                 ' Win32s has its own 32-bit OLE
  751.                 AddSectionFilesToCopyList "OLE2", szSrcBinPath, szWinSysPath
  752.             '$ENDIF
  753.             '---
  754.         end if
  755.     '$ENDIF
  756.  
  757.     '$IFDEF NEEDS_SOUND
  758.         ' Don't need to install Sound on Windows 95, it is already there.
  759.         if OS_Windows95 = 0 then
  760.             if fSystemUpdated = 1 then
  761.                 AddSectionFilesToCopyList "ACM Drivers", szSrcBinPath, szWinSysPath
  762.             end if
  763.         end if
  764.     '$ENDIF
  765.  
  766.     RestoreCursor(cursor%)
  767. End Sub
  768.  
  769. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  770. Sub UpdateFonts() STATIC
  771.     ' Check TT enabled
  772.     MakeListFromSectionFilename "Fonts_list", "Fonts"
  773.  
  774.     listLength% = GetListLength("Fonts_list")
  775.     if listLength% > 0 then
  776.         ' Check to see if the list is just a placeholder or a real list.
  777.         szFontFile$ = GetListItem("Fonts_list", 1)
  778.         if szFontFile <> "NOFONT.ZZZ" then
  779.             ' Do the Win.ini entries
  780.             RegisterFonts
  781.  
  782.             for item% = 1 to listLength%
  783.                 szFontFile = GetListItem("Fonts_list", item%)
  784.                 ' Check if exists
  785.                 ' Install font
  786.                 ret% = InstallFont(MakePath(szSrcBinPath, szFontFile))
  787.                 ' Write WIN.INI
  788.             next
  789.         end if
  790.     end if
  791. End Sub
  792.  
  793. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  794. Sub CreateReg() STATIC
  795.  
  796.     ' The MMAPP.INI path
  797.     szDKRegIni = szWinDrive + ":" +  DKREG_INI_PATH
  798.  
  799.     if DoesFileExist( szDKRegIni, femExist) = 0 then
  800.         'dkreg.ini doesn't exist - initialize AppCount, create dir, add to InstalledApp
  801.         AppCount% = 1
  802.         CreateDir (szWinDrive+":"+DKREG_INI_DIR), cmoNone
  803.         CreateIniKeyValue szDKRegIni, "InstalledApp", "Applications", str$(AppCount%), cmoOverwrite
  804.         szNum$=str$(AppCount%)
  805.         CreateIniKeyValue szDKRegIni, "InstalledApp",ltrim$(szNum), STR_PRODUCTNAME, cmoOverwrite
  806.         '$IFDEF WITH_FULL_SAMPLER
  807.             ' Create separate Sampler entry
  808.             AppCount% = 2
  809.             CreateIniKeyValue szDKRegIni, "InstalledApp", "Applications", str$(AppCount%), cmoOverwrite
  810.             szNum$=str$(AppCount%)
  811.             CreateIniKeyValue szDKRegIni, "InstalledApp",ltrim$(szNum), STR_SAMPLER, cmoOverwrite
  812.         '$ENDIF
  813.     else
  814.         if DoesIniSectionExist( szDKRegIni, STR_PRODUCTNAME )=1  then
  815.             szDiffPath$=GetIniKeyString(szDKRegIni, STR_PRODUCTNAME, "Path")
  816.             if(szDestPath$  <> szDiffPath$) then
  817.                 ' product is also installed in a different dir - delete files and dir and ini section
  818.                 ret% = DeleteFiles (szDiffPath, STR_PRODUCTNAME, szDKRegIni)
  819.                 ret% = DeleteDir (szDiffPath)
  820.                 ret% = DeleteSection(STR_PRODUCTNAME, szDKRegIni)
  821.             endif
  822.             'product is installed in same dir - do nothing, has overwritten files
  823.         else
  824.               'product name does not exist - increment AppCount, add to InstalledApp
  825.                szAppCount$ = GetIniKeyString( szDKRegIni, "InstalledApp", "Applications" )
  826.                AppCount% = Val(szAppCount$) + 1
  827.                CreateIniKeyValue szDKRegIni, "InstalledApp", "Applications", str$(AppCount%), cmoOverwrite
  828.                'assign product to first available number (maybe gaps due to deletion)
  829.                i%=1
  830.                while( GetIniKeyString( szDKRegIni, "InstalledApp",str$(i%) )<>"")
  831.                    i=i+1
  832.                wend
  833.                szNum$=str$(i%)
  834.                CreateIniKeyValue szDKRegIni, "InstalledApp",ltrim$(szNum), STR_PRODUCTNAME, cmoOverwrite
  835.         endif
  836.  
  837.         '$IFDEF WITH_FULL_SAMPLER
  838.             ' Create separate Sampler entry
  839.             if DoesIniSectionExist( szDKRegIni, STR_SAMPLER )=1  then
  840.                 szDiffPath$=GetIniKeyString(szDKRegIni, STR_SAMPLER, "Path")
  841.                 if(szFullSampPath$  <> szDiffPath$) then
  842.                     ' Sampler is installed in a different dir - delete files and dir and ini section
  843.                     ret% = DeleteFiles (szDiffPath, STR_SAMPLER, szDKREgIni)
  844.                     ret% = DeleteDir (szDiffPath)
  845.                     ret% = DeleteSection(STR_SAMPLER, szDKREgIni)
  846.                 endif
  847.                 'Sampler is installed in same dir - do nothing, will overwrite files
  848.             else
  849.                 'Sampler does not exist - increment AppCount, add to InstalledApp
  850.                 szAppCount$ = GetIniKeyString( szDKRegIni, "InstalledApp", "Applications" )
  851.                 AppCount% = Val(szAppCount$) + 1
  852.                 CreateIniKeyValue szDKRegIni, "InstalledApp", "Applications", str$(AppCount%), cmoOverwrite
  853.                 'assign product to first available number (maybe gaps due to deletion)
  854.                 i%=1
  855.                 while( GetIniKeyString( szDKRegIni, "InstalledApp",str$(i%) )<>"")
  856.                     i=i+1
  857.                 wend
  858.                 szNum$=str$(i%)
  859.                 CreateIniKeyValue szDKRegIni, "InstalledApp",ltrim$(szNum), STR_SAMPLER, cmoOverwrite
  860.             endif
  861.         '$ENDIF
  862.      endif
  863.  
  864.     CreateIniKeyValue szDKRegIni, "InstalledApp","RecentLang", LANG_DLL, cmoOverwrite
  865.     CreateIniKeyValue szDKRegIni, STR_PRODUCTNAME, "Path", szDestPath, cmoOverwrite
  866.     CreateIniKeyValue szDKRegIni, STR_PRODUCTNAME, "Company", STR_COMPANYNAME, cmoOverwrite
  867.     CreateIniKeyValue szDKRegIni, STR_PRODUCTNAME, "Readme", STR_README, cmoOverwrite
  868.     CreateIniKeyValue szDKRegIni, STR_PRODUCTNAME, "Order", STR_ORDER, cmoOverwrite
  869.     CreateIniKeyValue szDKRegIni, STR_PRODUCTNAME, "Exe", APPLICATION_EXE_FILE, cmoOverwrite
  870.     CreateIniKeyValue szDKRegIni, STR_PRODUCTNAME, "1", APPLICATION_INI_FILE , cmoOverwrite  'Ini
  871. '    if szMinimalInstall = "OFF" then
  872.         MakeListFromSectionFilename "BIN_list", "BIN"
  873.         listLength% = GetListLength("BIN_list")
  874.         if listLength% > 0 then
  875.             for item% = 1 to listLength%
  876.                 szBinFile$ = GetListItem("BIN_list", item%)
  877.                 szNum$=str$(item%+1)
  878.                 CreateIniKeyValue szDKRegIni, STR_PRODUCTNAME, ltrim$(szNum), szBinFile , cmoOverwrite
  879.             next
  880.         end if
  881. '    end if
  882.  
  883. '$IFDEF SCRUNGED_OR_TEXT
  884.         if bscrunged = 0 then
  885.             MakeListFromSectionFilename "BIN_OPT_list", "BIN TEXT"
  886.         else
  887.             MakeListFromSectionFilename "BIN_OPT_list", "BIN SCRUNGED"
  888.         end if
  889.  
  890.         listLength% = GetListLength("BIN_OPT_list")
  891.         if listLength% > 0 then
  892.             for Count% =1 to listLength%
  893.                 szBinFile$ = GetListItem("BIN_OPT_list", Count%)
  894.                 szNum$=str$(item%+1)
  895.                 CreateIniKeyValue szDKRegIni, STR_PRODUCTNAME, ltrim$(szNum), szBinFile , cmoOverwrite
  896.                 item% = item% + 1
  897.             next
  898.         end if
  899. '$ENDIF
  900.  
  901.  
  902. '$IFDEF WITH_SAMPLER
  903.     szNum$=str$(item%+1)
  904.     CreateIniKeyValue szDKRegIni, STR_PRODUCTNAME, ltrim$(szNum), SAMPLER_INI_FILE , cmoOverwrite
  905.     item% = item% + 1
  906. '$ENDIF
  907.  
  908.     ' Add Uninstall only files to the list
  909.     UninstallOnly( item% )
  910.  
  911.  
  912. '$IFDEF WITH_FULL_SAMPLER
  913.     ' Create entries in the sampler section
  914.     CreateIniKeyValue szDKRegIni, STR_SAMPLER, "Path", szFullSampPath, cmoOverwrite
  915.     CreateIniKeyValue szDKRegIni, STR_SAMPLER, "Company", STR_COMPANYNAME, cmoOverwrite
  916.     CreateIniKeyValue szDKRegIni, STR_SAMPLER, "Readme", STR_SAMPLER_README, cmoOverwrite
  917.     CreateIniKeyValue szDKRegIni, STR_SAMPLER, "Exe", SAMPLER_EXE_FILE, cmoOverwrite
  918.     CreateIniKeyValue szDKRegIni, STR_SAMPLER, "1", SAMPLER_INI_FILE , cmoOverwrite  'Ini
  919. '    if szMinimalInstall = "OFF" then
  920.         MakeListFromSectionFilename "SAMP_BIN_list", "SAMPBIN"
  921.         listLength% = GetListLength("SAMP_BIN_list")
  922.         if listLength% > 0 then
  923.             for item% = 1 to listLength%
  924.                 szBinFile$ = GetListItem("SAMP_BIN_list", item%)
  925.                 szNum$=str$(item%+1)
  926.                 CreateIniKeyValue szDKRegIni, STR_SAMPLER, ltrim$(szNum), szBinFile , cmoOverwrite
  927.             next
  928.         end if
  929. '    end if
  930. '$ENDIF
  931.  
  932.     ' Add fonts to the uninstall list.
  933. '    listLength% = GetListLength("Fonts_list")
  934. '    if listLength% > 0 then
  935. '        for item% = 1 to listLength%
  936. '            szFontFile$ = GetListItem("Fonts_list", item%)
  937. '            szNum$=str$(item%)
  938. '            CreateIniKeyValue szDKRegIni, STR_PRODUCTNAME,"F"+ltrim$(szNum), szFontFile, cmoOverwrite
  939. '        next
  940. '    end if
  941.  
  942. End Sub
  943.  
  944.