home *** CD-ROM | disk | FTP | other *** search
/ Jak to Dziala / Jak.iso / dksetup / dksetup.mst < prev    next >
Text File  |  1996-10-10  |  31KB  |  863 lines

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