home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgLangD.iso
/
Bonus
/
MULTIMED
/
VCPLAYER
/
POWERVCD.MS_
/
POWERVCD.MS
Wrap
Text File
|
1997-03-11
|
29KB
|
1,064 lines
''#######################################
''
'' VCD PowerPlayer
''
'' Install *.DRV *.DLL *.EXE
''
''#######################################
'' yaya 02/20
'' Copy ReadMe and Manual files according to sLanguage
''
'' yaya 02/21
'' The same language with difference sLanguage will
'' copy the same ReadMe and Manual files
''
'''''$DEFINE DEBUG
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
'$INCLUDE 'msregdb.inc'
''Dialog ID's
CONST WELCOME = 100
CONST ASKQUIT = 200
CONST DESTPATH = 300
CONST EXITFAILURE = 400
CONST EXITQUIT = 600
CONST EXITSUCCESS = 700
CONST APPHELP = 900
CONST RESTART = 1200
CONST DIREXISTS = 1400
CONST BADPATH = 6400
CONST LOGO = 1
GLOBAL DEST$
GLOBAL WINDIR$
GLOBAL WINSYSDIR$
GLOBAL CUIDLL$
GLOBAL SystemIni$
GLOBAL WinIni$
GLOBAL CtrlIni$
GLOBAL DRVR$
GLOBAL MpegLabel$
GLOBAL CDILabel$
GLOBAL WinVer%
DECLARE SUB Install
DECLARE SUB MyCopyFilename (szSrcDir$, szFileName$, szFileExt$)
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
DECLARE FUNCTION GetDriveInPath( szPath$) AS STRING
DECLARE FUNCTION MyGetWinFlags LIB "mscuistf.DLL" AS INTEGER
DECLARE FUNCTION OnWin3x LIB "setuphlp.DLL" AS INTEGER
DECLARE FUNCTION VflatdPresent LIB "setuphlp.DLL" AS INTEGER
DECLARE FUNCTION GetRealSystemDir LIB "setuphlp.DLL" (szDir$,cbBuf%) AS INTEGER
DECLARE FUNCTION RestartWindows LIB "setuphlp.DLL" AS INTEGER
DECLARE FUNCTION IsWin32FileNewer LIB "setuphlp.DLL" (szOrig$,szNew$) AS INTEGER
DECLARE SUB RenameFilePlease LIB "setuphlp.DLL" (szOrig$,szNew$)
'**========================================================================
INIT:
CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
SetBitmap CUIDLL$, LOGO
IF GetWindowsMinorVersion() = 95 THEN
''#####################################
'' WIN 95
''#####################################
WinVer% = 1
SetTitle "VCD PowerPlayer for Windows 95"
ELSEIF MyGetWinFlags() = 4 THEN
''#####################################
'' WIN NT
''#####################################
WinVer% = 2
SetTitle "VCD PowerPlayer for Windows NT"
ELSE
''#####################################
'' WIN 31
''#####################################
WinVer% = 0
SetTitle "VCD PowerPlayer for Windows 3.1"
END IF
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + "POWERVCD.INF"
END IF
ReadInfFile szInf$
DEST$ = "C:\POWERVCD" '' set the default destination to C:\POWERVCD
WINDIR$ = GetWindowsDir()
WINSYSDIR$ = GetWindowsSysDir()
SystemIni$ = MakePath(WINDIR$, "SYSTEM.INI")
WinIni$ = MakePath(WINDIR$, "WIN.INI")
CtrlIni$ = MakePath(WINDIR$, "CONTROL.INI")
MpegLabel$ = "MpegVideo"
CDILabel$ = "CDIVideo"
'**========================================================================
WELCOME:
sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
UIPop 1
ELSE
GOSUB ASKQUIT
GOTO WELCOME
END IF
'**========================================================================
GETDESTPATH:
SetSymbolValue "EditTextIn", DEST$
GETDESTPATH1:
sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
DEST$ = GetSymbolValue("EditTextOut")
' SrcDir$ = GetSymbolValue( "STF_SRCDIR" )
IF sz$ = "CONTINUE" THEN
IF isDirWritable( DEST$ ) = 0 THEN
GOSUB BADPATH
GOTO GETDESTPATH1
END IF
drive$ = GetDriveInPath( DEST$ ) '' check for invalid drive in path
IF IsDriveValid( drive$ ) = 0 THEN
GOSUB BADPATH
GOTO GETDESTPATH1
END IF
DestExists% = DoesDirExist( DEST$ )
IF DestExists% = 1 THEN
GOTO DIREXISTS
END IF
ELSEIF sz$ = "REACTIVATE" THEN
GOTO GETDESTPATH1
ELSE
GOSUB ASKQUIT
GOTO GETDESTPATH
END IF
STARTINSTALL:
UIPopAll
Install
'**========================================================================
QUIT:
ON ERROR GOTO ERRQUIT
IF ERR = 0 THEN
dlg% = EXITSUCCESS
ELSEIF ERR = STFQUIT THEN
dlg% = EXITQUIT
ELSE
dlg% = EXITFAILURE
END IF
QUITL1:
UIPopAll
sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO QUITL1
END IF
END
'**========================================================================
ERRQUIT:
i% = DoMsgBox("Setup sources corrupted!","Setup Message",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
'**========================================================================
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
'**========================================================================
DIREXISTS:
sz$ = UIStartDlg(CUIDLL$, DIREXISTS, "FInfoDlgProc", APPHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
UIPop 1
GOTO STARTINSTALL
ELSEIF sz$ = "BACK" THEN
UIPop 1
GOTO GETDESTPATH1
ELSE
GOSUB ASKQUIT
GOTO DIREXISTS
END IF
'****************************************************************
'* *
'* Install *
'* *
'****************************************************************
SUB Install STATIC
SrcDir$ = GetSymbolValue("STF_SRCDIR")
'
' Copy Files
'
IF WinVer% <> 0 THEN
''#####################################
'' WIN 95 and WIN NT
''#####################################
DRVR$ = "ILMPEG32.DRV"
UIEXE$ = "POWERVCD.EXE"
'
' Copy Executable Files
'
AddSectionFilesToCopyList "POWERVCD Files", SrcDir$, DEST$
'
' Copy DLL
'
AddSectionFilesToCopyList "POWERVCD for WIN95 Driver Files", SrcDir$,WINSYSDIR$
'
' Copy DDRAW
'
AddSectionFilesToCopyList "DDRAW Files", SrcDir$,WINSYSDIR$
ELSE
''#####################################
'' WIN31
''#####################################
DRVR$ = "ILMPEG.DRV"
UIEXE$ = "POWERVCD.EXE"
'
' Copy Executable Files
'
AddSectionFilesToCopyList "POWERVCD Files", SrcDir$, DEST$
'
' Copy DLL
'
AddSectionFilesToCopyList "POWERVCD Driver Files", SrcDir$,WINSYSDIR$
'
' Copy WING Files
'
AddSectionFilesToCopyList "WING Files", SrcDir$, WINSYSDIR$
'
' Copy DCI Files
'
'AddSectionFilesToCopyList "DCI Files", SrcDir$, WINSYSDIR$
'
' only use DVA on Windows 3.x
'
IF OnWin3x() = 1 THEN
AddSectionFilesToCopyList "WING DVA Files", SrcDir$, WINSYSDIR$
IF VflatdPresent() = 0 THEN
CreateSysIniKeyValue SystemIni$, "386Enh", "DEVICE", "dva.386", cmoOverwrite
END IF
END IF
END IF
'$IFDEF DEBUG
OpenLogFile MakePath(DEST$, "LOGFILE.OUT"), 0
WriteToLogFile ""
WriteToLogFile " Destination directory set to: '" + DEST$ + "'"
WriteToLogFile ""
WriteToLogFile "MyGetWinFlags = "+STR$(MyGetWinFlags)
'$ENDIF ''DEBUG
'$IFDEF DEBUG
WriteToLogFile ""
WriteToLogFile " Files copied in copy list... "
WriteToLogFile ""
'$ENDIF ''DEBUG
RemoveFile MakePath(WINDIR$, "MPLAYER.INI"), cmoForce
'' i% = SetCopyMode( 0 ) '' debugging: don't copy files
i% = SetCopyMode( 1 ) '' copy files
CopyFilesInCopyList
''#####################################
'' Get sLanguage
''#####################################
szFile$ = WinIni$
szSect$ = "intl"
szKey$ = "sLanguage"
FileExt$ = "txt"
keyExists% = DoesIniKeyExist( szFile$, szSect$, szKey$ )
IF keyExists% = 1 THEN
inibuf$ = GetIniKeyString( szFile$, szSect$, szKey$ )
FileExt$ = LCASE$(LTRIM$(inibuf$))
'$IFDEF DEBUG
WriteToLogFile szKey$ + "=" + inibuf$
'$ENDIF ''DEBUG
END IF
'$IFDEF DEBUG
WriteToLogFile "FileExt =" + FileExt$
'$ENDIF ''DEBUG
''#####################################
'' ReadMe.txt
''#####################################
MyCopyFilename SrcDir$, "ReadMe", FileExt$
''#####################################
'' Manual.txt
''#####################################
MyCopyFilename SrcDir$, "Manual", FileExt$
''#####################################
'' Hinttext.txt
''#####################################
MyCopyFilename SrcDir$, "Hinttext", FileExt$
cdiDrive$ = DRVR$+" CDI/VCD"
PowerPlayerPath$ = MakePath( DEST$,UIEXE$ )
keydrv$ = "ILMPEG"
'' =================================
'' SYSTEM.INI
'' =================================
'' ---------------------------------
'' [mci] section:
''
'' MpegVideo=[driver name]
'' CDIVideo=[driver name]
'' ---------------------------------
'' [CyberLink]
'' PowerVCD=[destination path]
'' ---------------------------------
sect$ = "mci"
DRIVERNUM% = 0 '' initialize DRIVERNUM to 0
keyExists% = DoesIniKeyExist( SystemIni$, sect$, MpegLabel$ )
IF keyExists% = 1 THEN '' check for additional MpegVideo drivers
DRIVERNUM% = DRIVERNUM% + 1
WHILE keyExists% = 1
driver$ = MpegLabel$ + LTRIM$( STR$( DRIVERNUM% ) )
keyExists% = DoesIniKeyExist( SystemIni$, sect$, driver$ )
IF keyExists% = 1 THEN
DRIVERNUM% = DRIVERNUM% + 1
END IF
WEND
END IF
IF DRIVERNUM% > 0 THEN
FOR i% = DRIVERNUM%-1 To 1 STEP -1
drv$ = MpegLabel$ + LTRIM$( STR$( i% ) )
inibuf$ = GetIniKeyString( SystemIni$, sect$, drv$ )
RemoveIniKey SystemIni$, sect$, drv$, cmoNone
IF INSTR(UCASE$(LTRIM$(inibuf$)), keydrv$) <= 0 THEN
drv$ = MpegLabel$ + LTRIM$( STR$( i%+1 ) )
CreateIniKeyValue SystemIni$, sect$, drv$, inibuf$, cmoOverwrite
ENDIF
NEXT
drv$ = MpegLabel$
inibuf$ = GetIniKeyString( SystemIni$, sect$, drv$ )
RemoveIniKey SystemIni$, sect$, drv$, cmoNone
IF INSTR(UCASE$(LTRIM$(inibuf$)), keydrvR$) <= 0 THEN
drv$ = MpegLabel$ + LTRIM$( STR$( 1 ) )
CreateIniKeyValue SystemIni$, sect$, drv$, inibuf$, cmoOverwrite
ENDIF
END IF
CreateIniKeyValue SystemIni$, sect$, MpegLabel$, DRVR$, cmoOverwrite
DRIVERNUM% = 0 '' initialize DRIVERNUM to 0
keyExists% = DoesIniKeyExist( SystemIni$, sect$, CDILabel$ )
IF keyExists% = 1 THEN '' check for additional CDIVideo drivers
DRIVERNUM% = DRIVERNUM% + 1
WHILE keyExists% = 1
driver$ = CDILabel$ + LTRIM$( STR$( DRIVERNUM% ) )
keyExists% = DoesIniKeyExist( SystemIni$, sect$, driver$ )
IF keyExists% = 1 THEN
DRIVERNUM% = DRIVERNUM% + 1
END IF
WEND
END IF
IF DRIVERNUM% > 0 THEN
FOR i% = DRIVERNUM%-1 To 1 STEP -1
drv$ = CDILabel$ + LTRIM$( STR$( i% ) )
inibuf$ = GetIniKeyString( SystemIni$, sect$, drv$ )
RemoveIniKey SystemIni$, sect$, drv$, cmoNone
IF INSTR(UCASE$(LTRIM$(inibuf$)), keydrv$) <= 0 THEN
drv$ = CDILabel$ + LTRIM$( STR$( i%+1 ) )
CreateIniKeyValue SystemIni$, sect$, drv$, inibuf$, cmoOverwrite
ENDIF
NEXT
drv$ = CDILabel$
inibuf$ = GetIniKeyString( SystemIni$, sect$, drv$ )
RemoveIniKey SystemIni$, sect$, drv$, cmoNone
IF INSTR(UCASE$(LTRIM$(inibuf$)), keydrv$) <= 0 THEN
drv$ = CDILabel$ + LTRIM$( STR$( 1 ) )
CreateIniKeyValue SystemIni$, sect$, drv$, inibuf$, cmoOverwrite
ENDIF
END IF
CreateIniKeyValue SystemIni$, sect$, CDILabel$, cdiDrive$, cmoOverwrite
CreateIniKeyValue SystemIni$, "CyberLink", "PowerVCD", DEST$, cmoOverwrite
'' =================================
'' WIN.INI
'' =================================
'' ---------------------------------
'' [extension] section:
''
'' mpg=powervcd.exe ^.mpg
'' dat=powervcd.exe ^.dat
'' ---------------------------------
sect$ = "Extensions"
szKey$ = "mpg"
szVal$ = PowerPlayerPath$ + " ^."+szKey$
keyExists% = DoesIniKeyExist( WinIni$, sect$, szKey$ )
IF keyExists% THEN
CreateIniKeyValue WinIni$, sect$, szKey$, szVal$, cmoOverwrite
ELSE
CreateIniKeyValue WinIni$, sect$, szKey$, szVal$, cmoNone
ENDIF
szKey$ = "dat"
szVal$ = PowerPlayerPath$ + " ^."+szKey$
keyExists% = DoesIniKeyExist( WinIni$, sect$, szKey$ )
IF keyExists% THEN
CreateIniKeyValue WinIni$, sect$, szKey$, szVal$, cmoOverwrite
ELSE
CreateIniKeyValue WinIni$, sect$, szKey$, szVal$, cmoNone
ENDIF
'' ---------------------------------
'' [mci extension] section:
''
'' mpg=MpegVideo
'' dat=MpegVideo
'' ---------------------------------
sect$ = "mci extensions"
ext$ = "mpg"
keyExists% = DoesIniKeyExist( WinIni$, sect$, ext$ )
IF keyExists% THEN
CreateIniKeyValue WinIni$, sect$, ext$, MpegLabel$, cmoOverwrite
ELSE
CreateIniKeyValue WinIni$, sect$, ext$, MpegLabel$, cmoNone
ENDIF
ext$ = "dat"
keyExists% = DoesIniKeyExist( WinIni$, sect$, ext$ )
IF keyExists% THEN
CreateIniKeyValue WinIni$, sect$, ext$, MpegLabel$, cmoOverwrite
ELSE
CreateIniKeyValue WinIni$, sect$, ext$, MpegLabel$, cmoNone
ENDIF
'' =================================
'' CONTROL.INI
'' =================================
'' ---------------------------------
'' [drivers.desc] section:
''
'' ILMPEG.DRV=[MCI] PowerPlayer Driver
'' ---------------------------------
sect$ = "drivers.desc"
m$ = "[MCI] PowerPlayer Driver"
keyExists% = DoesIniKeyExist( CtrlIni$, sect$, DRVR$ )
IF keyExists% THEN
CreateIniKeyValue CtrlIni$, sect$, DRVR$, m$, cmoOverwrite
ELSE
CreateIniKeyValue CtrlIni$, sect$, DRVR$, m$, cmoNone
ENDIF
'' ---------------------------------
'' [Userinstallable.drivers] section:
''
'' MpegVideo=ILMPEG.DRV
'' CDIVideo=ILMPEG.DRV
'' ---------------------------------
sect$ = "Userinstallable.drivers"
keyExists% = DoesIniKeyExist( CtrlIni$, sect$, MpegLabel$ )
IF keyExists% THEN
CreateIniKeyValue CtrlIni$, sect$, MpegLabel$, DRVR$, cmoOverwrite
CreateIniKeyValue CtrlIni$, sect$, CDILabel$, cdiDrive$, cmoOverwrite
ELSE
CreateIniKeyValue CtrlIni$, sect$, MpegLabel$, DRVR$, cmoNone
CreateIniKeyValue CtrlIni$, sect$, CDILabel$, cdiDrive$, cmoNone
ENDIF
'' =================================
'' REGISTRATION DATABASE
'' =================================
'' ---------------------------------
'' mpg=powervcd.exe
'' dat=powervcd.exe
'' ---------------------------------
szVal$ = ".mpg"
keyExists% = DoesRegKeyExist( szVal$ )
IF keyExists% THEN
DeleteRegKey szVal$
ENDIF
CreateRegKey szVal$
CreateRegKeyValue szVal$, PowerPlayerPath$
szVal$ = ".dat"
keyExists% = DoesRegKeyExist( szVal$ )
IF keyExists% THEN
DeleteRegKey szVal$
ENDIF
CreateRegKey szVal$
CreateRegKeyValue szVal$, PowerPlayerPath$
'' =================================
'' PROGRAM MANAGER GROUP/ICON
'' =================================
'' ------------------------------------------------
'' Create PowerPlayer Program Manager Group and Icons
'' ------------------------------------------------
pgmGrp$ = "PowerPlayer"
CreateProgmanGroup pgmGrp$, "", cmoNone
ShowProgmanGroup pgmGrp$, 1, cmoNone
'' ------------------------------
'' PowerPlay.exe
'' ------------------------------
CreateProgmanItem pgmGrp$,"VCD PowerPlayer",PowerPlayerPath$,"",cmoOverwrite
'' ------------------------------
'' ReadMe.txt
'' ------------------------------
ReadmePath$ = "NOTEPAD.EXE " + MakePath( DEST$, "ReadMe.txt" )
CreateProgmanItem pgmGrp$,"PowerPlayer ReadMe File", ReadmePath$,"",cmoOverwrite
'' ------------------------------
'' Manual.txt
'' ------------------------------
ManualPath$ = "NOTEPAD.EXE " + MakePath( DEST$, "Manual.txt" )
CreateProgmanItem pgmGrp$,"PowerPlayer Manual File", ManualPath$,"",cmoOverwrite
'' ------------------------------
'' Unintall
'' ------------------------------
'' uninstPath$ = MakePath( DEST$, "uninst.exe" )
'' CreateProgmanItem pgmGrp$,"Uninstall",uninstPath$,"",cmoOverwrite
'$IFDEF DEBUG
CloseLogFile
'$ENDIF ''DEBUG
END SUB
'****************************************************************
'* *
'* MakePath *
'* *
'****************************************************************
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
'****************************************************************
'* *
'* GetDriveInPath *
'* *
'****************************************************************
FUNCTION GetDriveInPath( szPath$ ) STATIC AS STRING
IF INSTR( szPath$, ":" ) = 0 THEN '' no drive in path
GetDriveInPath = "C"
ELSE
GetDriveInPath = MID$( szPath$, 1, 1 )
END IF
END FUNCTION
'****************************************************************
'* *
'* MyCopyFilename *
'* *
'****************************************************************
SUB MyCopyFilename(szSrcDir$, szFileName$, szFileExt$) STATIC
DIM szMySpool$ (20)
DIM II%
szFileExt$ = LCASE$(szFileExt$)
''=====================================
'' szFileExt$
''=====================================
szFullFilename$ = MakePath(szSrcDir$, szFileName$+"."+szFileExt$)
IF DoesFileExist(szFullFilename$, femExists) = 1 THEN
GOTO MyCopyFilename_copyfilename
END IF
''========================================================
'' English : ena, eng, enc, eni, enz, ens, enu, usa
''========================================================
szMySpool$(0) = "ena"
szMySpool$(1) = "eng"
szMySpool$(2) = "enc"
szMySpool$(3) = "eni"
szMySpool$(4) = "enz"
szMySpool$(5) = "ens"
szMySpool$(6) = "enu"
szMySpool$(7) = "usa"
KK% = 7
found% = 0
FOR II% = 0 TO KK% STEP 1
IF INSTR((LCASE$(szMySpool$(II%))), szFileExt$) > 0 THEN
found% = 1
EXIT FOR
END IF
NEXT II%
IF found% = 1 THEN
GOTO MyCopyFilename_default
ENDIF
''========================================================
'' Ducth : nlb, nld, dut
''========================================================
szMySpool$(0) = "nlb"
szMySpool$(1) = "nld"
szMySpool$(2) = "dut"
KK% = 2
found% = 0
FOR II% = 0 TO KK% STEP 1
IF INSTR((LCASE$(szMySpool$(II%))), szFileExt$) > 0 THEN
found% = 1
EXIT FOR
END IF
NEXT II%
IF found% = 1 THEN
found% = 0
FOR JJ% = 0 TO KK% STEP 1
IF II% <> JJ% THEN
szFullFilename$ = MakePath(szSrcDir$, szFileName$+"."+szMySpool$(JJ%))
IF DoesFileExist(szFullFilename$, femExists) = 1 THEN
found% = 1
EXIT FOR
END IF
END IF
NEXT JJ%
IF found% = 1 THEN
GOTO MyCopyFilename_copyfilename
ELSE
GOTO MyCopyFilename_default
END IF
END IF
''========================================================
'' French : frb, frc, fcf, frl, fra, frn, frs
''========================================================
szMySpool$(0) = "frb"
szMySpool$(1) = "frc"
szMySpool$(2) = "fcf"
szMySpool$(3) = "frl"
szMySpool$(4) = "fra"
szMySpool$(5) = "frn"
szMySpool$(6) = "frs"
KK% = 6
found% = 0
FOR II% = 0 TO KK% STEP 1
IF INSTR((LCASE$(szMySpool$(II%))), szFileExt$) > 0 THEN
found% = 1
EXIT FOR
END IF
NEXT II%
IF found% = 1 THEN
found% = 0
FOR JJ% = 0 TO KK% STEP 1
IF II% <> JJ% THEN
szFullFilename$ = MakePath(szSrcDir$, szFileName$+"."+szMySpool$(JJ%))
IF DoesFileExist(szFullFilename$, femExists) = 1 THEN
found% = 1
EXIT FOR
END IF
END IF
NEXT JJ%
IF found% = 1 THEN
GOTO MyCopyFilename_copyfilename
ELSE
GOTO MyCopyFilename_default
END IF
END IF
''========================================================
'' German : dea, dec, del, deu, ger, des
''========================================================
szMySpool$(0) = "dea"
szMySpool$(1) = "dec"
szMySpool$(2) = "del"
szMySpool$(3) = "deu"
szMySpool$(4) = "ger"
szMySpool$(5) = "des"
KK% = 5
found% = 0
FOR II% = 0 TO KK% STEP 1
IF INSTR((LCASE$(szMySpool$(II%))), szFileExt$) > 0 THEN
found% = 1
EXIT FOR
END IF
NEXT II%
IF found% = 1 THEN
found% = 0
FOR JJ% = 0 TO KK% STEP 1
IF II% <> JJ% THEN
szFullFilename$ = MakePath(szSrcDir$, szFileName$+"."+szMySpool$(JJ%))
IF DoesFileExist(szFullFilename$, femExists) = 1 THEN
found% = 1
EXIT FOR
END IF
END IF
NEXT JJ%
IF found% = 1 THEN
GOTO MyCopyFilename_copyfilename
ELSE
GOTO MyCopyFilename_default
END IF
END IF
''========================================================
'' Italian : ita, itn, its
''========================================================
szMySpool$(0) = "ita"
szMySpool$(1) = "itn"
szMySpool$(2) = "its"
KK% = 2
found% = 0
FOR II% = 0 TO KK% STEP 1
IF INSTR((LCASE$(szMySpool$(II%))), szFileExt$) > 0 THEN
found% = 1
EXIT FOR
END IF
NEXT II%
IF found% = 1 THEN
found% = 0
FOR JJ% = 0 TO KK% STEP 1
IF II% <> JJ% THEN
szFullFilename$ = MakePath(szSrcDir$, szFileName$+"."+szMySpool$(JJ%))
IF DoesFileExist(szFullFilename$, femExists) = 1 THEN
found% = 1
EXIT FOR
END IF
END IF
NEXT JJ%
IF found% = 1 THEN
GOTO MyCopyFilename_copyfilename
ELSE
GOTO MyCopyFilename_default
END IF
END IF
''========================================================
'' Norwegian : nor, non
''========================================================
szMySpool$(0) = "nor"
szMySpool$(1) = "non"
KK% = 1
found% = 0
FOR II% = 0 TO KK% STEP 1
IF INSTR((LCASE$(szMySpool$(II%))), szFileExt$) > 0 THEN
found% = 1
EXIT FOR
END IF
NEXT II%
IF found% = 1 THEN
found% = 0
FOR JJ% = 0 TO KK% STEP 1
IF II% <> JJ% THEN
szFullFilename$ = MakePath(szSrcDir$, szFileName$+"."+szMySpool$(JJ%))
IF DoesFileExist(szFullFilename$, femExists) = 1 THEN
found% = 1
EXIT FOR
END IF
END IF
NEXT JJ%
IF found% = 1 THEN
GOTO MyCopyFilename_copyfilename
ELSE
GOTO MyCopyFilename_default
END IF
END IF
''========================================================
'' Portuguese : ptb, ptg, por
''========================================================
szMySpool$(0) = "ptb"
szMySpool$(1) = "ptg"
szMySpool$(2) = "por"
KK% = 2
found% = 0
FOR II% = 0 TO KK% STEP 1
IF INSTR((LCASE$(szMySpool$(II%))), szFileExt$) > 0 THEN
found% = 1
EXIT FOR
END IF
NEXT II%
IF found% = 1 THEN
found% = 0
FOR JJ% = 0 TO KK% STEP 1
IF II% <> JJ% THEN
szFullFilename$ = MakePath(szSrcDir$, szFileName$+"."+szMySpool$(JJ%))
IF DoesFileExist(szFullFilename$, femExists) = 1 THEN
found% = 1
EXIT FOR
END IF
END IF
NEXT JJ%
IF found% = 1 THEN
GOTO MyCopyFilename_copyfilename
ELSE
GOTO MyCopyFilename_default
END IF
END IF
''========================================================
'' Spanish : esp, esm, esn, spa
''========================================================
szMySpool$(0) = "esp"
szMySpool$(1) = "esm"
szMySpool$(2) = "esn"
szMySpool$(3) = "spa"
KK% = 3
found% = 0
FOR II% = 0 TO KK% STEP 1
IF INSTR((LCASE$(szMySpool$(II%))), szFileExt$) > 0 THEN
found% = 1
EXIT FOR
END IF
NEXT II%
IF found% = 1 THEN
found% = 0
FOR JJ% = 0 TO KK% STEP 1
IF II% <> JJ% THEN
szFullFilename$ = MakePath(szSrcDir$, szFileName$+"."+szMySpool$(JJ%))
IF DoesFileExist(szFullFilename$, femExists) = 1 THEN
found% = 1
EXIT FOR
END IF
END IF
NEXT JJ%
IF found% = 1 THEN
GOTO MyCopyFilename_copyfilename
ELSE
GOTO MyCopyFilename_default
END IF
END IF
''=====================================
'' Default
''=====================================
MyCopyFilename_default:
szFullFilename$ = MakePath(szSrcDir$, szFileName$+".txt")
IF DoesFileExist(szFullFilename$, femExists) = 1 THEN
GOTO MyCopyFilename_copyfilename
END IF
''=====================================
'' Copy Nothing
''=====================================
GOTO MyCopyFilename_end
''=====================================
'' MyCopyFilename_copyfilename
''=====================================
MyCopyFilename_copyfilename:
'$IFDEF DEBUG
WriteToLogFile "Copy File => " + szFullFilename$
'$ENDIF ''DEBUG
CopyFile szFullFilename, MakePath(DEST$, szFileName$+".txt"), cmoOverwrite, 0
''=====================================
'' MyCopyFilename_end
''=====================================
MyCopyFilename_end:
END SUB