home *** CD-ROM | disk | FTP | other *** search
/ Eyewitness Virtual Reality: Bird / EyewitnessBirds.iso / dksetup / dksetup.bak < prev    next >
Text File  |  1995-09-29  |  21KB  |  584 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 = "notepad.exe " 'OR "write.exe "
  57.  
  58. ' Language dependant strings
  59. CONST APPLICATION_README_FILE = "readme.txt"
  60. CONST STR_README = "Eyewitness Virtual Reality BIRD Read Me"
  61. CONST STR_MSGCAPTION = "Eyewitness Virtual Reality (Bird) Setup"
  62. CONST STR_PRODUCTNAME = "Eyewitness Virtual Reality BIRD"
  63. CONST DEFAULT_INSTALL_PATH = "\DKMM\BIRD"
  64.  
  65.  
  66. DECLARE SUB CreateReg()
  67. DECLARE SUB Install()
  68. DECLARE SUB AddFilesToCopyList(szInstallType$)
  69. DECLARE FUNCTION IsCDROMDrive LIB "dkutils.dll" (wDrive%) As INTEGER
  70. DECLARE FUNCTION DeleteFiles LIB "dkutils.dll" (szDiffPath$, szProdName$, szDKREgIni$) AS INTEGER
  71. DECLARE FUNCTION DeleteDir LIB "dkutils.dll" (szDiffPath$) AS INTEGER
  72. DECLARE FUNCTION DeleteSection LIB "dkutils.dll" (szProdName$, szDKREgIni$) AS INTEGER
  73.  
  74.  
  75. Init:
  76.    Initialise STR_PRODUCTNAME, DEFAULT_INSTALL_PATH, STR_MSGCAPTION
  77.  
  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.     CreateReg
  334.  
  335.     Install
  336.  
  337.     CreateProgmanGroup STR_COMPANYNAME, "", cmoNone
  338.     ShowProgmanGroup   STR_COMPANYNAME, 1, cmoNone
  339. '    szReadmeTitle$ = STR_PRODUCTNAME + " " + STR_README 'not used now
  340.  
  341. 'IF WITH SAMPLER
  342. '    szSamplerPath$ = MakePath( mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1), SAMPLER_PATH)
  343. '    szSamplerPath$ = MakePath(szSamplerPath$, APPLICATION_EXE2_FILE)
  344. '    if szMinimalInstall = "ON" then
  345. '        szInf$ = MakePath(szSrcBinPath, APPLICATION_MENU_FILE) + " " + MakePath(szSrcBinPath, APPLICATION_EXE_FILE) + " " + MakePath(szSrcBinPath, APPLICATION_PENGE_FILE) + " " + szSamplerPath$
  346. '        CreateProgmanItem STR_COMPANYNAME, STR_PRODUCTNAME, szInf, szInf, cmoOverwrite
  347. '         CreateProgmanItem STR_COMPANYNAME, STR_README, EDITOR_EXE + MakePath(szSrcBinPath, APPLICATION_README_FILE), "", cmoOverwrite
  348. '    else
  349. '        szInf$ = MakePath(szDestPath, APPLICATION_MENU_FILE) + " " + MakePath(szDestPath, APPLICATION_EXE_FILE) + " " + MakePath(szDestPath, APPLICATION_PENGE_FILE) + " " + szSamplerPath$
  350. '        CreateProgmanItem STR_COMPANYNAME, STR_PRODUCTNAME, szInf, szInf, cmoOverwrite
  351. '        CreateProgmanItem STR_COMPANYNAME, STR_README, EDITOR_EXE + MakePath(szDestPath, APPLICATION_README_FILE), "", cmoOverwrite
  352. '    end if
  353.  
  354. 'IF NO SAMPLER
  355. '    if szMinimalInstall = "ON" then
  356. '        szInf$ = MakePath(szSrcBinPath, APPLICATION_EXE_FILE) + " " + MakePath(szSrcBinPath, "dkpage")'APPLICATION_PENGE_FILE)
  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_EXE_FILE) + " " + MakePath(szDestPath, "dkpage")'APPLICATION_PENGE_FILE)
  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.     'uninstall icon
  366.     szDKUninstall$ = szWinDrive + ":" +  DKREG_INI_DIR
  367.     szInf$ = MakePath( szDKUninstall, UNINSTALL_EXE_FILE)
  368.     CreateProgmanItem STR_COMPANYNAME, STR_UNINSTALL, szInf, szInf, cmoOverwrite
  369.  
  370. '$IFDEF DEBUG
  371.     DumpCopyList MakePath(szDestPath, "copylist.txt")
  372. '$ENDIF ''DEBUG
  373.  
  374.     EndCommonInstall APPLICATION_README_FILE, 0, EDITOR_EXE
  375.  
  376. quit:
  377.     on error goto quit
  378.  
  379.     select case ERR
  380.  
  381.     case 0
  382.         hDlg = IDD_EXITSUCCESS
  383.     case STFQUIT
  384.         hDlg = IDD_EXITQUIT
  385.     case ERR_NODISKSPACE
  386.         hDlg = IDD_NODISKSPACE
  387.     case else
  388.         hDlg = IDD_EXITFAILURE
  389.     end select
  390.  
  391.     UIPop 10
  392. quit2:
  393.     szButton = UIStartDlg(CUIDLL_FILENAME, hDlg, "FInfo0DlgProc", 0, "")
  394.     select case szButton
  395.     case "REACTIVATE"
  396.         goto quit2
  397.     end select
  398.  
  399.     UIPop 1
  400.     DeInitialise
  401.     stop
  402.     end
  403.  
  404. quitError:
  405.     dButton = DoMsgBox (STR_QUITERROR, STR_MSGCAPTION, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  406.     DeInitialise
  407.     stop
  408.     end
  409.  
  410.  
  411. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  412.  
  413. Sub Install() STATIC
  414.  
  415.     cursor% = ShowWaitCursor()
  416.     CreateDir szDestPath, cmoNone
  417.     SetRestartDir szDestPath
  418.     RestoreCursor(cursor%)
  419.  
  420.     CopyFilesInCopyList  'creates dir even if min install
  421.  
  422. 'IF LATER PROD OR WITH SAMPLER
  423.     Run ("regedit.exe /s " + MakePath(szWinPath, "mplayer.reg"))
  424.     Run ("regedit.exe /s " + MakePath(szWinSysPath, "OLE2.reg"))
  425.     Run ("regedit.exe /s " + MakePath(szWinSysPath, "cleanup.reg"))
  426.     Run ("profdisp.exe")
  427.  
  428.     if INI_FILE_SOURCE = "AppPath" then
  429.         szAppINIPath = MakePath(szDestPath, APPLICATION_INI_FILE)
  430.     else
  431.         szAppINIPath = MakePath(szWinPath, APPLICATION_INI_FILE)
  432.     end if
  433.  
  434.        '=d:\                                    =d:\dksetup                =dksetup
  435.     szPengePath = mid$(szSrcSetupPath, 1,len(szSrcSetupPath)-len(SOURCE_SETUP_SUBDIR)-2) ' -2 removes backslash
  436.  
  437. 'IF SCRUNGED
  438. '    if szMinimalInstall = "OFF"  then
  439. 'data
  440.         CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, PRODUCT_INI_DIR_ENTRY_NAME, szPengePath, cmoOverwrite
  441. '    endif
  442.  
  443. 'IF DEBUG VERSION
  444. 'data
  445. '    CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, PRODUCT_INI_DIR_ENTRY_NAME, MakePath(szPengePath,"data"), cmoOverwrite
  446. 'pages
  447. '    CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, "Pages", MakePath(szPengePath,"dkpage"), cmoOverwrite
  448. '    CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, "Scrunge", "0", cmoOverwrite
  449. '    CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, "Developer", "1", cmoOverwrite
  450. '    CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, "MungedSprites", "0", cmoOverwrite
  451. '    CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, "Debug", "1", cmoOverwrite
  452.  
  453.  
  454. End Sub
  455.  
  456.  
  457. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  458. Sub AddFilesToCopyList(szInstallType$) STATIC
  459.     cursor% = ShowWaitCursor()
  460.  
  461. 'for uninstall
  462.     szDKUninstall$ = szWinDrive + ":" +  DKREG_INI_DIR
  463.     AddSectionFilesToCopyList "UNINSTALL", szSrcBinPath, szDKUninstall
  464.  
  465. '    select case szInstallType
  466. '    case "FULL"
  467.         AddSectionFilesToCopyList SETUP_INI_BINARIES_SECTION_NAME, szSrcBinPath, szDestPath
  468.  
  469. '   Shared Files
  470. 'ONLY FOR MUSEUM TITLES AT THE MOMENT! DKSWTCHW.EXE
  471.         AddSectionFilesToCopyList SETUP_INI_SH_BINARIES_SECTION_NAME, szSrcBinPath, szWinDrive + ":" + DKREG_INI_DIR
  472.  
  473. '    case "MINIMAL"
  474. '        ' nothing
  475. '    end select
  476.  
  477. 'IF EARLIER PRODS AND NO SAMPLER
  478. '    if fSystemUpdated = 1 then
  479. '        AddSectionFilesToCopyList "ACM Drivers", szSrcBinPath, szWinSysPath
  480. '    end if
  481.  
  482.  
  483. 'IF LATER PROD OR WITH SAMPLER
  484.         AddSectionFilesToCopyList SETUP_INI_WING_BINARIES_NAME, szSrcBinPath, szWinSysPath
  485.         AddSectionFilesToCopyList SETUP_INI_WING32_BINARIES_NAME, szSrcBinPath, szWinSysPath
  486.         AddSectionFilesToCopyList "VfW Runtime", szSrcBinPath, szWinSysPath
  487.         AddSectionFilesToCopyList "OLE2", szSrcBinPath, szWinSysPath
  488.         AddSectionFilesToCopyList "ACM Drivers", szSrcBinPath, szWinSysPath
  489.         AddSectionFilesToCopyList "MPlayer", szSrcBinPath, szWinPath
  490.         AddSectionFilesToCopyList "AVICodecs", szSrcBinPath, szWinSysPath
  491.  
  492.     RestoreCursor(cursor%)
  493. End Sub
  494.  
  495.  
  496. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  497. 'IF USING SPECIFIC FONTS
  498. 'Sub UpdateFonts() STATIC
  499. '    ' Check TT enabled
  500. '    MakeListFromSectionFilename "Fonts_list", "Fonts"
  501. '
  502. '    listLength% = GetListLength("Fonts_list")
  503. '    if listLength% > 0 then
  504. '        for item% = 1 to listLength%
  505. '            szFontFile$ = GetListItem("Fonts_list", item%)
  506. '            ' Check if exists
  507. '            'Install font
  508. '            ret% = InstallFont(MakePath(szSrcBinPath, szFontFile))
  509. '            ' Write WIN.INI
  510. '        next
  511. '    end if
  512. 'End Sub
  513.  
  514.  
  515.  
  516. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  517. Sub CreateReg() STATIC
  518.  
  519.     szDKREgIni$ = szWinDrive + ":" +  DKREG_INI_PATH
  520.     szProdName$ = STR_PRODUCTNAME
  521.     if DoesFileExist( szDKREgIni$, femExist) = 0 then
  522.         'dkreg.ini doesn't exist - initialize AppCount, create dir, add to InstalledApp
  523.         AppCount% = 1
  524.         CreateDir (szWinDrive+":"+DKREG_INI_DIR), cmoNone
  525.         CreateIniKeyValue szDKREgIni$, "InstalledApp", "Applications", str$(AppCount%), cmoOverwrite
  526.         szNum$=str$(AppCount%)
  527.         CreateIniKeyValue szDKREgIni$, "InstalledApp",ltrim$(szNum), szProdName$, cmoOverwrite
  528.     else
  529.         if DoesIniSectionExist( szDKREgIni$, szProdName$ )=1  then
  530.             szDiffPath$=GetIniKeyString(szDKREgIni$, szProdName$, "Path")
  531.         '     if(szDestPath$  <> szDiffPath$) then
  532.                'product is already installed in a different dir - delete files and dir and ini section, don't change installed app section
  533.                ret% = DeleteFiles (szDiffPath, szProdName, szDKREgIni)
  534.                ret% = DeleteDir (szDiffPath)
  535.                ret% = DeleteSection(szProdName, szDKREgIni)
  536.         '      endif
  537.              'product is installed in same dir - do nothing, will overwrite
  538.         else
  539.               'product name does not exist - increment AppCount, add to InstalledApp
  540.                szAppCount$ = GetIniKeyString( szDKREgIni$, "InstalledApp", "Applications" )
  541.                AppCount% = Val(szAppCount$) + 1
  542.                CreateIniKeyValue szDKREgIni$, "InstalledApp", "Applications", str$(AppCount%), cmoOverwrite
  543.                'assign product to first available number (maybe gaps due to deletion)
  544.                i%=1
  545.                while( GetIniKeyString( szDKREgIni$, "InstalledApp",str$(i%) )<>"")
  546.                    i=i+1
  547.                wend
  548.                szNum$=str$(i%)
  549.                CreateIniKeyValue szDKREgIni$, "InstalledApp",ltrim$(szNum), szProdName$, cmoOverwrite
  550.         endif
  551.      endif
  552.  
  553.     CreateIniKeyValue szDKREgIni$, "InstalledApp","RecentLang", LANG_DLL, cmoOverwrite
  554.     CreateIniKeyValue szDKREgIni$, szProdName$, "Path", szDestPath, cmoOverwrite
  555.     CreateIniKeyValue szDKREgIni$, szProdName$, "Company", STR_COMPANYNAME, cmoOverwrite
  556.     CreateIniKeyValue szDKREgIni$, szProdName$, "Readme", STR_README, cmoOverwrite
  557.     CreateIniKeyValue szDKREgIni$, szProdName$, "Exe", szDestPath + "\" + APPLICATION_EXE_FILE, cmoOverwrite
  558.     CreateIniKeyValue szDKREgIni$, szProdName$, "1", APPLICATION_INI_FILE , cmoOverwrite  'Ini
  559. '    if szMinimalInstall = "OFF" then
  560.         MakeListFromSectionFilename "BIN_list", "BIN"
  561.         listLength% = GetListLength("BIN_list")
  562.         if listLength% > 0 then
  563.             for item% = 1 to listLength%
  564.                 szBinFile$ = GetListItem("BIN_list", item%)
  565.                 szNum$=str$(item%+1)
  566.                 CreateIniKeyValue szDKREgIni$, szProdName$, ltrim$(szNum), szBinFile , cmoOverwrite
  567.             next
  568.         end if
  569. '    end if
  570.  
  571. '    listLength% = GetListLength("Fonts_list")
  572. '    if listLength% > 0 then
  573. '        for item% = 1 to listLength%
  574. '            szFontFile$ = GetListItem("Fonts_list", item%)
  575. '            szNum$=str$(item%)
  576. '            CreateIniKeyValue szDKREgIni$, szProdName$,"F"+ltrim$(szNum), szFontFile, cmoOverwrite
  577. '        next
  578. '    end if
  579.  
  580. End Sub
  581.  
  582.  
  583.  
  584.