home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IBM Presents OS/2 Software Hits 1995
/
OS-2_SW_HITS_2ND_EDITION_1995.ISO
/
i17
/
winncs.exe
/
NSETUP.MS_
/
NSETUP.bin
Wrap
Text File
|
1994-11-15
|
5KB
|
174 lines
'**************************************************************************
'* Novel Nasi Redirection Setup
'**************************************************************************
''$DEFINE DEBUG ''Define for script development/debugging
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
'$INCLUDE 'nsetuph.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 BADPATH = 6400
''Bitmap ID
CONST LOGO = 1
GLOBAL DEST$ ''Default destination directory.
DECLARE SUB Install
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
INIT:
hWnd% = HwndFrame()
hInst% = HinstFrame()
i% = SetupMainWindowParams(hWnd%, hInst%)
CUIDLL$ = "nsetup.dll" ''Custom user interface dll
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
SetBitmap CUIDLL$, LOGO
SetTitle "Win2NCS Novell Nasi Redirection Capability Setup"
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + "NSETUP.INF"
END IF
ReadInfFile szInf$
DEST$ = "C:\Win2NCS"
'$IFDEF DEBUG
i% = SetSizeCheckMode(scmOnIgnore) '' could use scmOff; def = scmOnFatal
WinDrive$ = MID$(GetWindowsDir, 1, 1)
IF IsDriveValid(WinDrive$) = 0 THEN
i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
GOTO QUIT
END IF
'$ENDIF ''DEBUG
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
ELSE
UIPopAll
ERROR STFQUIT
END IF
Install
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("Setup sources were corrupted, call your Authorized Novell Dealer", "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
'*************************************************************************
'**
'** Purpose:
'**
'** Builds the copy list and performs all installation operations.
'**
'** Arguments:
'** none.
'**
'** Returns:
'** none.
'**
'*************************************************************************
SUB Install STATIC
WinDir$ = string$(256, 32)
SysDir$ = string$(256, 32)
i% = GetWindowsDirectory(WinDir$, 255)
WinDir$ = WinDir$ + "\"
SysDir$ = WinDir$ + "SYSTEM\"
SrcDir$ = GetSymbolValue("STF_SRCDIR")
CreateDir DEST$, cmoNone
i% = DisableNasiRedirection("ATTNASI.EXE")
AddSectionFilesToCopyList "ApFiles", SrcDir$, DEST$
AddSectionFilesToCopyList "WinFiles", SrcDir$, WinDir$
AddSectionFilesToCopyList "NWFiles", SrcDir$, SysDir$
CopyFilesInCopyList
ClearCopyList
CreateProgmanGroup "Win2NCS Nasi Mapping", "", cmoNone
ShowProgmanGroup "Win2NCS Nasi Mapping", 1 , cmoNone
CreateProgmanItem "Win2NCS Nasi Mapping", "Win2NCS", MakePath(DEST$, "MAPNASI.EXE"), "", cmoOverwrite
ReadMe$ = "WRITE.EXE " + MakePath(DEST$, "README.WRI")
CreateProgmanItem "Win2NCS Nasi Mapping", "Read Me", ReadMe$, "", cmoOverwrite
i% = RemoveFileNameFromLoadInINI("ATTNASI.EXE")
i% = AddFileNameToLoadInINI(MakePath(DEST$, "ATTNASI.EXE"))
i% = StartExecutingProgram(MakePath(DEST$, "ATTNASI.EXE"))
AddDos5Help "Win2NCS", "Windows Nasi Mapping Utility.", cmoNone
END SUB
'**
'** Purpose:
'** Appends a file name to the end of a directory path,
'** inserting a backslash character as needed.
'** Arguments:
'** szDir$ - full directory path (with optional ending "\")
'** szFile$ - filename to append to directory
'** Returns:
'** Resulting fully qualified path name.
'*************************************************************************
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