Skip to content

Commit 2a4212d

Browse files
committed
net 3.5
1 parent 3d2d31a commit 2a4212d

File tree

1 file changed

+24
-22
lines changed

1 file changed

+24
-22
lines changed

Install-Programs.ps1

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,26 @@ Begin
8484
}
8585
}
8686

87-
function InstallDotNetFramework
87+
function InstallNetFx3
88+
{
89+
[CmdletBinding(HelpURI = 'cmd')] param()
90+
91+
# installState 1=enabled, 2=disabled, 3=absent, 4=unknown
92+
if ((Get-WmiObject Win32_OptionalFeature | `
93+
where { $_.Name -eq 'NetFx3' -and $_.InstallState -eq 1 }) -eq $null)
94+
{
95+
HighTitle 'NetFx3 (please wait)'
96+
97+
# install .NET 3.5 without causing a reboot
98+
dism /online /norestart /enable-feature /featurename:"NetFx3"
99+
}
100+
else
101+
{
102+
WriteOK 'NetFx3 already installed'
103+
}
104+
}
105+
106+
function InstallNetFx4
88107
{
89108
[CmdletBinding(HelpURI = 'cmd')] param()
90109

@@ -633,6 +652,9 @@ Begin
633652
$0 = 'C:\Program Files (x86)\Greenfish Icon Editor Pro 3.6\gfie.exe'
634653
if (!(Test-Path $0))
635654
{
655+
# preprequisite
656+
InstallNetFx3
657+
636658
HighTitle 'Greenfish'
637659

638660
# download the installer
@@ -649,26 +671,6 @@ Begin
649671
}
650672

651673

652-
function InstallNetFx3
653-
{
654-
[CmdletBinding(HelpURI = 'cmd')] param()
655-
656-
# installState 1=enabled, 2=disabled, 3=absent, 4=unknown
657-
if ((Get-WmiObject Win32_OptionalFeature | `
658-
where { $_.Name -eq 'NetFx3' -and $_.InstallState -eq 1 }) -eq $null)
659-
{
660-
HighTitle 'NetFx3 (please wait)'
661-
662-
# install .NET 3.5 without causing a reboot
663-
dism /online /norestart /enable-feature /featurename:"NetFx3"
664-
}
665-
else
666-
{
667-
WriteOK 'NetFx3 already installed'
668-
}
669-
}
670-
671-
672674
function InstallWiLMa
673675
{
674676
[CmdletBinding(HelpURI = 'cmd|extra')] param()
@@ -744,7 +746,7 @@ Process
744746
# BASE...
745747

746748
InstallDotNetRuntime
747-
InstallDotNetFramework
749+
InstallNetFx4
748750

749751
if ($Continuation -or !($Developer -or $Extras))
750752
{

0 commit comments

Comments
 (0)