home *** CD-ROM | disk | FTP | other *** search
/ Inside Multimedia 1994 November / IMM1194.ISO / demo / steuer / title.mst < prev    next >
Text File  |  1994-08-01  |  7KB  |  301 lines

  1. '' Global variables
  2.  
  3.     GLOBAL TitleShortName$
  4.     GLOBAL TitleLongName$
  5.     GLOBAL MVBFileName$
  6.     GLOBAL PromptForPath%
  7.     GLOBAL DefaultPath$
  8.     GLOBAL ProgManGroup$
  9.     GLOBAL ProgManItem$
  10. '-------------------------
  11. '---- Eigene ─nderung ----
  12. '-------------------------
  13.         GLOBAL szTitleDir$
  14.         GLOBAL HelpFileName$
  15.  
  16. '' ** Setup Variables
  17.     
  18.     TitleShortName$ = "Steuerveranlagungen DEMO"
  19.     
  20.     TitleLongName$ = "Steuerveranlagungen (DEMO)"
  21.         
  22.     MVBFileName$ = "stvademo"
  23.         
  24.     PromptForPath% = 1
  25.         
  26.     DefaultPath$ = "c:\beck"
  27.     
  28.     ProgManGroup$ = "C. H. BECK"
  29.     
  30.     ProgManItem$ = "Steuerveranlagungen DEMO"
  31.     
  32.  
  33. '** Mainline
  34.  
  35.     GLOBAL CUIDLL$
  36.  
  37.     '' Include files
  38.     '$INCLUDE 'setupapi.inc'
  39.     
  40.     '' Custom UI dll
  41.     CUIDLL$ = "mscuistf.dll"
  42.     
  43.     '' Dialog ID's
  44.     CONST DESTPATH      = 1000
  45.     CONST APPHELP       = 2000
  46.     CONST TOOBIG        = 3000
  47.     CONST BADPATH       = 4000
  48.     CONST SUCCESS       = 5000
  49.     
  50.     '' Bitmap ID
  51.     CONST LOGO = 1
  52.     
  53.     '' Functions and subroutines
  54.     DECLARE FUNCTION AddFont LIB "mscuistf.dll" (szFont$, szName$) AS INTEGER
  55.     DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  56.     DECLARE FUNCTION GetTitleDir (szDefault$) AS STRING
  57.     DECLARE FUNCTION CopyFiles(szTitleDir$) AS INTEGER
  58.     DECLARE SUB RegisterFont(fontfile$, fontname$)
  59.     DECLARE SUB ModifyViewerIni
  60.     DECLARE SUB RegisterCustomFonts
  61.         
  62.     DECLARE SUB ModifyProgramManager(szTitleDir$)
  63.     DECLARE SUB ShowSuccess
  64.     DECLARE SUB RegisterDrivers
  65.     
  66.     i% = SetSizeCheckMode(scmOff)
  67.     
  68.     SetTitle "Steuerveranlagungen 1993 (DEMO) Setup"
  69.     SetBitmap CUIDLL$, LOGO 
  70.     
  71.     ReadInfFile GetSymbolValue("STF_CWDDIR") + "TITLE.INF"
  72.     
  73.     '' Decide where to put title files
  74.     IF PromptForPath% = 1 THEN
  75.         szTitleDir$ = GetTitleDir(DefaultPath$)
  76.         IF szTitleDir$ = "" THEN
  77.             GOTO QUIT
  78.         ENDIF
  79.     ELSE
  80.         szTitleDir$ = GetWindowsDir()
  81.     ENDIF   
  82.     
  83.     '' Copy files
  84.     IF CopyFiles(szTitleDir$) = 0 THEN
  85.         GOTO QUIT
  86.     ENDIF
  87.  
  88.     '' Create the MVIEWER2.EXE MVB association 
  89.     CreateIniKeyValue "WIN.INI", "Extensions", "MVB", "mviewer2.exe", cmoNone
  90.  
  91.     '' Register in VIEWER.INI
  92.     ModifyViewerIni
  93.  
  94.     '' Register custom fonts
  95.     RegisterCustomFonts
  96.  
  97.     '' Register drivers
  98.     RegisterDrivers
  99.     
  100.  
  101.     '' Modify Program Manager        
  102.     '+ Here's where we pass the destination directory to the subroutine
  103.     
  104.     ModifyProgramManager(szTitleDir$)    
  105.     
  106.     '' Success dialog
  107.     ShowSuccess
  108.     
  109.     '' Now start the title
  110.     '+ This now concatenates the destination directory with the MVB filename 
  111.     '+ so Viewer can find it the first time.
  112.  
  113.     RUN "mviewer2.exe " + MakePath(szTitleDir$, MVBFileName$ + ".MVB"), NOWAIT
  114.  
  115. QUIT:
  116.     
  117.     END
  118.     
  119.  
  120.  
  121. FUNCTION GetTitleDir (szDefault$) STATIC AS STRING
  122.  
  123.     SetSymbolValue "String", TitleShortName$
  124.     SetSymbolValue "EditTextIn", szDefault$
  125.     SetSymbolValue "EditFocus", "ALL"
  126.  
  127.     GETPATH:
  128.  
  129.     sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, "FHelpDlgProc")
  130.  
  131.     IF sz$ = "CONTINUE" THEN
  132.         szTitleDir$ = GetSymbolValue("EditTextOut")
  133.         IF IsDirWritable(szTitleDir$) = 0 THEN
  134.  
  135.             BADPATH:
  136.  
  137.             sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfoDlgProc", 0, "")
  138.             IF sz$ = "REACTIVATE" THEN
  139.                 GOTO BADPATH
  140.             END IF
  141.             UIPop 1
  142.             GOTO GETPATH
  143.         END IF
  144.         UIPop 1
  145.         CreateDir szTitleDir$, cmoNone
  146.  
  147.     ELSEIF sz$ = "REACTIVATE" THEN
  148.         GOTO GETPATH
  149.  
  150.     ELSE
  151.         szTitleDir$ = ""
  152.  
  153.     END IF
  154.  
  155.     GetTitleDir = szTitleDir$
  156.  
  157. END FUNCTION
  158.  
  159.  
  160. FUNCTION CopyFiles(szTitleDir$) STATIC AS INTEGER
  161.  
  162.     '' Add all system files to the copy list
  163.     AddSectionFilesToCopyList "System Files", GetSymbolValue("STF_SRCDIR"), GetWindowsSysDir()
  164.     
  165.     '' Add all of the title files to the copy list
  166.     AddSectionFilesToCopyList "Installed Title Files", GetSymbolValue("STF_SRCDIR"), szTitleDir$
  167.     
  168.     '' Check size
  169.     szExtras$ = "Extra"
  170.     szCosts$ = "Costs"
  171.     szNeededs$ = "Neededs"
  172.     FOR i% = 1 TO 26 STEP 1
  173.         AddListItem szExtras$, "0"
  174.     NEXT i%
  175.     
  176.     '' We assume that VIEWER.INI will take another 4K
  177.     ReplaceListItem szExtras$, ASC(MID$(GetWindowsDir(), 1, 1)) - ASC("A") + 1, STR$(4096)
  178.     
  179.     '' Get amount of space required
  180.     StillNeed& = GetCopyListCost(szExtras$, szCosts$, szNeededs$)
  181.     
  182.     '' Put up a message if there is not enough space
  183.     FOR i% = 1 TO 26 STEP 1
  184.         IF VAL(GetListItem(szNeededs$, i%)) > 0 THEN
  185.     
  186.             SetSymbolValue "String1", LTRIM$(STR$(VAL(GetListItem(szCosts$, i%)) / 1024))
  187.             SetSymbolValue "String2", CHR$(i% - 1 + ASC("A"))
  188.     
  189.             TOOBIG:
  190.     
  191.             sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfoDlgProc", 0, "")
  192.             IF sz$ = "REACTIVATE" THEN
  193.                 GOTO TOOBIG
  194.             END IF
  195.             UIPop 1
  196.             CopyFiles = 0
  197.             GOTO DONTCOPY
  198.         END IF
  199.     NEXT i%
  200.     
  201.     '' Copy the files
  202.     CopyFilesInCopyList
  203.     
  204.     CopyFiles = 1
  205.  
  206. DONTCOPY:
  207.  
  208. END FUNCTION
  209.  
  210.  
  211. SUB ShowSuccess STATIC
  212.  
  213.     SUCCESS:
  214.     
  215.     SetSymbolValue "String1", TitleShortName$
  216.     sz$ = UIStartDlg(CUIDLL$, SUCCESS, "FInfoDlgProc", 0, "")
  217.     IF sz$ = "REACTIVATE" THEN
  218.         GOTO SUCCESS
  219.     END IF
  220.     UIPop 1
  221.     
  222. END SUB
  223.  
  224.  
  225.  
  226. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  227.     IF szDir$ = "" THEN
  228.         MakePath = szFile$
  229.     ELSEIF szFile$ = "" THEN
  230.         MakePath = szDir$
  231.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  232.         MakePath = szDir$ + szFile$
  233.     ELSE
  234.         MakePath = szDir$ + "\" + szFile$
  235.     END IF
  236. END FUNCTION
  237.  
  238.  
  239.  
  240. SUB RegisterFont(fontfile$, fontname$) STATIC
  241.  
  242.     IF AddFont(fontfile$, fontname$) = -1 THEN
  243.         j% = DoMsgBox("Kann Schriftart " + fontfile$ + " nicht installieren. M÷glicherweise ist diese Schrift bereits auf  Ihrem System installiert.", "Installation Beck Sonderzeichen", 0)
  244.     ENDIF
  245.  
  246. END SUB
  247.  
  248.  
  249. '*************************************************************************
  250. '** Purpose:
  251. '**     Registers title in VIEWER.INI
  252. '*************************************************************************
  253.  
  254. SUB ModifyViewerIni STATIC
  255.  
  256.     '' Get the VIEWER.INI file
  257.     
  258.     szIni$ = MakePath(GetWindowsDir(), "VIEWER.INI")
  259.         szStVADemoIni$= MakePath(GetWindowsDir(), "STVADEMO.INI")
  260.  
  261.     CreateIniKeyValue szIni$, MVBFileName$, "Name", TitleLongName$, cmoOverwrite
  262.     CreateIniKeyValue szIni$, MVBFileName$, "Path", GetSymbolValue("STF_SRCDIR"), cmoOverwrite
  263.     
  264.     CreateIniKeyValue szIni$, "FILES", MVBFileName$ + ".MVB", szTitleDir$ + "," + "Datei ist nicht vorhanden oder beschΣdigt.", cmoOverwrite
  265.  
  266.         CreateIniKeyValue szStVADemoIni$, "ALLGEMEIN", "Datei", "stvademo",cmoOverwrite
  267.         CreateIniKeyValue szStVADemoIni$, "ALLGEMEIN", "Treiber", "bcmmv.dll",cmoOverwrite
  268.  
  269.     CreateIniKeyValue szIni$, "FILES", "bcstva.DLL", GetWindowsSysDir() + "," + "Datei ist nicht vorhanden oder beschΣdigt.", cmoOverwrite
  270.     CreateIniKeyValue szIni$, "FILES", "bcmmv.DLL", GetWindowsSysDir() + "," + "Datei ist nicht vorhanden oder beschΣdigt.", cmoOverwrite
  271.     CreateIniKeyValue szIni$, "FILES", "bcctv.DLL", GetWindowsSysDir() + "," + "Datei ist nicht vorhanden oder beschΣdigt.", cmoOverwrite
  272.  
  273. END SUB
  274.  
  275.  
  276.  
  277. SUB ModifyProgramManager(szDestDir$) STATIC
  278.  
  279.     '' Create the program manager group
  280.  
  281.     CreateProgmanGroup ProgmanGroup$, "", cmoNone
  282.     ShowProgmanGroup ProgmanGroup$, 1, cmoNone
  283.     
  284.     CreateProgmanItem ProgmanGroup$, ProgmanItem$, "mviewer2.exe " +  MakePath(szDestDir$, MVBFileName$ + ".MVB"), MakePath(szDestDir$, mvbFileName$ + ".ico") + ",0,0,0," + szDestDir$, cmoOverwrite
  285. END SUB
  286.  
  287.  
  288.  
  289. SUB RegisterCustomFonts STATIC
  290.        RegisterFont "BCDINGS.TTF", "Beck Sonderzeichen (TrueType)"
  291. END SUB
  292.  
  293.  
  294.  
  295. SUB RegisterDrivers STATIC
  296.  
  297. END SUB
  298.  
  299.  
  300.  
  301.