Quantcast
Channel: psappdeploytoolkit Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1769

New Post: Need a challenge? 1 script to install 2 to 3 different OS scenarios

$
0
0
It really depends on the requirements for your deployment.

This code would reflect what was already installed but it only suits an upgrade scenario because it would do nothing if Java was not already present on a system.
$InstalledApps = Get-InstalledApplication -Name "Java 7 Update"
Remove-MSIApplications -Name "Java 7 Update"

If ($InstalledApps | % {If ($_.Is64BitApplication -eq $False) {$True}}) {
    Execute-MSI -Action Install -Path '"$dirFiles\x86\jre1.7.0_71.msi'
} 
If ($InstalledApps | % {If ($_.Is64BitApplication -eq $True) {$True}}) {
    Execute-MSI -Action Install -Path '"$dirFiles\x64\jre1.7.0_71.msi'
 }
In installation scenario this would be better as long as computer targeting is controlled.
Remove-MSIApplications -Name "Java 7 Update"

If ($envArchitecture -eq "AMD64") {
    Execute-MSI -Action Install -Path '"$dirFiles\x86\jre1.7.0_71.msi'
    Execute-MSI -Action Install -Path '"$dirFiles\x64\jre1.7.0_71.msi'
 }
If ($envArchitecture -eq "x86") {
    Execute-MSI -Action Install -Path '"$dirFiles\x86\jre1.7.0_71.msi'
 }

Viewing all articles
Browse latest Browse all 1769

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>