Different installation script win7/win8.1

Topics: Archive - General
Dec 4, 2014 at 11:03 AM
Hi,

When the installation is different between Windows 7 and Windows 8 so I have created two different powershell script.

Deploy-Application-Win7.ps1
Deploy-Application-Win8.ps1

Although two different deployment types in SCCM.

Ideally, I'd like to have ONE script (Deploy-Application.ps1) and ONE deployment type for both OS.
Can I use these variables to accomplish this?

$envOSVersion
$envOSProductTypeName

An example:

Adobe Flash Player
Windows 7 requires both flash ActiveX and flash plugin browsers.
Windows 8 is only needed flash plugin for your browser.

Can i use this variable to accomplish powershell to install different for win7/win8?
Coordinator
Dec 4, 2014 at 12:54 PM
Hey,

Yes you can. We actually did something already for Flash Player. So given that both Chrome and Internet Explorer versions newer than 10, have Flash Player built in...
#  Get the Internet Explorer version
$ieVersion = Get-Item "HKLM:Software\Microsoft\Internet Explorer" -ErrorAction SilentlyContinue | Get-ItemProperty | Select "svcVersion" -ExpandProperty "svcVersion"
$ieSubstringPos = $ieVersion.IndexOf(".")
[int]$ieShortVersion = $ieVersion.Substring(0, $ieSubstringPos)

#  Install Flash Player ActiveX Control for IE versions prior to IE10 
If ($ieShortVersion -lt 10) { 
    Execute-MSI -Action Install -Path "install_flash_player_14_active_x.msi"
}

#  Install Flash Player Plugin if Firefox is installed
If(Get-InstalledApplication -Name "Mozilla Firefox" -eq $true) {
    Execute-MSI -Action Install -Path "install_flash_player_14_plugin.msi"
}
That'll work on every OS version :)

Dan
Dec 5, 2014 at 9:42 AM
Thanks!
I will try your exampel but with OS version instead.

I'll be back with a report when im done! :)