Application.Install Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Attempts to install the application so that it can run outside the browser.

Namespace:  System.Windows
Assembly:  System.Windows (in System.Windows.dll)


<SecuritySafeCriticalAttribute> _
Public Function Install As Boolean
public bool Install()

Return Value

Type: System.Boolean
true if the user gave consent to install the application or the application requires elevated trust; otherwise, false. See Remarks for more information.


Exception Condition

The application is already installed.


The application is hosted at a URI with a scheme other than http, https, or file.


This method works only from within an event handler for a user-initiated event, and only if the application manifest is correctly configured to enable out-of-browser support. If these conditions are not met, this method returns false and the install dialog box is not shown. If the application requires elevated trust, this method returns true before the install dialog box is shown.


The following code example demonstrates how to use this method. This example is part of a larger example available in How to: Implement Offline Support for Out-of-Browser Applications.

Private Sub installButton_Click(ByVal sender As Object, _
    ByVal e As RoutedEventArgs)

    Catch ex As InvalidOperationException
        MessageBox.Show("The application is already installed.")
    End Try

End Sub
private void installButton_Click(object sender, RoutedEventArgs e)
    catch (InvalidOperationException)
        MessageBox.Show("The application is already installed.");

Version Information


Supported in: 5, 4, 3


For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.