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 i7 920

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
Zidane24

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 i7 920

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
Zidane24

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
Thread Forum
.NET Framework 3.5 won't install...
Alright, this is my first forum post ever. Usually I can find solutions to my problems by lurking, but not this time apparently. So my problem is this: I'm trying to install "Remove Empty Directories" (Remove Empty Directories | SourceForge.net), but .NET Framework 3.5 is one of its...
Software
How Can I Create a Silent Install for Multiple EXE or MSI installers?
Hi guys, I'm reinstalling my Operating System, and installing drivers are boring lol. I was wondering if I could create a single file which installs them all, I have a secondary hard drive which has all of it on, so they will stay in the same place at all times. I don't particularly want to have to...
Software
create silent install of softwares
hi guys... if you have google chrome ....you see that when you double click on it for installation , it does not show any window for installation just install i want to use this method( i searched for it and i found it called "silent install") for other programs for example for mozilla firefox?
Software
Silent Hill: Book of Memories-just another Silent Hill w/ Multi Player
Another new Silent Hill game will be release even though im not yet finished with my Homecoming and i do not have yet a copy of Silent Hill Downpour. Im still a fan of it :D Here is the new up coming Silent Hill: Book of Memories game: A portable entry in the horror franchise, Silent Hill:...
Gaming
Silent install....
Noob question...what is silent install?how make software to silent install?:sarc:
Software
Nero 9 Silent Install
Does anyone know how to get Nero 9 to do a silent install also known as an unattended installation ?
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 18:27.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App