The plugin is disabled when updating a page from an application on Win 7

I have a page with Silverlight 4 oob app. After the application is installed, the bage on the page should automatically update. I tried calling scripts or a simple Document.Submit from the code on InstallStateChanged - and they all worked well on win XP (not only on my machine), but on Win 7 or Vista the page freezes or even the silverlight plugin crashes before the installation starts. However, without updating, the function runs smoothly during the installation process. How do I make the correct update for these systems? Information on why this might happen will also be helpful.

public App () { this.Startup += this.Application_Startup; this.Exit += this.Application_Exit; this.UnhandledException += this.Application_UnhandledException; InitializeComponent(); App.Current.InstallStateChanged += (s, c) => HtmlPage.Document.Submit(); //used that as the most common used example } private void Application_Startup (object sender, StartupEventArgs e) { if (Application.Current.IsRunningOutOfBrowser) { this.RootVisual = new MainPage(); } else if (Application.Current.InstallState == InstallState.Installed) { this.RootVisual = new InstalledPage(); } else { this.RootVisual = new InstallPage(); } } 

If MainPage and installedPage are simple grids with a text box. The Install page contains only a button with a click event - to install the application. The web page is automatically created. Nothing more. However, on Win 7 and Vista there is the same installation problem as theirs.

UPD: project files

+4
source share
1 answer

I modified your test case as follows:

 public App () { ... App.Current.InstallStateChanged += new EventHandler(Current_InstallStateChanged); } void Current_InstallStateChanged(object sender, EventArgs e) { if(App.Current.InstallState == System.Windows.InstallState.Installed) { HtmlPage.Document.Submit(); } } 

And it updates when installed on Windows 7 perfectly.

+3
source

All Articles