Deployment Script: IE10 needs one reboot (x86 and X64)

Topics: Archive - Deployment Scripts
Dec 1, 2014 at 8:08 PM
Edited Dec 19, 2014 at 3:53 PM
There are alot of KBs that need to be used in the package.
You want to run the IE install with /log and you will see all the files it uses. The add-content line was just for SCCM 2012 application model. It does require one reboot. I couldn't ever get the toolkit to send error code 3010. So I put the restart prompt. (-text needs to be changed to -message with 3.5.0)


X64

*===============================================

* PRE-INSTALLATION

If ($deploymentType -ne "uninstall") { $installPhase = "Pre-Installation"

*===============================================

# Show Welcome Message, close Internet Explorer if required, allow up to 3 deferrals, verify there is enough disk space to complete the install and persist the prompt
Show-InstallationWelcome -CloseApps "iexplore" -silent
function IsInstalled($hotfixid)
{
$ret = $false
    Get-WmiObject -Query "Select * from Win32_QuickFixEngineering WHERE HotfixID = '$hotfixid'" -Namespace "root\CIMV2" | ForEach-Object {
        $ret = $true
            }

                return $ret
          }

Prerequisite 1

$update1 = "KB2834140"
If (IsInstalled($update1))
{
write-log -text "$update1 is already installed, skipping."
}
Else
{
  Write-log -text "Installing $update1..."
        cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\Windows6.1-KB2834140-v2-x64.cab /quiet /norestart"
}

Prerequisite #2

$update2 = "KB2670838"
If (IsInstalled($update2))
{
write-log -text "$update2 is already installed, skipping."
}
Else
{
  write-log -text "Installing $update2..."
        cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\KB2670838_amd64.CAB /quiet /norestart"
}

# Prerequisite #3
$update3 = "KB2639308"
If (IsInstalled($update3))
{
write-log -text "$update2 is already installed, skipping."
}
Else
{
write-log -text "Installing $update2..."
        cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\KB2639308_amd64.CAB /quiet /norestart"
}

Prerequisite 4

$update4 = "KB2533623"
If (IsInstalled($update4))
{
write-log -text "$update3 is already installed, skipping."
}
Else
{
 write-log -text "Installing $update3..."
        cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\Windows6.1-KB2533623-x64.cab /quiet /norestart"
        }

Prerequisite #5

$update5 = "KB2731771"
If (IsInstalled($update5))
{
write-log -text "$update5 is already installed, skipping."
}
Else
{
write-log -text "Installing $update5..."
        cmd.exe /c " C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\KB2731771_amd64.CAB /quiet /norestart"
}

Prerequisite #6

$update6 = "KB2729094"
If (IsInstalled($update6))
{
write-log -text "$update6 is already installed, skipping."
}
Else
{
write-log -text "Installing $update6..."
    cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\Windows6.1-KB2729094-v2-x64.cab /quiet /norestart"
}

Prerequisite 7

$update7 = "KB2786081"
If (IsInstalled($update7))
{
write-log -text "$update7 is already installed, skipping."
}
Else
{
write-log -text "Installing $update7..."
    cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\KB2786081_amd64.CAB /quiet /norestart"
 }

*===============================================

* INSTALLATION

$installPhase = "Installation"

*===============================================

# Perform installation tasks here

main program

write-log -text "installing main file"
cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\IE10-neutral.Downloaded.cab /quiet /norestart"

spelling

write-log -text "installing spelling file"
cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\Windows6.2-KB2764916-x86.cab /quiet /norestart"

Hypenation

write-log -text "installing Hypenation file"
cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\Windows6.2-KB2764913-x86.cab /quiet /norestart"

*===============================================

* POST-INSTALLATION

$installPhase = "Post-Installation"

*===============================================

Setup auto-update false

write-log -text "set no auto update"
Set-RegistryKey -Key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main" -Name "EnableAutoUpgrade" -Value "0" -Type Dword -ContinueOnError $true


X86

*===============================================

* PRE-INSTALLATION

If ($deploymentType -ne "uninstall") { $installPhase = "Pre-Installation"

*===============================================

# Show Welcome Message, close Internet Explorer if required, allow up to 3 deferrals, verify there is enough disk space to complete the install and persist the prompt
Show-InstallationWelcome -CloseApps "iexplore" -silent
function IsInstalled($hotfixid)
{
$ret = $false
    Get-WmiObject -Query "Select * from Win32_QuickFixEngineering WHERE HotfixID = '$hotfixid'" -Namespace "root\CIMV2" | ForEach-Object {
        $ret = $true
            }

                return $ret
          }

Prerequisite 1

$update1 = "KB2834140"
If (IsInstalled($update1))
{
write-log -text "$update1 is already installed, skipping."
}
Else
{
  Write-log -text "Installing $update1..."
        cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\Windows6.1-KB2834140-v2-x86.cab /quiet /norestart"
}

Prerequisite #2

$update2 = "KB2670838"
If (IsInstalled($update2))
{
write-log -text "$update2 is already installed, skipping."
}
Else
{
  write-log -text "Installing $update2..."
        cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\KB2670838_x86.CAB /quiet /norestart"
}

# Prerequisite #3
$update3 = "KB2639308"
If (IsInstalled($update3))
{
write-log -text "$update2 is already installed, skipping."
}
Else
{
write-log -text "Installing $update2..."
        cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\KB2639308_x86.CAB /quiet /norestart"
}

Prerequisite 4

$update4 = "KB2533623"
If (IsInstalled($update4))
{
write-log -text "$update3 is already installed, skipping."
}
Else
{
 write-log -text "Installing $update3..."
        cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\Windows6.1-KB2533623-x86.cab /quiet /norestart"
        }

Prerequisite #5

$update5 = "KB2731771"
If (IsInstalled($update5))
{
write-log -text "$update5 is already installed, skipping."
}
Else
{
write-log -text "Installing $update5..."
        cmd.exe /c " C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\KB2731771_x86.CAB /quiet /norestart"
}

Prerequisite #6

$update6 = "KB2729094"
If (IsInstalled($update6))
{
write-log -text "$update6 is already installed, skipping."
}
Else
{
write-log -text "Installing $update6..."
    cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\Windows6.1-KB2729094-v2-x86.cab /quiet /norestart"
}

Prerequisite 7

$update7 = "KB2786081"
If (IsInstalled($update7))
{
write-log -text "$update7 is already installed, skipping."
}
Else
{
write-log -text "Installing $update7..."
    cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\KB2786081_x86.CAB /quiet /norestart"
 }

*===============================================

* INSTALLATION

$installPhase = "Installation"

*===============================================

# Perform installation tasks here

main program

write-log -text "installing main file"
cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\IE10-neutral.Downloaded.cab /quiet /norestart"

spelling

write-log -text "installing spelling file"
cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\Windows6.2-KB2764916-x86.cab /quiet /norestart"

Hypenation

write-log -text "installing Hypenation file"
cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\Windows6.2-KB2764913-x86.cab /quiet /norestart"

*===============================================

* POST-INSTALLATION

$installPhase = "Post-Installation"

*===============================================

Setup auto-update false

write-log -text "set no auto update"
Set-RegistryKey -Key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main" -Name "EnableAutoUpgrade" -Value "0" -Type Dword -ContinueOnError $true
Mar 24, 2015 at 11:57 PM
Edited Mar 25, 2015 at 1:14 AM
Where did you get these cab files from?
I can only find the .msu files.

Also do you have any detection on if IE is already installed?

When you run this, if you rerun it, would it try to reinstall IE (likely fail)