//	ras.inc

//
//	Envoke RAS if installed, otherwise tell user to install it.
//
//		$R0 = Boolean indicating success (RAS invoked or user informed).
//
[InvokeRAS]

	read-syms InvokeRasDlg-$(!STF_LANGUAGE)

	_Enter("InvokeRAS", "")

	set Success = TRUE

	_RASShell CheckRasInstalled
   _OnShellErrorGoto(Error)

	set RasInstalled = $($R0)
   _Trace("Is RAS installed?", _Show(RasInstalled))

	ifstr(i) $(RasInstalled) == "FALSE"
		goto Exit
	endif

   _LocalShell MessageBox $(InvokeRasTitle) $(InvokeRasConfigMsg) MB_YESNO MB_ICONQUESTION MB_DEFBUTTON1
   ifstr(i) $($R0) != "YES"
		goto Exit
   endif

	set AddCopy = "YES"
	set DoCopy = "YES"
	set DoConfig = "YES"

	// We change the following values so the user is prompted to enter
	// a path for RAS file components if necessary.
	set SaveSTF_SRCDIR_OVERRIDE = $(!STF_SRCDIR_OVERRIDE)
	set !STF_SRCDIR_OVERRIDE = EMPTY_STR

	set SaveNTN_InstallMode = $(!NTN_InstallMode)
	set !NTN_InstallMode = "configure"

	_RASShell InstallOption $(!STF_LANGUAGE) "RAS" $(SourceDir) $(AddCopy) $(DoCopy) $(DoConfig) 
   _OnShellErrorGoto(Error)

	set !STF_SRCDIR_OVERRIDE = $(SaveSTF_SRCDIR_OVERRIDE)
	set !NTN_InstallMode = $(SaveNTN_InstallMode)

   _OnShellErrorGoto(Error)

   goto Exit

Error = +
	set Success = FALSE

   _Error("Error Shelling the RAS INF!", "")
	_LocalShell StatusMessage $(InvokeRasError)

Exit = +

	_Exit("InvokeRAS", _Show(Success))
	Return $(Success)
