<Security.Permissions.SecurityPermission(Security.Permissions.SecurityAction.Demand)> _
Public Overrides Sub Install(ByVal savedState As _
System.Collections.IDictionary)
MyBase.Install(savedState)
Dim Args As String = Me.Context.Parameters.Item("Args")
If Args = "" Then
Throw New InstallException("No arguments specified")
End If
' Gets the path to the Framework directory.
Dim Path As New System.Text.StringBuilder(1024)
Dim Size As Integer
GetCORSystemDirectory(Path, Path.Capacity, Size)
Dim P As Process
' Quotes the arguments, in case they have a space in them.
Dim Si As New ProcessStartInfo(Path.ToString() & "ngen.exe", Chr(34) _
& Args & Chr(34))
Si.WindowStyle = ProcessWindowStyle.Hidden
Try
P = Process.Start(Si)
P.WaitForExit()
Catch e As Exception
Throw New InstallException(e.Message)
End Try
End Sub