This project is read-only.

Install based on OS Architecture?

Topics: Archive - General
May 9, 2014 at 4:31 PM
Just discovered this Toolkit today and have been reading all I can find, but still have one major question.

I have a single app deployment in sccm2012r2 that has two msi installers, 1 for x86 and the other for x64.

How do I script this toolkit to run a specific msi when a 32bit OS is detected, and the other for x64?

Brachus
May 9, 2014 at 5:11 PM
Brach,

You could use something like this
If ($psArchitecture -eq "x64") {
    Execute-MSI -Action Install (64bit MSI HERE)
    } 

ElseIf ($psArchitecture -eq "x86") {
    Execute-MSI -Action Install (32bit MSI HERE)
    }
May 9, 2014 at 6:24 PM
Edited May 9, 2014 at 6:24 PM
Is there something built in to determine that or will I need to do something like this?
$psArchitecture = (Get-WmiObject Win32_OperatingSystem).OSArchitecture
May 9, 2014 at 7:19 PM
It is built in... this is the exact part in the AppDeployToolkitMain.ps1 line 207-209
$is64Bit = (Get-WmiObject -Class Win32_OperatingSystem -ea 0).OSArchitecture -eq '64-bit'
$is64BitProcess = [System.IntPtr]::Size -eq 8
If ($is64BitProcess -eq $true) { $psArchitecture = "x64" } Else { $psArchitecture = "x86" }
May 9, 2014 at 9:35 PM
You can use the toolkit variables in your script, such as $is64bit, as Lipid_venom alluded to.

Seán