home *** CD-ROM | disk | FTP | other *** search
/ Eyewitness Virtual Reality: Bird / EyewitnessBirds.iso / dksetup / dksetup.mst < prev    next >
Text File  |  1995-10-23  |  21KB  |  590 lines

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