home *** CD-ROM | disk | FTP | other *** search
/ Computer Buyer 1996 December / DKMMSAMP.iso / DKSETUP / DKSETUP.MST < prev    next >
Text File  |  1996-04-17  |  32KB  |  851 lines

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