home *** CD-ROM | disk | FTP | other *** search
- '**************************************************************************
- '* Project : KHK-Setup-Routinen
- '*-------------------------------------------------------------------------
- '* Module : Setup
- '*-------------------------------------------------------------------------
- '* File : PCKWIN.MST
- '*-------------------------------------------------------------------------
- '* Datum : 21/04/93
- '*-------------------------------------------------------------------------
- '* von : (C) 1993 KHK Software Klaus Klinger
- '*-------------------------------------------------------------------------
- '* Aufgabe : Installationsscript fⁿr den PC-Kaufmann
- '*-------------------------------------------------------------------------
- '* History : 21/04/93 Erstellt Klaus Klinger
- '**************************************************************************
-
- '* INCLUDES ---------------------------------------------------------------
-
- '$INCLUDE 'setupapi.inc'
- '$INCLUDE 'msdetect.inc'
- '$INCLUDE 'khksetup.inc'
-
- '* DEFINES ----------------------------------------------------------------
-
- CONST KHKMSG = "Setup Nachricht"
- CONST KHKDRIVE1 = "Windows Laufwerk ('"
- CONST KHKDRIVE2 = "') ist ungⁿltig."
-
- CONST TRUE = 1
- CONST FALSE = 0
- CONST ABORT = -1
- CONST HDMEMORY = -2
- CONST ABORTALL = -3
-
- CONST BASEDIR = "\DATA"
- CONST DEMODATEN = "\1"
- CONST STAMM = "\STAMM"
-
- CONST QUESTION = MB_YESNOCANCEL+MB_TASKMODAL+MB_QUESTION
- CONST OKMSG = MB_OK+MB_TASKMODAL+MB_ICONHAND
-
- '* GLOBALS ----------------------------------------------------------------
-
- GLOBAL szExecDir$
- GLOBAL szDataDir$
- GLOBAL szTempDir$
- GLOBAL szWindDir$
- GLOBAL szCountry$
-
- GLOBAL DestOldDataDir$
- GLOBAL UseOption$ ''
-
- GLOBAL nUpdate%
- GLOBAL nUser%
-
- '* DECLARES ---------------------------------------------------------------
-
- '*
- '* Interne Deklarationen *****************************************************
- '*
-
- DECLARE SUB WriteSystemInfo
- DECLARE FUNCTION Install AS INTEGER
- DECLARE FUNCTION GetCompany(szUserName$,szCompany$,szSerial$) AS INTEGER
- DECLARE FUNCTION TestPath (szDir$) AS INTEGER
- DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
-
- '*
- '* Externe Deklarationen *****************************************************
- '*
-
- DECLARE FUNCTION GetFreeSpace LIB "kernel" (Dummy%) AS LONG
- DECLARE FUNCTION ShowWindow LIB "user" (hWnd%,nType%) AS INTEGER
-
- INIT:
- bOk%=GetInstallState(VARPTR(nUpdate%),VARPTR(nUser%))
-
- SetBitmap RESDLL$,LOGOBITMAP+nUpdate%
-
- szStr$=STRING$(80,32)
- bOk%=GetVersionInfo(NULL,szStr$)
- SetTitle "Installation des "+szStr$
- SetAbout "KHK Setup","Version 1.1"
-
- hWnd% = HwndFrame()
- bOk% = ShowWindow(hWnd%,3)
-
- '*
- '* Test, ob vorhandener Speicher ausreichend ist *********************
- '*
-
- Memory&=GetFreeSpace(0)
- IF Memory& < MINMEMORY& THEN
- sz$ = UIStartDlg(CUIDLL$,IDD_OUTOFMEMORY,"InfoDlgProc",0,"")
- UIPop 1
- IF nUpdate% = VER_UPDATE THEN
- ERR = IDD_EXITFAILURE_UPDATE
- ELSE
- ERR = IDD_EXITFAILURE
- END IF
-
- GOTO QUIT
- END IF
-
- '*
- '* Verzeichnisse vorbelegen ******************************************
- '*
-
- szWindDir$ = GetWindowsDir
- szTempDir$ = GetWindowsDir
-
- szInfoFile$ = GetSymbolValue("STF_SRCINFPATH")
- IF szInfoFile$ = "" THEN
- szInfoFile$ = GetSymbolValue("STF_CWDDIR") + STDINFFILE
- END IF
- ReadInfFile szInfoFile$
-
- szExecDir$ = STRING$(128,32)
- szDataDir$ = STRING$(128,32)
- szTempDir$ = STRING$(128,32)
-
- KHKIniFile$ = MakePath(szWindDir$,"WIN.INI")
- szCountry$ = GetIniKeyString(KHKIniFile$,"intl","iCountry")
-
- '*
- '* Alte Pfade ermitteln ...
- '*
- szIniFile$=STRING$(96,32)
- bOk%=GetInstallFlags(OPT_INIFILE,VTYPE_STR,szIniFile$)
- IF bOk% <> -1 THEN
- KHKIniFile$ = MakePath(szWindDir$,szIniFile$)
-
- szExecDir$ = GetIniKeyString(KHKIniFile$,"Path","ExecDir")
- szDataDir$ = GetIniKeyString(KHKIniFile$,"Path","BaseDir")
- szTempDir$ = szDataDir$ + "\temp"
-
- IF LEN(szExecDir$)=0 OR LEN(szDataDir$)=0 THEN
- szExecDir$ = STRING$(128,32)
- szDataDir$ = STRING$(128,32)
- szTempDir$ = STRING$(128,32)
-
- bOk% = GetDefaultPath(szExecDir$,szDataDir$,szTempDir$)
- END IF
- ELSE
- bOk% = GetDefaultPath(szExecDir$,szDataDir$,szTempDir$)
- END IF
-
- '*
- '* Installationsverzeichnis abfragen *********************************
- '*
-
- GETPATH:
- SetSymbolValue "ExecDirInp",szExecDir$
- SetSymbolValue "DataDirInp",szDataDir$
- SetSymbolValue "CountryInp",szCountry$
-
- SetSymbolValue "EditFocus","END"
-
- GETPATHL1:
- IF nUser% <> 1 THEN
- nDlg%=IDD_GETPATH_UPDATE
- ELSE
- nDlg%=IDD_GETPATH
- END IF
- sz$ = UIStartDlg(CUIDLL$,nDlg%,"PathDlgProc",0,"")
- szExecDir$ = GetSymbolValue("ExecDirOut")
- szExecDir$ = UCASE$(szExecDir$)
-
- szDataDir$ = GetSymbolValue("DataDirOut")
- szDataDir$ = UCASE$(szDataDir$)
-
- szCountry$ = GetSymbolValue("CountryOut")
- SetSymbolValue "CountryInp",szCountry$
-
- IF sz$ = "CONTINUE" THEN
- bOk% = TestPath(szExecDir$)
- IF bOk% = TRUE THEN
- '* KHKIniFile$ = MakePath(szWindDir$,"PCKWIN.INI")
- '* sz$ = GetIniKeyString(KHKIniFile$,KHKPATHSECTION,"ExecDir")
- '* IF sz$ <> "" THEN
- '* '* AND sz$ = DestProgDir$ THEN
- '* sz$ = FindFileInTree("pckwin.exe",sz$)
- '* IF sz$ <> "" THEN
- '* '* HasPatched(sz$) ...
- '* END IF
- '* END IF
- UIPop 1
- ELSE
- GOTO GETPATHL1
- END IF
-
- bOk% = TestPath(szDataDir$)
- IF bOk% = FALSE THEN
- GOTO GETPATHL1
- END IF
- ELSE
- GOSUB ASKQUIT
- GOTO GETPATH
- END IF
-
- '*
- '* Installationsart abfragen *****************************************
- '*
-
- INSTALLTYPE:
- IF nUpdate% = VER_UPDATE THEN
- sz$ = "STANDARD"
- ELSE
- UseOption$ = "UseOption"
- sz$ = UIStartDlg(CUIDLL$,IDD_INSTALLTYPE,"InstallDlgProc",0,"")
- UIPop 1
- END IF
-
- IF sz$ = "STANDARD" THEN
- bOk%=GetOptionList(szCountry$,-1)
- bOk%=Install
- IF bOk% = FALSE THEN
- IF nUpdate% = VER_UPDATE THEN
- ERR = IDD_EXITFAILURE_UPDATE
- ELSE
- ERR = IDD_EXITFAILURE
- END IF
- GOTO QUIT
- ELSEIF bOk% = ABORT THEN
- GOTO INSTALLTYPE
- ELSEIF bOk% = HDMEMORY THEN
- GOTO GETPATH
- ELSEIF bOk% = ABORTALL THEN
- GOTO QUITALL
- END IF
- GOTO QUIT
- ELSEIF sz$ = "MINIMAL" THEN
- bOk%=GetOptionList(szCountry$,0)
- bOk%=Install
- IF bOk% = FALSE THEN
- IF nUpdate% = VER_UPDATE THEN
- ERR = IDD_EXITFAILURE_UPDATE
- ELSE
- ERR = IDD_EXITFAILURE
- END IF
- GOTO QUIT
- ELSEIF bOk% = ABORT THEN
- GOTO INSTALLTYPE
- ELSEIF bOk% = HDMEMORY THEN
- GOTO GETPATH
- ELSEIF bOk% = ABORTALL THEN
- GOTO QUITALL
- END IF
- GOTO QUIT
- ELSEIF sz$ = "CUSTOM" THEN
- GOTO OPTION
- ELSE
- GOTO GETPATH
- END IF
-
- OPTION:
- UseOption$ = "UseOption"
-
- '*
- '* Bereits installierte Komponenten nicht aktivieren *****************
- '*
-
- OPTION1:
- sz$ = UIStartDlg(CUIDLL$,IDD_OPTIONS,"OptionsDlgProc",0,"")
-
- IF sz$ = "CONTINUE" THEN
- UIPop 1
- ELSE
- UIPop 1
- GOTO INSTALLTYPE
- END IF
-
- ProcedAll:
- bOk%=Install
-
- IF bOk% = FALSE THEN
- IF nUpdate% = VER_UPDATE THEN
- ERR = IDD_EXITFAILURE_UPDATE
- ELSE
- ERR = IDD_EXITFAILURE
- END IF
- GOTO QUIT
- ELSEIF bOk% = ABORT THEN
- GOTO INSTALLTYPE
- ELSEIF bOk% = HDMEMORY THEN
- GOTO GETPATH
- ELSEIF bOk% = ABORTALL THEN
- GOTO QUITALL
- END IF
-
- QUIT:
- ON ERROR GOTO ERRQUIT
-
- IF ERR = 0 THEN
- IF nUpdate% = VER_UPDATE THEN
- dlg% = IDD_EXITSUCCESS_UPDATE
- ELSE
- dlg% = IDD_EXITSUCCESS
- END IF
- ELSEIF ERR = STFQUIT THEN
- IF nUpdate% = VER_UPDATE THEN
- dlg% = IDD_EXITQUIT_UPDATE
- ELSE
- dlg% = IDD_EXITQUIT
- END IF
- ELSE
- IF nUpdate% = VER_UPDATE THEN
- dlg% = IDD_EXITFAILURE_UPDATE
- ELSE
- dlg% = IDD_EXITFAILURE
- END IF
- END IF
- QUITL1:
- sz$ = UIStartDlg(CUIDLL$,dlg%,"InfoDlgProc",0,"")
- IF sz$ = "CONTINUE" THEN
- GOTO QUITL1
- END IF
- UIPop 1
- END
-
- ERRQUIT:
- i% = DoMsgBox("Setup-Dateien sind beschΣdigt, benachrichtigen Sie bitte KHK!",KHKMSG,OKMSG)
- QUITALL:
- END
-
- ASKQUIT:
- sz$ = UIStartDlg(CUIDLL$,IDD_ASKQUIT,"InfoDlgProc",0,"")
-
- IF sz$ = "EXIT" THEN
- UIPopAll
- END
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO ASKQUIT
- ELSE
- UIPop 1
- END IF
- RETURN
-
- '*============================================================================
- '* Funktion : Install
- '*============================================================================
- '* Aufgabe : CopyList aufbauen und alle erforderlichen Operationen für die
- '* Installation durchführen
- '*----------------------------------------------------------------------------
- '* Parameter: Keine
- '*----------------------------------------------------------------------------
- '* Return : BOOL TRUE/FALSE
- '*==========================================================================*/
-
- FUNCTION Install STATIC AS INTEGER
- szUserName$ = STRING$(64,32)
- szCompany$ = STRING$(64,32)
- szSerial$ = STRING$(64,32)
-
- bExec%=FALSE
- bDemo%=FALSE
-
- CreateDir szExecDir$,cmoNone
- OpenLogFile MakePath(szExecDir$,"LOGFILE.OUT"),TRUE
-
- bNet% = IsDriveNetwork(MID$(szExecDir$,1,1))
- szBuffer$ = STRING$(64,32)
-
- SrcDir$ = GetSymbolValue("STF_SRCDIR")
-
- CreateDir szDataDir$, cmoNone
- CreateDir szDataDir$ + "\1",cmoNone
- CreateDir szDataDir$ + "\TEMP",cmoNone
- CreateDir szDataDir$ + "\STAMM",cmoNone
- '* CreateDir szExecDir$ + "\BACKUP",cmoNone
-
- szTempDir$=szDataDir$ + "\TEMP"
-
- '*
- '* Write Logfile *****************************************************
- '*
-
- WriteSystemInfo
-
- nEntry%=GetListLength(UseOption$)
-
- szSec$=STRING$(96,32)
- szPath$=STRING$(96,32)
- szOpt$=STRING$(10,32)
-
- FOR nCount%=1 TO nEntry%
- sz$=GetListItem(UseOption$,nCount%)
- iSec%=GetListSection(sz$,szSec$,szPath$)
-
- IF iSec% <> -1 THEN
- bOk%=GetSectionString(iSec%,NULL,NULL,NULL,szOpt$,NULL)
- IF VAL(szOpt$)=0 THEN
- bExec%=TRUE
- END IF
-
- bOk%=ExpandMacros(szPath$,szPath$,szExecDir$,szDataDir$,szTempDir$,szWindDir$)
- AddSectionFilesToCopyList szSec$,SrcDir$,szPath$
- IF szPath$=szDataDir$ + "\1" THEN
- bDemo%=TRUE
- END IF
- '* i% = DoMsgBox("ADD:" + szSec$ + " - " + szPath$,KHKMSG,OKMSG)
- END IF
- NEXT nCount%
-
-
- sz$ = UIStartDlg(CUIDLL$,IDD_WAITPLEASE,"MessageDlgProc",0,"")
-
- szCosts$ = "Cost"
- szNeeded$ = "Need"
- dwLong& = GetCopyListCost("",szCosts$,szNeeded$)
- IF dwLong& <> 0 THEN
- bMem% = FALSE
- FOR nCount%=1 To 26
- sz$ = GetListItem(szNeeded$,nCount%)
- Size& = VAL(sz$)
- IF Size& > 0 THEN
- sz$ = STR$(Size& / 1000)
- bOk% = DoMsgBox("Sie ben÷tigen mindestens noch" + sz$ + " KB"+CHR$(13)+"auf Laufwerk " + CHR$(nCount% + 64) + ":\",KHKMSG,OKMSG)
-
- ClearCopyList
- CloseLogFile
- Install=HDMEMORY
-
- bMem% = TRUE
- END IF
- NEXT nCount%
-
- IF bMem% = TRUE THEN
- UIPop 1
- EXIT FUNCTION
- END IF
- END IF
-
- UIPop 1
-
- nEntry%=GetInstallFlags(OPT_BILLBOARD,VTYPE_INT,NULL)
- IF nEntry% THEN
- bOk%=SetPictureCount(0)
- FOR nCount%=1 TO nEntry%
- AddToBillboardList CUIDLL$,IDD_PICTURE,"PictureDlgProc",5
- NEXT nCount%
- END IF
-
- bOk% = GetInstallFlags(OPT_DBSTST,VTYPE_INT,NULL)
- IF bOk%=TRUE AND bExec%=TRUE AND nUpdate% <> VER_UPDATE THEN
- bOk% = GetCompany(szUserName$,szCompany$,szSerial$)
-
- WriteToLogFile " Anwendername " + szUserName$
- WriteToLogFile " Firmenname " + szCompany$
- WriteToLogFile " Land " + szCountry$
- WriteToLogFile ""
-
- IF bOk% = FALSE THEN
- Install = ABORT
- EXIT FUNCTION
- END IF
- END IF
-
- bOk%=GetScreenInfo(VARPTR(DlgX%),VARPTR(DlgY%))
- SetCopyGaugePosition DlgX%-150,DlgY%-80
-
- IF bDemo% = TRUE THEN
- bOk%=ExDelDir(szDataDir$+"\1",0)
- END IF
-
- bOk% = CopyFilesInCopyList
- IF bOk% = grcUserQuit THEN
- Install = ABORTALL
- CloseLogFile
- EXIT FUNCTION
- END IF
-
- '* DumpCopyList "e:\PCKWIN.LST"
-
- '*
- '* Create Global Profileentries **************************************
- '*
-
- nEntry%=GetProfileEntry
- IF nEntry% > 0 AND bExec%=TRUE THEN
- szFile$=STRING$(96,32)
- szSec$=STRING$(32,32)
- szKey$=STRING$(32,32)
- szVal$=STRING$(128,32)
-
- FOR nType%=0 TO nEntry%
- bOk%=GetProfileItem(nType%,szFile$,szSec$,szKey$,szVal$)
-
- bOk%=ExpandMacros(szFile$,szFile$,szExecDir$,szDataDir$,szTempDir$,szWindDir$)
- bOk%=ExpandMacros(szSec$,szSec$,szExecDir$,szDataDir$,szTempDir$,szWindDir$)
- bOk%=ExpandMacros(szVal$,szVal$,szExecDir$,szDataDir$,szTempDir$,szWindDir$)
-
- IniFile$=MakePath(szWindDir$,szFile$)
- CreateIniKeyValue IniFile$,szSec$,szKey$,szVal$,cmoOverwrite
- NEXT nType%
- END IF
-
- '*
- '* Btrieve-Test ******************************************************
- '*
- bOk% = GetInstallFlags(OPT_DBSTST,VTYPE_INT,NULL)
- IF bOk%=TRUE AND bExec%=TRUE AND nUpdate% <> VER_UPDATE THEN
- hWnd% = HwndFrame()
- szDbsVer$=STRING$(20,32)
-
- Res% = MakeBtrvTest(hWnd%,FALSE,szDataDir$,szDataDir$ + "\TEMP",szDbsVer$)
- i% = GetBtrvErrorState(Res%,szBuffer$)
-
- WriteToLogFile ""
- WriteToLogFile "Btrieve-Test"
- WriteToLogFile ""
- WriteToLogFile " BTrieve-Version :" + szDbsVer$
-
- IF Res% = 0 THEN
- WriteToLogFile " Der Test wurde erfolgreich abgeschloßen: "+STR$(Res%)+" "+szBuffer$
- ELSE
- WriteToLogFile " Der Test wurde nicht erfolgreich abgeschloßen."
- WriteToLogFile " Fehlercode des Testroutine: " + STR$(Res%)+" "+szBuffer$
-
- IF Res% = -7 THEN
- Install = ABORT
- EXIT FUNCTION
- END IF
-
- i% = DoMsgBox("Btrieve-Test fehlgeschlagen: "+STR$(Res%),KHKMSG,OKMSG)
-
- CloseLogFile
- EXIT FUNCTION
- END IF
- WriteToLogFile ""
- END IF
-
- '*
- '* Create Groupfile for KHK-Application ******************************
- '*
-
- nEntry%=GetGroupEntry
- IF nEntry%>0 AND bExec%=TRUE THEN
- szGroup$=STRING$(32,32)
- szPath$=STRING$(96,32)
- szCmd$=STRING$(96,32)
-
- FOR nType%=0 TO nEntry%
- bOk%=GetGroupString(nType%,szGroup$,szPath$,szCmd$)
-
- bOk%=ExpandMacros(szPath$,szPath$,szExecDir$,szDataDir$,szTempDir$,szWindDir$)
- bOk%=ExpandMacros(szCmd$,szCmd$,szExecDir$,szDataDir$,szTempDir$,szWindDir$)
-
- CreateProgmanGroup szGroup$,"",cmoNone
- ShowProgmanGroup szGroup$, 1,cmoNone
- CreateProgmanItem szGroup$,szPath$,szCmd$,"",cmoOverwrite
- NEXT nType%
- END IF
-
- '*
- '* Seriennummer patchen **********************************************
- '*
-
- bOk% = GetInstallFlags(OPT_PATCH,VTYPE_INT,NULL)
- IF bOk%=TRUE AND bExec%=TRUE THEN
- IF nUpdate% = VER_UPDATE THEN
- szExecName$=STRING$(96,32)
-
- bOk% = GetInstallFlags(OPT_APPEXEC,VTYPE_STR,szExecName$)
- IF LEN(szExecName) > 0 THEN
- bOk% = GetAppUserInfo(szExecDir$,szExecName$,szUserName$,szCompany$,szSerial$)
- bOk% = PatchFilesEx(szExecDir$,szUserName$,szCompany$,szSerial$)
- END IF
- ELSE
- bOk% = PatchFilesEx(szExecDir$,szUserName$,szCompany$,NULL)
- END IF
-
- IF bOk% THEN
- WriteToLogFile " Kein Fehler beim serialisieren des PC-Kaufmanns aufgetreten."
- ELSE
- i% = DoMsgBox("Es ist ein Fehler beim Eintragen der Seriennummer aufgetreten!",KHKMSG,OKMSG)
- WriteToLogFile " Fehler beim serialisieren des PC-Kaufmanns aufgetreten"
- END IF
- ELSE
- bOk% = TRUE
- END IF
-
- CloseLogFile
- Install = bOk%
- END FUNCTION
-
- '*============================================================================
- '* Funktion : GetCompany
- '*============================================================================
- '* Aufgabe : Anwendername und Firma ermitteln
- '*----------------------------------------------------------------------------
- '* Parameter: szUserName$ Anwendername
- '* szCompany$ Firmenname
- '*----------------------------------------------------------------------------
- '* Return : BOOL TRUE/FALSE
- '*==========================================================================*/
-
- FUNCTION GetCompany(szUserName$,szCompany$,szSerial$) STATIC AS INTEGER
- SetSymbolValue "EditUser", szUserName$
- SetSymbolValue "EditCompany", szCompany$
- SetSymbolValue "EditFocus", "END"
-
- sz$ = UIStartDlg(CUIDLL$,IDD_COMPANY,"CompanyDlgProc",0,"")
- UIPop 1
- szUserName$ = GetSymbolValue("EditUser")
- szCompany$ = GetSymbolValue("EditCompany")
-
- IF sz$ = "CONTINUE" THEN
- GetCompany = TRUE
- ELSE
- GetCompany = FALSE
- END IF
- END FUNCTION
-
- '*============================================================================
- '* Funktion : TestPath
- '*============================================================================
- '* Aufgabe : Test ob ein Pfadname gültig ist.
- '*----------------------------------------------------------------------------
- '* Parameter: szDir$ Verzeichnispfad
- '* MinSpace& Größe
- '*----------------------------------------------------------------------------
- '* Return : INTEGER TRUE/FALSE
- '*==========================================================================*/
-
- FUNCTION TestPath(szDir$) STATIC AS INTEGER
- TestPath=FALSE
- bOk%=FALSE
-
- IF MID$(szDir$,2,1)=":" THEN
- szDrive$=MID$(szExecDir$,1,1)
- ELSE
- szDrive$="C"
- END IF
-
- szDir$ = UCASE$(szDir$)
- FOR i% = 1 TO LEN(szDir$) STEP 1
- Char$ = Mid$(szDir$,i%,1)
- IF ASC(Char$) > 127 OR ASC(Char$) = 45 THEN
- bOk% = TRUE
- sz$ = UIStartDlg(CUIDLL$,IDD_BADPATH,"InfoDlgProc",0,"")
-
- UIPop 1
- EXIT FOR
- END IF
- NEXT i%
-
- IF bOk% THEN
- EXIT FUNCTION
- END IF
-
- IF FValidFATDir(szDir$) = 0 THEN
- sz$ = UIStartDlg(CUIDLL$,IDD_BADPATH,"InfoDlgProc",0,"")
-
- UIPop 1
- EXIT FUNCTION
- END IF
-
- IF IsDirWritable(szDir$) = 0 OR LEN(szDir$)=3 AND MID$(szDir$,2,1)=":" THEN
- '*
- '* Schreibfehler melden, wenn Verzeichnis nicht beschreibar ist
- '*
- sz$ = UIStartDlg(CUIDLL$,IDD_BADPATH2,"InfoDlgProc",0,"")
-
- UIPop 1
- EXIT FUNCTION
- END IF
- TestPath=TRUE
- END FUNCTION
-
- '*============================================================================
- '* Funktion : MakePath
- '*============================================================================
- '* Aufgabe : Anfügen eines Dateinamen an einen Pfad
- '*----------------------------------------------------------------------------
- '* Parameter: szDir$ Verzeichnispfad
- '* szFile$ Dateinamen, der Angefügt werden soll
- '*----------------------------------------------------------------------------
- '* Return : STRING Komplette Pfadnamen
- '*==========================================================================*/
-
- 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
-
- '*============================================================================
- '* Funktion : WriteSystemInfo
- '*============================================================================
- '* Aufgabe : Diverse Angaben über das System ins Logfile schreiben
- '*----------------------------------------------------------------------------
- '* Parameter: Keine
- '*----------------------------------------------------------------------------
- '* Return : Keine
- '*==========================================================================*/
-
- SUB WriteSystemInfo STATIC
- bNetLocal% = FALSE
-
- WinMajorVersion% = GetWindowsMajorVersion()
- WinMinorVersion% = GetWindowsMinorVersion()
-
- DosMajorVersion% = GetDosMajorVersion()
- DosMinorVersion% = GetDosMinorVersion()
-
- WriteToLogFile ""
- WriteToLogFile " Windowsversion : " + LTRIM$(STR$(WinMajorVersion%)) + "." + LTRIM$(STR$(WinMinorVersion%))
- WriteToLogFile " Dosversion : " + LTRIM$(STR$(DosMajorVersion%)) + "." + LTRIM$(STR$(DosMinorVersion%))
- WriteToLogFile ""
- '* WriteToLogFile " Dospfad : " + GetEnvValue("path")
-
- WindowsMode% = GetWindowsMode()
- IF WindowsMode% = 0 THEN
- szMode$ = "Realmode"
- ELSEIF WindowsMode% = 1 THEN
- szMode$ = "Standardmode"
- ELSEIF WindowsMode% = 2 THEN
- szMode$ = "Enhancedmode"
- ELSE
- szMode$="unbekannt"
- END IF
- WriteToLogFile " Windowsmode : " + szMode$
-
- IF IsWindowsShared() THEN
- szMode$="Shared"
- ELSE
- szMode$="non Shared"
- END IF
- WriteToLogFile " Windows ist " + szMode$
-
- CpuType%=GetProcessorType()
- IF CpuType% = 0 THEN
- szCpu$ = "8086"
- ELSEIF CpuType% = 1 THEN
- szCpu$ = "80186"
- ELSEIF CpuType% = 2 THEN
- szCpu$ = "80286"
- ELSEIF CpuType% = 3 THEN
- szCpu$ = "80386"
- ELSEIF CpuType% = 4 THEN
- szCpu$ = "80486"
- ELSE
- szCpu$ = "unbekannt"
- END IF
- WriteToLogFile " Rechnertype : " + szCpu$
-
- Height% = GetScreenHeight()
- Width% = GetScreenWidth()
- WriteToLogFile " Auflösung : " + LTRIM$(STR$(Width%)) + "x" + LTRIM$(STR$(Height%))
-
- Display% = HasMonochromeDisplay()
- IF Display% = 1 THEN
- szDisplay$ = "Monochromedisplay"
- ELSE
- szDisplay$ = "Farbdisplay"
- END IF
- WriteToLogFile " Anzeige : " + szDisplay$
-
- Memory& = GetFreeSpace(0) / 1024
- WriteToLogFile " verfügbarer Speicher in KB : " + LTRIM$(STR$(Memory&))
-
- WriteToLogFile ""
- WriteToLogFile " Anwender wählte folgenden PRG-Pfad : '" + szExecDir$ + "'"
-
- bNetLocal% = IsDriveNetwork(MID$(szExecDir$,1,1))
- IF bNetLocal% = TRUE THEN
- szDriveType$ = "Netzwerklaufwerk"
- ELSE
- szDriveType$ = "lokales Laufwerk"
- END IF
-
- WriteToLogFile " Das PRG-Laufwerk ist ein :" + szDriveType$
- Memory& = GetFreeSpaceForDrive(MID$(szExecDir$,1,1)) / 1024
- WriteToLogFile " Verfügbarer Speicher auf dem PRG-LW : " + LTRIM$(STR$(Memory&)) + "KB"
-
- WriteToLogFile " Anwender wählte folgenden DAT-Pfad : '" + szDataDir$ + "'"
- bNetLocal% = IsDriveNetwork(MID$(szDataDir$,1,1))
- IF bNetLocal% = TRUE THEN
- szDriveType$ = "Netzwerklaufwerk"
- ELSE
- szDriveType$ = "lokales Laufwerk"
- END IF
-
- WriteToLogFile " Das DAT-Laufwerk ist ein :" + szDriveType$
- Memory& = GetFreeSpaceForDrive(MID$(szDataDir$,1,1)) / 1024
- WriteToLogFile " Verfügbarer Speicher auf dem DAT-LW : " + LTRIM$(STR$(Memory&)) + "KB"
-
- WriteToLogFile ""
- WriteToLogFile " Das Verzeichnis wurde angelegt : " + szExecDir$
- WriteToLogFile " Das Datenverzeichnis wurde angelegt : " + szDataDir$
- WriteToLogFile " Das Tempverzeichnis wurde angelegt : " + szDaraDir$+"\TEMP"
- WriteToLogFile " Das Stammverzeichnis wurde angelegt : " + szDataDir$+"\STAMM"
- WriteToLogFile " Windows befindet sich in : " + szWindDir$
-
- szVersion$=STRING$(96,32)
- szAppName$=STRING$(96,32)
- bOk%=GetVersionInfo(szVersion$,szAppName$)
-
- WriteToLogFile " Die Installierte Programmversion ist: " + szAppName$ + " " + szVersion$
- WriteToLogFile " User/State : " + STR$(nUser%) + " / " + STR$(nUpdate%)
- WriteToLogFile ""
- END SUB