home *** CD-ROM | disk | FTP | other *** search
/ Tietosanakirja Tiede / DKMMSCIE.ISO / dksetup / dksetup.mst < prev    next >
Text File  |  1995-10-19  |  21KB  |  581 lines

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