home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Computer Buyer 1998 October
/
dpcb1098.iso
/
Business
/
Ventura
/
Ventura
/
Scripts
/
7to8Converter.csc
next >
Wrap
Text File
|
1998-07-07
|
3KB
|
84 lines
REM Launches 7to8Converter.exe [CorelSCRIPT 8]
REM 7to8Converter.csc February, 1998
REM ⌐ 1998 Corel Corporation. All rights reserved.
REM **************************************************************************************
REM This script launches the 7to8Converter script executable. If the executable cannot be
REM located, the user is prompted to locate this file themself, or exit the script.
REM **************************************************************************************
' Create a temporary folder to provide a path for the include files
' -this enables the include files to be located
#addfol "..\..\Scripts"
#include "ScpConst.csi"
#include "VPConst.csi"
'/////FUNCTION & SUBROUTINE DECLARATIONS/////////////////////////////////////////////////
DECLARE SUB RegQuery()
'/////GLOBAL VARIABLES & CONSTANTS////////////////////////////////////////////////////////
GLOBAL VenturaRoot$ 'Ventura root installation directory from registry
' **************************************************************************************
' MAIN
' **************************************************************************************
ON ERROR GOTO ErrorHandler
RegQuery 'get root directory where Ventura is installed
ExecutableFile$ = VenturaRoot$ & "\Ventura\Scripts\7to8Converter.exe"
Start:
ProcessStatus& = STARTPROCESS(ExecutableFile$)
IF ProcessStatus& = 0 THEN
Msg$ = "Unable to locate " & ExecutableFile$ & CHR(13) & "Would you like to look for the file yourself?"
MsgStatus& = MESSAGEBOX(Msg$, "Missing Executable", MB_OK_CANCEL OR MB_QUESTION_ICON)
IF MsgStatus& = MSG_OK THEN
ExecutableFile$ = GETFILEBOX( "", , , ExecutableFile$)
IF ExecutableFile$ <> "" THEN GOTO Start
ENDIF
ENDIF
ExitScript:
STOP
ErrorHandler:
SELECT CASE ErrNum
CASE 800
MESSAGE "FATAL ERROR" & CHR(13) & "Script will now exit."
RESUME AT ExitScript
CASE ELSE
MESSAGE "ERROR: " & STR(ErrNum) & CHR(13) & "Script will now exit."
RESUME AT ExitScript
END SELECT
' *******************************************************************************
' RegQuery
' This subroutine queries the Registry to determine the root directory where
' Ventura is installed.
' *******************************************************************************
SUB RegQuery
ON ERROR GOTO ErrorHandler
'get Ventura config directory
VentDir$ = REGISTRYQUERY(HKEY_LOCAL_MACHINE,VENTURA_REGQUERY_CONST,"ConfigDir")
'isolate Ventura root directory from Ventura config directory
first% = 1
pos% = 1
DO WHILE first <> 0
first = INSTR(VentDir$, "\", first )
IF first <> 0 THEN
pos = first
first = first + 1
END IF
LOOP
VenturaRoot$ = LEFT(VentDir$, pos - 1) 'root directory where Ventura is installed
EXIT SUB
ErrorHandler:
MESSAGE "Error reading registry:" & CHR(13) & RegString$
ErrNum = 800
END SUB