Export (0) Print
Expand All
3 out of 4 rated this helpful - Rate this topic

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)
[SecuritySafeCriticalAttribute]
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.
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 void installButton_Click(object sender, RoutedEventArgs e)
{
    try
    {
        app.Install();
    }
    catch (InvalidOperationException)
    {
        MessageBox.Show("The application is already installed.");
    }
}


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.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.