Do you set the appropriate download (.exe or .application) for your web users?
Updated by Igor Goldobin 1 year ago. See history
123
In general, you should set the user to download the Setup.exe of your ClickOnce application. However there are many cases where the only prerequisite of the application is .NET 2, and the users don't need the Setup.exe. Instead, the .application file would allow the user to install the application, or run it instantly if they already have .Net 2. The following code allows you to check for the .NET 2 runtime on the client's machine (note: Request.Browser.ClrVersion
may return 0.0 on some browsers).
dim verHave as Version = Request.Browser.ClrVersiondim verNeed as Version = new Version("2.0.50727")if ( verHave < verNeed ) thenResponse.Write("<a href=""./Download/Setup.exe"">")elseResponse.Write("<a href=""./Download/SSWDiagnostics.application"">")end if
Figure: Code to detect the client's CLR version and offers the download accordingly