MSI install based on version of Outlook

I need to install Mimecast for Outlook with has 2 different versions depending on which version of Outlook you are running (x64 or x86)…

Within our environment we still have older Outlook 2013 (x86) and newer Outlook 2016/19 (x64). Within SCCM we can use custom filters based on “Outlook Bitness”.

I would like to handle this within a single deployment using PSADT. Is this something we can do and if so can someone help with the development of the script please?

I will have to close Outlook, check version (x86 or x64) install correct MSI. This will be used for new installs and via Software Centre.

Thanks for your help

I’m no POSH guru and the “ElseIf” stuff below seems a little clumsy, but my first thought is this:

#  Find the version of Outlook and stuff it in a variable
If (Test-Path "Path_to_Outlook.exe_2013x86")
{
    $OutlookVersion = '2013x86'
}
ElseIf (Test-Path "Path_to_Outlook.exe2013 x64")
{
    $OutlookVersion = '2013X64'
}
ElseIf (Test-Path "Path_to_Outlook.exe2016 x86")
{
    $OutlookVersion = '2016X86'
}
ElseIf (Test-Path "Path_to_Outlook.exe2016 x64")
{
    $OutlookVersion = '2016X64'
}
#  Depending on what version you find, execute the relevant install.
Switch ($OutlookVersion)
{
    '2013x86' {Execute-MSI -Action Install -Path Mimecastfor2013x86.msi}
    '2013x64' {Execute-MSI -Action Install -Path Mimecastfor2013x64.msi}
    '2016x86' {Execute-MSI -Action Install -Path Mimecastfor2016x86.msi}
    '2016x64' {Execute-MSI -Action Install -Path Mimecastfor2016x64.msi}
}

You’ll need to include the usual PSADT stuff to close Outlook, prevent its launch during Mimecast install, etc.

One other thing you may need to check for is whether the user has MSI Outlook or Office 365 Outlook (ClickToRun).

I will give it a go and see how it goes. Thank you.

Use the same check on bitness registry keys you use in your custom filters.

If bitness returns x86 install x86-msi and vice versa for 64bit.