Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > How to specify 3.5 SP1 framework for online only ClickOnce?
 

How to specify 3.5 SP1 framework for online only ClickOnce?

My ClickOnce (online only)requires the 3.5 SP1 framework, however I'm building my application with msbuild and creating/signing the manifests using mage (command line). How can I require my clients to have 3.5 SP1 installed?

I can't use a bootstrapper because the program is online only and passes URL parameters in.

Thanks
Fasttimes  Wednesday, September 23, 2009 2:47 AM
Why not just check the list of .NET versions installed?

string targetkey = @"SOFTWARE\Microsoft\NET Framework Setup\NDP";

//get an array of subkeys of target key - these will be installed versions of dot net
RegistryKey dotnetkey = Registry.LocalMachine.OpenSubKey(targetkey);
string[] installedversions = dotnetkey.GetSubKeyNames();

//wrap array into list
List<string> versionlist = new List<string>(installedversions);


From here, you can check the versions and see if the right one for .Net 3.5 SP-1 comes up. (I can't remember what it is off-hand, sorry.)

RobinDotNet
Click here to visit my ClickOnce blog!
RobinDotNet  Friday, September 25, 2009 3:22 AM

The short answer is: You can't. It is handled through the prerequisites. If the application requires .NET 3.5 SP-1 and it is not installed, the application will not run.

Can't you have your users install the application using the setup.exe the first time, and then link to the .application file after that?

RobinDotNet


Click here to visit my ClickOnce blog!
RobinDotNet  Wednesday, September 23, 2009 10:43 AM

The short answer is: You can't. It is handled through the prerequisites. If the application requires .NET 3.5 SP-1 and it is not installed, the application will not run.

Can't you have your users install the application using the setup.exe the first time, and then link to the .application file after that?

RobinDotNet


Click here to visit my ClickOnce blog!

Kind of defeats the purpose of having an online application, no?

Is there a way to programatically determine if 3.5 SP1 or higher is installed?

EDIT: Insert the following Module and call FrameWorkCheck_35SP1 to determine if 3.5 SP1 is installed. This uses a delegate function just introduced in SP1. Kind of a kludge, but there it is.
Module ExtensionMethods
    Private EmptyDelegate As Action = AddressOf EmptyMethod
    Private Sub EmptyMethod()

    End Sub

    <System.Runtime.CompilerServices.Extension()> _
    Private Sub Refresh(ByVal uiElement As UIElement)
        uiElement.Dispatcher.Invoke(EmptyDelegate, Windows.Threading.DispatcherPriority.Render)
    End Sub

    Public Function FrameWorkCheck_35SP1() As Boolean
        Dim retVal As Boolean = True
        Try
            Dim x As New TextBox
            x.Refresh()
        Catch ex As Exception
            retVal = False
        End Try
        Return retVal
    End Function

End Module

Fasttimes  Wednesday, September 23, 2009 1:55 PM
Why not just check the list of .NET versions installed?

string targetkey = @"SOFTWARE\Microsoft\NET Framework Setup\NDP";

//get an array of subkeys of target key - these will be installed versions of dot net
RegistryKey dotnetkey = Registry.LocalMachine.OpenSubKey(targetkey);
string[] installedversions = dotnetkey.GetSubKeyNames();

//wrap array into list
List<string> versionlist = new List<string>(installedversions);


From here, you can check the versions and see if the right one for .Net 3.5 SP-1 comes up. (I can't remember what it is off-hand, sorry.)

RobinDotNet
Click here to visit my ClickOnce blog!
RobinDotNet  Friday, September 25, 2009 3:22 AM

You can use google to search for other answers

Custom Search

More Threads

• ClickOnce plus excel Template
• DirectShow Filter deployment via ClickOnce and Reg Free COM
• invoke exe during installation - custom action issue
• No Touch fails in internet zone after installing .Net 2.0 runtime
• Run program after installation runs
• Installation Problem.
• ClickOnce causes repeated IE windows to open when Install attempted on Client Computer
• VS 2008 Setup projects, primary output uses obj folders instead of bin folders.
• Trust an assembly by Strong Name
• Deploy .net framework 3.5 with ClickOne and Visual Basic Express Edition 2008