Export (0) Print
Expand All

Application.Install Method

Silverlight

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

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

'Declaration
<SecuritySafeCriticalAttribute> _
Public Function Install As Boolean

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.

ExceptionCondition
InvalidOperationException

The application is already installed.

-or-

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)

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

End Sub


Silverlight

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.

Community Additions

ADD
Show:
© 2014 Microsoft