NET Framework 4 silent install

Windows i7 920

New member
Pro User
Local time
12:25 PM
Messages
544
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 Computer

Computer Manufacturer/Model Number
iBuyPower Chimera X58
OS
Windows 8 Pro x64
CPU
Intel Core i7 920
Motherboard
Asus P6T Deluxe V2
Memory
12GB (2GB x6) Triple Channel DDR3 1333 MHz
Graphics Card(s)
ATI Radeon HD 4870 X2 2GB GDDR5
Sound Card
Integrated Digital HD 7.1 Surround Sound
Monitor(s) Displays
24.6-inch ASUS VW246H 20000:1 Contrast, 2 ms response time,
Screen Resolution
1920x1080
Hard Drives
1 TB 7200 RPM SATA II 3 GBps 16MB cache
PSU
NZXT 800W Gaming Series
Case
Guardian Inferno (Custom Painted NZXT Guardian 921)
Cooling
Thermaltake V1 Fan Cooling System OC Proof
Keyboard
Razer Lycosa
Mouse
iBuyPower Ergonomical Internet Mouse
Internet Speed
11 MBps High-speed Cable
Hmm....this might work....add these to the redistributable's exe....

Code:
/install /x86 /x64 /ia64 /parameterfolder Client /q /norestart
 

My Computer

Computer Manufacturer/Model Number
Compal JFT02 (Custom Build Laptop)
OS
Windows 7 Home Premium x64 - Mac OS X 10.6.4 x64
CPU
Intel Core 2 Duo T9300 2.5 GHz
Motherboard
JFT02
Memory
4GB Kingston DDR2-800
Graphics Card(s)
NVIDIA Geforce 8600M GT (512MB Model)
Sound Card
Realtek HD Audio
Monitor(s) Displays
WUXGA Standard Laptop Display
Screen Resolution
1680*1050
Hard Drives
Toshiba 320GB 5400RPM Laptop HD
PSU
Standard Laptop Power Supply
Case
Standard Laptop Case
Cooling
Standard Laptop Cooling
Keyboard
Standard Laptop 105 Key-Keyboard
Mouse
Synaptics Touchpad
Internet Speed
Verizion Online DSL 3360/864 kbs (dl/up)
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 Computer

Computer Manufacturer/Model Number
iBuyPower Chimera X58
OS
Windows 8 Pro x64
CPU
Intel Core i7 920
Motherboard
Asus P6T Deluxe V2
Memory
12GB (2GB x6) Triple Channel DDR3 1333 MHz
Graphics Card(s)
ATI Radeon HD 4870 X2 2GB GDDR5
Sound Card
Integrated Digital HD 7.1 Surround Sound
Monitor(s) Displays
24.6-inch ASUS VW246H 20000:1 Contrast, 2 ms response time,
Screen Resolution
1920x1080
Hard Drives
1 TB 7200 RPM SATA II 3 GBps 16MB cache
PSU
NZXT 800W Gaming Series
Case
Guardian Inferno (Custom Painted NZXT Guardian 921)
Cooling
Thermaltake V1 Fan Cooling System OC Proof
Keyboard
Razer Lycosa
Mouse
iBuyPower Ergonomical Internet Mouse
Internet Speed
11 MBps High-speed Cable
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 :D

(...sometimes I outdo myself....)
 

My Computer

Computer Manufacturer/Model Number
Compal JFT02 (Custom Build Laptop)
OS
Windows 7 Home Premium x64 - Mac OS X 10.6.4 x64
CPU
Intel Core 2 Duo T9300 2.5 GHz
Motherboard
JFT02
Memory
4GB Kingston DDR2-800
Graphics Card(s)
NVIDIA Geforce 8600M GT (512MB Model)
Sound Card
Realtek HD Audio
Monitor(s) Displays
WUXGA Standard Laptop Display
Screen Resolution
1680*1050
Hard Drives
Toshiba 320GB 5400RPM Laptop HD
PSU
Standard Laptop Power Supply
Case
Standard Laptop Case
Cooling
Standard Laptop Cooling
Keyboard
Standard Laptop 105 Key-Keyboard
Mouse
Synaptics Touchpad
Internet Speed
Verizion Online DSL 3360/864 kbs (dl/up)
Back
Top