Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: NET Framework 4 silent install


15 Oct 2010   #1

Windows 8 Pro x64
 
 
NET Framework 4 silent install

I am developing a set of tools in Microsoft Visual C# 2010. I absolutely hate the Microsoft publishing tools in it so I want to create my own installer using Inno Setup. The problem is that most of the target audience for these tools do not even know what .NET Framework is, so I need to be able to launch a silent install in case they do not have it. How can I do this? Are there arguments that can be passed to the redistributable?


My System SpecsSystem Spec
.

15 Oct 2010   #2

Windows 7 Home Premium x64 - Mac OS X 10.6.4 x64
 
 

Hmm....this might work....add these to the redistributable's exe....

Code:
/install /x86 /x64 /ia64 /parameterfolder Client /q /norestart
My System SpecsSystem Spec
15 Oct 2010   #3

Windows 8 Pro x64
 
 

Quote   Quote: Originally Posted by Zidane24 View Post
Hmm....this might work....add these to the redistributable's exe....

Code:
/install /x86 /x64 /ia64 /parameterfolder Client /q /norestart
I figured that it had to be possible. I'll probably tell Inno Setup to launch an app which checks for the NET version installed, if any, and if the minimum version needed is not, the app will launch the redistributable with those parameters. I assume that there is something in the registry which I could have my c++ app read that would tell it what version of NET is installed.
My System SpecsSystem Spec
.


15 Oct 2010   #4

Windows 7 Home Premium x64 - Mac OS X 10.6.4 x64
 
 

Grabbed this from a project of mine....

Code:
Dim DotNetFrameworkInfo As New DotNetFramework.SystemInfo
Console.WriteLine(DotNetFrameworkInfo.HighestFrameworkVersion)
Console.WriteLine(DotNetFrameworkInfo.NetFrameworkInstallationPath)
Dim FrameworkVersionCollection As New Collection
FrameworkVersionCollection = DotNetFrameworkInfo.FrameworkVersions
For Each FrameworkVersion As String In FrameworkVersionCollection
	Console.WriteLine(FrameworkVersion)
Next

Imports System
Imports System.IO
Imports System.Security
Imports System.Text.RegularExpressions

Namespace DotNetFramework
    Public Class SystemInfo
        Private Const FRAMEWORK_PATH As String = "\Microsoft.NET\Framework"
        Private Const WINDIR1 As String = "windir"
        Private Const WINDIR2 As String = "SystemRoot"
        Private _versions As New Collection

        Public ReadOnly Property FrameworkVersions() As Collection
            Get
                Try
                    GetVersions(NetFrameworkInstallationPath)
                Catch e1 As SecurityException
                    Return Nothing
                End Try
                Return _versions
            End Get
        End Property

        Public ReadOnly Property HighestFrameworkVersion() As String
            Get
                Try
                    Return GetHighestVersion(NetFrameworkInstallationPath)
                Catch e1 As SecurityException
                    Return "Unknown"
                End Try
            End Get
        End Property

        Private Sub GetVersions(ByVal installationPath As String)

            Dim versions() As String = Directory.GetDirectories(installationPath, "v*")
            Dim VersionNumber As String
            _versions.Clear()

            For i As Integer = versions.Length - 1 To 0 Step -1
                VersionNumber = ExtractVersion(versions(i))

                If IsFrameworkVersionFormat(VersionNumber) Then
                    _versions.Add(VersionNumber)
                End If
            Next i

        End Sub

        Private Function GetHighestVersion(ByVal installationPath As String) As String
            Dim versions() As String = Directory.GetDirectories(installationPath, "v*")
            Dim version As String = "Unknown"

            For i As Integer = versions.Length - 1 To 0 Step -1
                version = ExtractVersion(versions(i))

                If IsFrameworkVersionFormat(version) Then
                    Return version
                End If
            Next i

            Return version
        End Function

        Private Function ExtractVersion(ByVal directory As String) As String
            Dim startIndex As Integer = directory.LastIndexOf("\") + 2
            Return directory.Substring(startIndex, directory.Length - startIndex)
        End Function

        Private Shared Function IsFrameworkVersionFormat(ByVal str As String) As Boolean
            Return New Regex("^[0-9]+\.?[0-9]+\.?[0-9]*$").IsMatch(str)
        End Function

        Public ReadOnly Property NetFrameworkInstallationPath() As String
            Get
                Return WindowsPath & FRAMEWORK_PATH
            End Get
        End Property

        Public ReadOnly Property WindowsPath() As String
            Get
                Dim winDir As String = Environment.GetEnvironmentVariable(WINDIR1)
                If String.IsNullOrEmpty(winDir) Then
                    winDir = Environment.GetEnvironmentVariable(WINDIR2)
                End If

                Return winDir
            End Get
        End Property
    End Class
End Namespace
Modify it to your needs

(...sometimes I outdo myself....)
My System SpecsSystem Spec
Reply

 NET Framework 4 silent install




Thread Tools



Similar help and support threads for2: NET Framework 4 silent install
Thread Forum
Net framework 4.5 will not install Software
Solved create silent install of softwares Software
Silent Hill: Book of Memories-just another Silent Hill w/ Multi Player Gaming
Silent install.... Software
cant install .net framework 1.1 Installation & Setup
Nero 9 Silent Install Software

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 07:07 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33