home *** CD-ROM | disk | FTP | other *** search
/ Felinos / ZETACATS.ISO / dksetup / dksetup.mst < prev    next >
Encoding:
Text File  |  1996-11-13  |  20.9 KB  |  599 lines

  1. ''$DEFINE DEBUG
  2. '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  3. '   CAT (UK)
  4. '
  5. '   uses VforW & Wing
  6. '
  7. '   VERSION
  8. '   -------
  9. '   18/08/95 rc and this have no min install. Changed dlg boxes custom,
  10. '            custom help and speed
  11. '
  12. '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  13. '
  14. '18/08/95 Register notes most recent lang used
  15. '11/08/95 Register created using inf file
  16. '26/07/95 Uninstall code added
  17. '07/07/95 Correct dkgen.inc so unregisters use of ctl3d
  18. '04/07/95 Make sure files in bin section of inf file 'always' overwrite
  19. '28/07/95 Ini file not created for minimum install, uses file provided in dkcode
  20. '27/06/95 Test for directory names max 8 chars
  21. '26/06/95 For minimum install, ini file is now not installed
  22. '19/06/95 Moved test for cirrus drivers to mst file as only applies to sampler
  23. '05/06/95 Fonts installed on users machine
  24. '01/06/95 No choice about adding icon to prog man, altered dkgen.inc & rc file
  25. '            (custom, customhelp & speed dlg boxes need changing)
  26. '22/05/95 Code for bundling with sampler
  27. '22/05/95 Large readme need Write (will need to change dlg box in rc file)
  28. '15/05/95 No warning that directory does not exist
  29. '03/05/95 Ini file put in executable directory rather than Windows dir to stop
  30. '            clash with foreign products with same name files
  31.  
  32.  
  33. '$INCLUDE 'dkgen.inc'
  34.  
  35.  
  36. 'IF WITH SAMPLER ( add to .inf & dkcode ) + see add to prog man below
  37. 'CONST SAMPLER_PATH = "SAMPLER"
  38. 'CONST APPLICATION_MENU_FILE = "custmenu.exe"
  39. 'CONST APPLICATION_EXE2_FILE = "dksd2pc.exe"
  40. 'DECLARE FUNCTION TestForCirrus LIB "dkutils.dll" () As INTEGER
  41.  
  42.  
  43. 'IF USING SPECIFIC FONTS
  44. 'DECLARE FUNCTION InstallFont LIB "dkutils.dll" (szFont$) AS INTEGER
  45. 'DECLARE SUB UpdateFonts()
  46.  
  47. ' Uninstall icon
  48. CONST STR_UNINSTALL = "Desinstalador de Zeta"
  49. CONST LANG_DLL = "Unlang.esp"     'will use as default if can't find dll to match window lang
  50.  
  51. ' Paths and INI stuff
  52. CONST APPLICATION_INI_FILE = "cat.ini"
  53. CONST APPLICATION_EXE_FILE = "cat.exe"
  54. CONST APPLICATION_PENGE_FILE = "cat.png"
  55.  
  56. CONST INI_FILE_SOURCE = "AppPath" ' OR  "WinPath"
  57. CONST EDITOR_EXE =  "write.exe " 'OR "notepad.exe "
  58.  
  59. ' Language dependant strings
  60. CONST APPLICATION_README_FILE = "leame.wri"
  61. CONST STR_README = "Felinos LΘame"
  62. CONST APPLICATION_ORDER_FILE = "order.wri"
  63. CONST STR_ORDER = "Mßs informaci≤n"
  64. CONST STR_MSGCAPTION = "Instalaci≤n de Felinos"
  65. CONST STR_PRODUCTNAME = "Felinos"
  66. CONST DEFAULT_INSTALL_PATH = "\ZETA\FELINOS"
  67.  
  68.  
  69. DECLARE SUB CreateReg()
  70. DECLARE SUB Install()
  71. DECLARE SUB AddFilesToCopyList(szInstallType$)
  72. DECLARE FUNCTION IsCDROMDrive LIB "dkutils.dll" (wDrive%) As INTEGER
  73. DECLARE FUNCTION DeleteFiles LIB "dkutils.dll" (szDiffPath$, szProdName$, szDKREgIni$) AS INTEGER
  74. DECLARE FUNCTION DeleteDir LIB "dkutils.dll" (szDiffPath$) AS INTEGER
  75. DECLARE FUNCTION DeleteSection LIB "dkutils.dll" (szProdName$, szDKREgIni$) AS INTEGER
  76.  
  77.  
  78. Init:
  79.    Initialise STR_PRODUCTNAME, DEFAULT_INSTALL_PATH, STR_MSGCAPTION
  80.  
  81. WelcomeDlg:
  82.     if Welcome() = NAV_BACK then
  83.         ' Don nothing - cant go back
  84.     end if
  85.  
  86. '*************
  87. 'to be removed
  88.  
  89.  
  90. '*************
  91.  
  92.     if TestSystem() = NAV_BACK then
  93.         goto WelcomeDlg
  94.     end if
  95.  
  96. '    dButton = DoMsgBox( "Minimum install disabled", STR_MSGCAPTION, MB_OK)
  97.  
  98. 'IF WITH SAMPLER
  99. 'TestCirrus:
  100. '    if TestForCirrus() = 1 then
  101. '        dButton = DoMsgBox(STR_CIRRUS, szMsgCaption$, MB_OK+MB_TASKMODAL+MB_ICONINFORMATION)
  102. '    end if
  103.  
  104. 'IF EARLIER PRODS WITH NO SAMPLER
  105. '    UpdateADPCMDrivers
  106.  
  107.  
  108. ExpressCustomDlg:
  109.     ' defaults to Express
  110.     'if szExpressCustomChoice = "EXPRESS" then
  111.     '    SetSymbolValue "RadioDefault", "1"
  112.     'else
  113.     '    SetSymbolValue "RadioDefault", "1"
  114.     'end if
  115.  
  116. ECDlgLoop:
  117.     szButton = UIStartDlg(CUIDLL_FILENAME, IDD_SPEED, "FRadioDlgProc", IDD_WHIZZHELP, PROC_HELP)
  118.  
  119.     select case szButton
  120.     case "REACTIVATE"
  121.         goto ECDlgLoop
  122.     case "BACK"
  123.         UIPop 1
  124.         goto WelcomeDlg
  125.     case "CONTINUE" ' Install
  126.         UIPop 1
  127.         if GetSymbolValue("ButtonChecked") = "1" then
  128.             szExpressCustomChoice = "EXPRESS"
  129.             goto ExpressInstallLoop
  130.         else
  131.             szExpressCustomChoice = "CUSTOM"
  132.             goto CustomInstallLoop
  133.         end if
  134.     case "EXIT"
  135.         AskQuit
  136.         goto ECDlgLoop
  137.     end select
  138.  
  139.  
  140. CustomInstallLoop:
  141. GetPathDlg:
  142.     SetSymbolValue "EditTextIn", szDestPath
  143.     szOldDestPath = szDestPath
  144.     SetSymbolValue "EditFocus", "ALL"
  145.  
  146. GetPathDlgLoop:
  147.     szButton = UIStartDlg(CUIDLL_FILENAME, IDD_DESTPATH, "FEditDlgProc", IDD_PATHHELP, PROC_HELP)
  148.  
  149.     select case szButton
  150.     case "REACTIVATE"
  151.         goto GetPathDlgLoop
  152.  
  153.     case "BACK"
  154.         UIPop 1
  155.         szDestPath = szOldDestPath
  156.         goto ECDlgLoop
  157.  
  158.     case "CONTINUE"
  159.         UIPop 1
  160.         szDestPath = GetSymbolValue("EditTextOut")
  161.  
  162.         if mid$(szDestPath, 2, 1) = ":" and mid$(szDestPath, 3, 1) <> "\" then
  163.             szTemp$ = mid$(szDestPath, 1, 2) + "\" + mid$(szDestPath, 3, len(szDestPath)-2)
  164.             szDestPath = szTemp
  165.         end if
  166.  
  167.         if mid$(szDestPath, 2, 1) <> ":" then
  168.             if mid$(szDestPath, 1,1) <> "\" then
  169.                 szDestPath = mid$(szWinPath, 1,1) + ":\" + szDestPath
  170.             else
  171.                 szDestPath = mid$(szWinPath, 1,1) + ":" + szDestPath
  172.             end if
  173.         elseif IsDriveValid(mid$(szDestPath, 1,1)) = 0 then
  174.             szDestPath = szOldDestPath
  175.             UIPop 1
  176.             BadPath
  177.             goto GetPathDlg
  178.         end if
  179.  
  180.         ' check for "foreign" chars in path
  181.         slength% = len(szDestPath)
  182.         found% = 0
  183.         for i% = 1 to slength%
  184.             if asc(mid$(szDestPath, i%, 1)) > 126 then
  185.                 found% = 1
  186.             end if
  187.         next i%
  188.         if found% = 1 then
  189.             szDestPath = szOldDestPath
  190.             UIPop 1
  191.             BadPath
  192.             goto GetPathDlg
  193.         end if
  194.  
  195.         wDrive% = asc(mid$(szDestPath, 1,1)) - asc("A")
  196.         if IsCDROMDrive(wDrive%) > 0 then
  197.             szDestPath = szOldDestPath
  198.             UIPop 1
  199.             BadPath
  200.             goto GetPathDlg
  201.         end if
  202.  
  203.         if IsDriveNetwork(mid$(szDestPath,1,1)) = 1 then
  204.             szDestPath = szOldDestPath
  205.             UIPop 1
  206.             NetworkDrive
  207.             goto GetPathDlg
  208.         end if
  209.  
  210.         if IsDirWritable(szDestPath) = 0 then
  211.             szDestPath = szOldDestPath
  212.             UIPop 1
  213.             BadPath
  214.             goto GetPathDlg
  215.         end if
  216.  
  217.         'check dir names not > 8 chars
  218.         dirlength% = 0
  219.         i% = 3
  220.         while i% <> slength%
  221.             i% =i%+1
  222.             dirlength% = dirlength% +1
  223.             if mid$(szDestPath, i%, 1)="\" then
  224.                 if dirlength% > 9 then
  225.                     szDestPath = szOldDestPath
  226.                     dButton = DoMsgBox( STR_DIRTOOLONG, STR_MSGCAPTION, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  227.                     goto GetPathDlg
  228.                  else
  229.                     dirlength% = 0
  230.                 endif
  231.             end if
  232.  
  233.         wend
  234.         if dirlength% > 8 then
  235.             szDestPath = szOldDestPath
  236.             dButton = DoMsgBox( STR_DIRTOOLONG, STR_MSGCAPTION, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  237.             goto GetPathDlg
  238.         endif
  239.  
  240.  
  241.  
  242.   '      if DoesDirExist(szDestPath) = 0 then
  243.   '          dButton = DoMsgBox( STR_DIRNOTEXIST, STR_MSGCAPTION, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  244.   '          if dButton = 7 then
  245.   '              goto GetPathDlg
  246.   '          end if
  247.   '      end if
  248.  
  249.         UIPop 1
  250.  
  251.  
  252.     case "EXIT"
  253.         AskQuit
  254.         goto GetPathDlg
  255.     end select
  256.  
  257. GetCustomChoicesDlg:
  258.     SetSymbolValue "CheckItemsState", ""
  259. '    AddListItem "CheckItemsState", szMinimalInstall
  260. '    AddListItem "CheckItemsState", szAddPMItem
  261. GetCustomChoicesLoop:
  262.  
  263.     ClearCopyList
  264. '    if szMinimalInstall = "OFF" then
  265.         AddFilesToCopyList "FULL"
  266. '    else
  267. '        AddFilesToCopyList "MINIMAL"
  268. '    end if
  269.  
  270.     dDestDrive = asc(mid$(szDestPath, 1,1)) - asc("A")+1
  271.     dWinDrive = asc(mid$(szWinPath, 1,1)) - asc("A")+1
  272.  
  273.     SetSymbolValue "DriveStatusText", ""
  274.     AddListItem "DriveStatusText", mid$(szDestPath, 1,1) + ":"
  275.     AddListItem "DriveStatusText", str$(GetDiskSpaceNeeded(dDestDrive) / 1024) + " K"
  276.     AddListItem "DriveStatusText", str$(GetFreeSpaceForDrive(mid$(szDestPath, 1,1))/1024) + " K"
  277.  
  278.     if dDestDrive = dWinDrive then
  279.         AddListItem "DriveStatusText", ""
  280.         AddListItem "DriveStatusText", ""
  281.         AddListItem "DriveStatusText", ""
  282.     else
  283.         AddListItem "DriveStatusText", mid$(szWinPath, 1,1) + ":"
  284.         AddListItem "DriveStatusText", str$(GetDiskSpaceNeeded(dWinDrive)/ 1024 ) + " K"
  285.         AddListItem "DriveStatusText", str$(GetFreeSpaceForDrive(mid$(szWinPath, 1,1))/1024) + " K"
  286.     end if
  287.  
  288.     AddListItem "DriveStatusText", szDestPath
  289.  
  290. ChooseInstall:
  291.  
  292.     szButton = UIStartDlg(CUIDLL_FILENAME, IDD_CUSTOM, "FCustInstDlgProc", IDD_CUSTOMHELP, PROC_HELP)
  293.  
  294. '    szMinimalInstall = GetListItem("CheckItemsState", 1)
  295. '    szAddPMItem = GetListItem("CheckItemsState", 2)
  296.  
  297.     select case szButton
  298.     case "REACTIVATE"
  299.         goto GetCustomChoicesLoop
  300.     case "BACK"
  301.         UIPop 1
  302.         goto GetPathDlg
  303.     case "CONTINUE"
  304.         UIPop 1
  305.     case "EXIT"
  306.         AskQuit
  307.         goto GetCustomChoicesLoop
  308.     end select
  309.  
  310.     ClearCopyList
  311. '    if szMinimalInstall = "OFF" then
  312.         AddFilesToCopyList "FULL"
  313. '    else
  314. '        AddFilesToCopyList "MINIMAL"
  315. '    end if
  316.     goto CommonInstallLoop
  317.  
  318. ExpressInstallLoop:
  319.     AddFilesToCopyList "FULL"
  320.     goto CommonInstallLoop
  321.  
  322. CommonInstallLoop:
  323.     InitCommonInstall
  324.  
  325.     if szMinimalInstall = "ON" and GetFreeSpaceForDrive(mid$(szDestPath,1,1)) < MINIMUM_DISK_SPACE then
  326.         error ERR_NODISKSPACE
  327.     elseif GetFreeSpaceForDrive(mid$(szDestPath,1,1)) < GetDiskSpaceNeeded( asc(mid$(szDestPath, 1,1))-asc("A")+1 ) then
  328.         error ERR_NODISKSPACE
  329.     end if
  330.  
  331. 'IF LATER PROD OR WITH SAMPLER
  332.     UpdateWinGDrivers
  333.     UpdateIndeoAVIDrivers
  334.  
  335. 'IF USING SPECIFIC FONTS
  336. '    UpdateFonts
  337.  
  338.  
  339. 'IF USING UNINSTALL or it is a MUSEUM TITLE
  340.     CreateIniKeyValue "Win.ini", "MMAPP", WIN_INI_ENTRY, szWinDrive+":"+DKREG_INI_PATH, cmoOverwrite
  341.     CreateReg
  342.  
  343.     Install
  344.  
  345. ' Cat & Bird ONLY
  346.     CreateDir ( szDestPath + "\" + "TOURS" ), cmoNone
  347.  
  348.     CreateProgmanGroup STR_COMPANYNAME, "", cmoNone
  349.     ShowProgmanGroup   STR_COMPANYNAME, 1, cmoNone
  350. '    szReadmeTitle$ = STR_PRODUCTNAME + " " + STR_README 'not used now
  351.  
  352. 'IF WITH SAMPLER
  353. '    szSamplerPath$ = MakePath( mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1), SAMPLER_PATH)
  354. '    szSamplerPath$ = MakePath(szSamplerPath$, APPLICATION_EXE2_FILE)
  355. '    if szMinimalInstall = "ON" then
  356. '        szInf$ = MakePath(szSrcBinPath, APPLICATION_MENU_FILE) + " " + MakePath(szSrcBinPath, APPLICATION_EXE_FILE) + " " + MakePath(szSrcBinPath, APPLICATION_PENGE_FILE) + " " + szSamplerPath$
  357. '        CreateProgmanItem STR_COMPANYNAME, STR_PRODUCTNAME, szInf, szInf, cmoOverwrite
  358. '         CreateProgmanItem STR_COMPANYNAME, STR_README, EDITOR_EXE + MakePath(szSrcBinPath, APPLICATION_README_FILE), "", cmoOverwrite
  359. '    else
  360. '        szInf$ = MakePath(szDestPath, APPLICATION_MENU_FILE) + " " + MakePath(szDestPath, APPLICATION_EXE_FILE) + " " + MakePath(szDestPath, APPLICATION_PENGE_FILE) + " " + szSamplerPath$
  361. '        CreateProgmanItem STR_COMPANYNAME, STR_PRODUCTNAME, szInf, szInf, cmoOverwrite
  362. '        CreateProgmanItem STR_COMPANYNAME, STR_README, EDITOR_EXE + MakePath(szDestPath, APPLICATION_README_FILE), "", cmoOverwrite
  363. '    end if
  364.  
  365. 'IF NO SAMPLER
  366. '    if szMinimalInstall = "ON" then
  367. '        szInf$ = MakePath(szSrcBinPath, APPLICATION_EXE_FILE) + " " + MakePath(szSrcBinPath, "dkpage")'APPLICATION_PENGE_FILE)
  368. '        CreateProgmanItem STR_COMPANYNAME, STR_PRODUCTNAME, szInf, szInf, cmoOverwrite
  369. '        CreateProgmanItem STR_COMPANYNAME, STR_README, EDITOR_EXE + MakePath(szSrcBinPath, APPLICATION_README_FILE), "", cmoOverwrite
  370. '    else
  371.         szInf$ = MakePath(szDestPath, APPLICATION_EXE_FILE) + " " + MakePath(szDestPath, "dkpage")'APPLICATION_PENGE_FILE)
  372.         CreateProgmanItem STR_COMPANYNAME, STR_PRODUCTNAME, szInf, szInf, cmoOverwrite
  373.         CreateProgmanItem STR_COMPANYNAME, STR_README, EDITOR_EXE + MakePath(szDestPath, APPLICATION_README_FILE), "", cmoOverwrite
  374. '       CreateProgmanItem STR_COMPANYNAME, STR_ORDER, EDITOR_EXE + MakePath(szDestPath, APPLICATION_ORDER_FILE), "", cmoOverwrite
  375.         CreateProgmanItem STR_COMPANYNAME, STR_ORDER, EDITOR_EXE + MakePath(szWinDrive + ":" + DKREG_INI_DIR, APPLICATION_ORDER_FILE), "", cmoOverwrite
  376. '    end if
  377.  
  378. 'IF USING UNINSTALL
  379.     'Uninstall icon
  380.     szDKUninstall$ = szWinDrive + ":" +  DKREG_INI_DIR
  381.     szInf$ = MakePath( szDKUninstall, UNINSTALL_EXE_FILE)
  382.     CreateProgmanItem STR_COMPANYNAME, STR_UNINSTALL, szInf, szInf, cmoOverwrite
  383.  
  384. '$IFDEF DEBUG
  385.     DumpCopyList MakePath(szDestPath, "copylist.txt")
  386. '$ENDIF ''DEBUG
  387.  
  388.     EndCommonInstall APPLICATION_README_FILE, 0, EDITOR_EXE
  389.  
  390. quit:
  391.     on error goto quit
  392.  
  393.     select case ERR
  394.  
  395.     case 0
  396.         hDlg = IDD_EXITSUCCESS
  397.     case STFQUIT
  398.         hDlg = IDD_EXITQUIT
  399.     case ERR_NODISKSPACE
  400.         hDlg = IDD_NODISKSPACE
  401.     case else
  402.         hDlg = IDD_EXITFAILURE
  403.     end select
  404.  
  405.     UIPop 10
  406. quit2:
  407.     szButton = UIStartDlg(CUIDLL_FILENAME, hDlg, "FInfo0DlgProc", 0, "")
  408.     select case szButton
  409.     case "REACTIVATE"
  410.         goto quit2
  411.     end select
  412.  
  413.     UIPop 1
  414.     DeInitialise
  415.     stop
  416.     end
  417.  
  418. quitError:
  419.     dButton = DoMsgBox (STR_QUITERROR, STR_MSGCAPTION, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  420.     DeInitialise
  421.     stop
  422.     end
  423.  
  424.  
  425. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  426.  
  427. Sub Install() STATIC
  428.  
  429.     cursor% = ShowWaitCursor()
  430.     CreateDir szDestPath, cmoNone
  431.     SetRestartDir szDestPath
  432.     RestoreCursor(cursor%)
  433.  
  434.     CopyFilesInCopyList  'creates dir even if min install
  435.  
  436. 'IF LATER PROD OR WITH SAMPLER
  437.     Run ("regedit.exe /s " + MakePath(szWinPath, "mplayer.reg"))
  438.     Run ("regedit.exe /s " + MakePath(szWinSysPath, "OLE2.reg"))
  439.     Run ("regedit.exe /s " + MakePath(szWinSysPath, "cleanup.reg"))
  440.     Run ("profdisp.exe")
  441.  
  442.     if INI_FILE_SOURCE = "AppPath" then
  443.         szAppINIPath = MakePath(szDestPath, APPLICATION_INI_FILE)
  444.     else
  445.         szAppINIPath = MakePath(szWinPath, APPLICATION_INI_FILE)
  446.     end if
  447.  
  448.        '=d:\                                    =d:\dksetup                =dksetup
  449.     szPengePath = mid$(szSrcSetupPath, 1,len(szSrcSetupPath)-len(SOURCE_SETUP_SUBDIR)-2) ' -2 removes backslash
  450.  
  451. 'IF SCRUNGED
  452. '    if szMinimalInstall = "OFF"  then
  453. 'data
  454.         CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, PRODUCT_INI_DIR_ENTRY_NAME, szPengePath, cmoOverwrite
  455. '    endif
  456.  
  457. 'IF DEBUG VERSION
  458. 'data
  459. '    CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, PRODUCT_INI_DIR_ENTRY_NAME, MakePath(szPengePath,"data"), cmoOverwrite
  460. 'pages
  461. '    CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, "Pages", MakePath(szPengePath,"dkpage"), cmoOverwrite
  462. '    CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, "Scrunge", "0", cmoOverwrite
  463. '    CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, "Developer", "1", cmoOverwrite
  464. '    CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, "Debug", "1", cmoOverwrite
  465.  
  466.  
  467. End Sub
  468.  
  469.  
  470. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  471. Sub AddFilesToCopyList(szInstallType$) STATIC
  472.     cursor% = ShowWaitCursor()
  473.  
  474. 'for uninstall
  475.     szDKUninstall$ = szWinDrive + ":" +  DKREG_INI_DIR
  476.     AddSectionFilesToCopyList "UNINSTALL", szSrcBinPath, szDKUninstall
  477.  
  478. '    select case szInstallType
  479. '    case "FULL"
  480.         AddSectionFilesToCopyList SETUP_INI_BINARIES_SECTION_NAME, szSrcBinPath, szDestPath
  481.  
  482. '   Shared Files
  483. 'ONLY FOR MUSEUM TITLES AT THE MOMENT! DKSWTCHW.EXE
  484.         AddSectionFilesToCopyList SETUP_INI_SH_BINARIES_SECTION_NAME, szSrcBinPath, szWinDrive + ":" + DKREG_INI_DIR
  485.  
  486. '    case "MINIMAL"
  487. '        ' nothing
  488. '    end select
  489.  
  490. 'IF EARLIER PRODS AND NO SAMPLER
  491. '    if fSystemUpdated = 1 then
  492. '        AddSectionFilesToCopyList "ACM Drivers", szSrcBinPath, szWinSysPath
  493. '    end if
  494.  
  495.  
  496. 'IF LATER PROD OR WITH SAMPLER
  497.         AddSectionFilesToCopyList SETUP_INI_WING_BINARIES_NAME, szSrcBinPath, szWinSysPath
  498.         AddSectionFilesToCopyList SETUP_INI_WING32_BINARIES_NAME, szSrcBinPath, szWinSysPath
  499.         AddSectionFilesToCopyList "VfW Runtime", szSrcBinPath, szWinSysPath
  500.         AddSectionFilesToCopyList "OLE2", szSrcBinPath, szWinSysPath
  501.         AddSectionFilesToCopyList "ACM Drivers", szSrcBinPath, szWinSysPath
  502.         AddSectionFilesToCopyList "MPlayer", szSrcBinPath, szWinPath
  503.         AddSectionFilesToCopyList "AVICodecs", szSrcBinPath, szWinSysPath
  504.  
  505.     RestoreCursor(cursor%)
  506. End Sub
  507.  
  508.  
  509. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  510. 'IF USING SPECIFIC FONTS
  511. 'Sub UpdateFonts() STATIC
  512. '    ' Check TT enabled
  513. '    MakeListFromSectionFilename "Fonts_list", "Fonts"
  514. '
  515. '    listLength% = GetListLength("Fonts_list")
  516. '    if listLength% > 0 then
  517. '        for item% = 1 to listLength%
  518. '            szFontFile$ = GetListItem("Fonts_list", item%)
  519. '            ' Check if exists
  520. '            'Install font
  521. '            ret% = InstallFont(MakePath(szSrcBinPath, szFontFile))
  522. '            ' Write WIN.INI
  523. '        next
  524. '    end if
  525. 'End Sub
  526.  
  527.  
  528.  
  529. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  530. Sub CreateReg() STATIC
  531.  
  532.     szDKREgIni$ = szWinDrive + ":" +  DKREG_INI_PATH
  533.     szProdName$ = STR_PRODUCTNAME
  534.     if DoesFileExist( szDKREgIni$, femExist) = 0 then
  535.         'dkreg.ini doesn't exist - initialize AppCount, create dir, add to InstalledApp
  536.         AppCount% = 1
  537.         CreateDir (szWinDrive+":"+DKREG_INI_DIR), cmoNone
  538.         CreateIniKeyValue szDKREgIni$, "InstalledApp", "Applications", str$(AppCount%), cmoOverwrite
  539.         szNum$=str$(AppCount%)
  540.         CreateIniKeyValue szDKREgIni$, "InstalledApp",ltrim$(szNum), szProdName$, cmoOverwrite
  541.     else
  542.         if DoesIniSectionExist( szDKREgIni$, szProdName$ )=1  then
  543.             szDiffPath$=GetIniKeyString(szDKREgIni$, szProdName$, "Path")
  544.         '     if(szDestPath$  <> szDiffPath$) then
  545.                'product is already installed in a different dir - delete files and dir and ini section, don't change installed app section
  546.                ret% = DeleteFiles (szDiffPath, szProdName, szDKREgIni)
  547.                ret% = DeleteDir (szDiffPath)
  548.                ret% = DeleteSection(szProdName, szDKREgIni)
  549.         '      endif
  550.              'product is installed in same dir - do nothing, will overwrite
  551.         else
  552.               'product name does not exist - increment AppCount, add to InstalledApp
  553.                szAppCount$ = GetIniKeyString( szDKREgIni$, "InstalledApp", "Applications" )
  554.                AppCount% = Val(szAppCount$) + 1
  555.                CreateIniKeyValue szDKREgIni$, "InstalledApp", "Applications", str$(AppCount%), cmoOverwrite
  556.                'assign product to first available number (maybe gaps due to deletion)
  557.                i%=1
  558.                while( GetIniKeyString( szDKREgIni$, "InstalledApp",str$(i%) )<>"")
  559.                    i=i+1
  560.                wend
  561.                szNum$=str$(i%)
  562.                CreateIniKeyValue szDKREgIni$, "InstalledApp",ltrim$(szNum), szProdName$, cmoOverwrite
  563.         endif
  564.      endif
  565.  
  566.     CreateIniKeyValue szDKREgIni$, "InstalledApp","RecentLang", LANG_DLL, cmoOverwrite
  567.     CreateIniKeyValue szDKREgIni$, szProdName$, "Path", szDestPath, cmoOverwrite
  568.     CreateIniKeyValue szDKREgIni$, szProdName$, "Company", STR_COMPANYNAME, cmoOverwrite
  569.     CreateIniKeyValue szDKREgIni$, szProdName$, "Readme", STR_README, cmoOverwrite
  570.  
  571.     CreateIniKeyValue szDKREgIni$, szProdName$, "Order", STR_ORDER, cmoOverwrite
  572.     CreateIniKeyValue szDKREgIni$, szProdName$, "Exe", APPLICATION_EXE_FILE, cmoOverwrite
  573.     CreateIniKeyValue szDKREgIni$, szProdName$, "1", APPLICATION_INI_FILE , cmoOverwrite  'Ini
  574. '    if szMinimalInstall = "OFF" then
  575.         MakeListFromSectionFilename "BIN_list", "BIN"
  576.         listLength% = GetListLength("BIN_list")
  577.         if listLength% > 0 then
  578.             for item% = 1 to listLength%
  579.                 szBinFile$ = GetListItem("BIN_list", item%)
  580.                 szNum$=str$(item%+1)
  581.                 CreateIniKeyValue szDKREgIni$, szProdName$, ltrim$(szNum), szBinFile , cmoOverwrite
  582.             next
  583.         end if
  584. '    end if
  585.  
  586. '    listLength% = GetListLength("Fonts_list")
  587. '    if listLength% > 0 then
  588. '        for item% = 1 to listLength%
  589. '            szFontFile$ = GetListItem("Fonts_list", item%)
  590. '            szNum$=str$(item%)
  591. '            CreateIniKeyValue szDKREgIni$, szProdName$,"F"+ltrim$(szNum), szFontFile, cmoOverwrite
  592. '        next
  593. '    end if
  594.  
  595. End Sub
  596.  
  597.  
  598.  
  599.