Office Bitness

We have recently deployed Office 2016 - 64bit into our Office 2016 - 32bit environment. We started out packaging both a 32bit AND a 64bit version separately and publishing them in SCCM as (package - x86) or (package - x64), but this was confusing to users, so I came up with the following:

starting around line 79

##* Do not modify section above
##*===============================================

Check the Office 2016 Bitness

Think about detection method if an Application

$BITNESS = (get-itemproperty HKLM:SOFTWARE\Microsoft\Office\16.0\Outlook)
##===============================================
##
END VARIABLE DECLARATION
##*===============================================

for x64 bit Office Installs - Use this one

remember the uninstall GUID is probably different than the x86 GUID

If ($deploymentType -ine ‘Uninstall’ -And $BITNESS.bitness -eq “x64”)
ElseIf ($deploymentType -ieq ‘Uninstall’ -And $BITNESS.bitness -eq “x64”)

for x86 bit Office Installs - Use this one

remember the uninstall GUID is probably different than the x64 GUID

If ($deploymentType -ine ‘Uninstall’ -And $BITNESS.bitness -eq “x86”)
ElseIf ($deploymentType -ieq ‘Uninstall’ -And $BITNESS.bitness -eq “x86”)

so now we have to have an Files\x86 and Fiels\x64 folder, but just put your MSI in the appropriate one.

Now we only advertise one thing in SCCM and nobody is calling and asking “which one do I have?”

is there a more efficient way to do this?

1 Like

Don’t change the main deploymenttype if statement. Instead check bitness inside the Installation and Uninstallation sections and start the right setup/msi.

if ($Is64Bit) {
    Write-Log "Installing 64bit version of MSOffice"
    Execute-Process -Path "$dirFiles\x64\setup.exe" -Parameters "parameter1 parameter2" 
} else {
    Write-Log "Installing 32bit version of MSOffice"
    Execute-Process -Path "$dirFiles\x86\setup.exe" -Parameters "parameter1 parameter2" 
}