home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Polish Programs 2
/
polishprograms2.iso
/
multimed
/
fogra
/
pep.mst
< prev
next >
Wrap
Text File
|
1997-10-13
|
6KB
|
219 lines
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
''Dialog ID's
CONST WELCOME = 100
CONST ASKQUIT = 200
CONST DESTPATH = 300
CONST EXITFAILURE = 400
CONST EXITQUIT = 600
CONST EXITSUCCESS = 700
CONST OPTIONS = 800
CONST APPHELP = 900
CONST TOOBIG = 6300
CONST BADPATH = 6400
CONST RESET = 7801
'' rodzaje instalacji z dialogu options
CONST NORMAL = 450
CONST SNMALL = 451
''Bitmap ID
CONST LOGO = 1
GLOBAL DEST$ ''Default destination directory.
GLOBAL DANE$ ''Default data directory.
GLOBAL CUIDLL$
GLOBAL DESTDRV$ '' dest drive
GLOBAL INSTKIND$ '' wybrany rodzaj instalacji
DECLARE SUB Install
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
CONST WM_FONTCHANGE = 29
CONST HWND_BROADCAST = -1
DECLARE FUNCTION CreateScalableFontResource LIB "GDI.EXE" (fHidden%, FOTFile$, TTFFile$, SysDir$) AS INTEGER
DECLARE FUNCTION AddFontResource LIB "GDI.EXE" (FOTFile$) AS INTEGER
DECLARE FUNCTION SendMessage LIB "USER.EXE" (hWnd%, Message%, wParam%, lParam&) AS LONG
DECLARE SUB InstFont (FontFile$)
INIT:
CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
SetBitmap CUIDLL$, LOGO
SetTitle "MEP - program instalacyjny"
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
END IF
ReadInfFile szInf$
DEST$ = "C:\FOGRA"
WELCOME:
sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
UIPop 1
ELSE
GOSUB ASKQUIT
GOTO WELCOME
END IF
GETPATH:
SetSymbolValue "EditTextIn", DEST$
SetSymbolValue "EditFocus", "END"
GETPATHL1:
sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
DEST$ = GetSymbolValue("EditTextOut")
IF sz$ = "CONTINUE" THEN
IF IsDirWritable(DEST$) = 0 THEN
GOSUB BADPATH
GOTO GETPATHL1
END IF
UIPop 1
ELSEIF sz$ = "REACTIVATE" THEN
GOTO GETPATHL1
ELSEIF sz$ = "BACK" THEN
UIPop 1
GOTO WELCOME
ELSE
GOSUB ASKQUIT
GOTO GETPATH
END IF
Install
n% = DoMsgBox("NiezbΩdne jest Video for Windows. Mo┐esz je zainstalowaµ przechodz╣c do katalogu VFW i uruchamiaj╣c program setup." , "UWAGA", MB_OK)
QUIT:
ON ERROR GOTO ERRQUIT
IF ERR = 0 THEN
dlg% = EXITSUCCESS
ELSEIF ERR = STFQUIT THEN
dlg% = EXITQUIT
ELSE
dlg% = EXITFAILURE
END IF
QUITL1:
sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO QUITL1
END IF
UIPop 1
END
ERRQUIT:
i% = DoMsgBox("Uszkodzone pliki programu instalacyjnego", "UWAGA - BúÑD", MB_OK+MB_TASKMODAL+MB_ICONHAND)
END
BADPATH:
sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO BADPATH
END IF
UIPop 1
RETURN
TOOBIG:
sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO TOOBIG
END IF
UIPop 1
RETURN
ASKQUIT:
sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
IF sz$ = "EXIT" THEN
UIPopAll
ERROR STFQUIT
ELSEIF sz$ = "REACTIVATE" THEN
GOTO ASKQUIT
ELSE
UIPop 1
END IF
RETURN
'*********************************************************************
SUB Install STATIC
SrcDir$ = GetSymbolValue("STF_SRCDIR")
CreateDir DEST$, cmoNone
AddSectionFilesToCopyList "InstFiles", SrcDir$ , DEST$
AddSectionFilesToCopyList "WinSysFiles", SrcDir$ , GetWindowsSysDir
IDX$=SrcDir$ + "ENCY\"
CopyFilesInCopyList
CreateProgmanGroup "Fogra", "", cmoNone
ShowProgmanGroup "Fogra", 1, cmoNone
IconPath$ = MakePath(DEST$ ,"pep.ico")
ini$ = MakePath(GetWindowsDir, "PEP.INI")
DANE$=SrcDir$+ "ENCY\"
CreateIniKeyValue ini$, "KATALOGI", "Dane", DANE$ , cmoOverwrite
CreateIniKeyValue ini$, "KATALOGI", "Idx", IDX$ , cmoOverwrite
CreateProgmanItem "Fogra", "MEP 1997", MakePath(SrcDir$ + "ENCY\" ,"winieta.exe"), IconPath$, cmoOverwrite
CreateProgmanItem "Fogra", "MEP Help", MakePath(SrcDir$ + "ENCY\","pep.hlp"), "", cmoOverwrite
InstFont "mep"
'' Inform other applications on the system about the new font.
i%=SendMessage (HWND_BROADCAST, WM_FONTCHAGE, 0, 0)
ENDALL:
END SUB
'*************************************************************************
FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
IF szDir$ = "" THEN
MakePath = szFile$
ELSEIF szFile$ = "" THEN
MakePath = szDir$
ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
MakePath = szDir$ + szFile$
ELSE
MakePath = szDir$ + "\" + szFile$
END IF
END FUNCTION
'*****************************************************************
SUB InstFont (FontFile$) STATIC
SYSDIR$=GetWindowsSysDir()
'' Obtain the .FOT file from the .TTF file.
i%=CreateScalableFontResource (0, SYSDIR$+FontFile$+".FOT", FontFile$+".TTF", SYSDIR$)
'' Inform Windows about the new font without rebooting Windows.
i%=AddFontResource (SYSDIR$+FontFile$+".FOT")
'' Modify the WIN.INI file.
FontName$=STRING$ (64, 32)
i%=GetTypeFaceNameFromTTF (SYSDIR$+FontFile$+".TTF", FontName$, 64)
CreateIniKeyValue "WIN.INI", "fonts", FontName$+" (TrueType)", FontFile$+".FOT", cmoOverwrite
END SUB