Installing under office 32/64 bit

Hello to all,

I need to package an application called Sap for Microsoft Office.
There are 2 installation files:

  1. for Office 2016 32 bit
  2. for Office 2016 64 bit

Is there any built in command that can identify the bitness that is installed on the user computer and then install the proper sap file?

I have tried to add under INSTALLATION section an if command with a query that check what is the bitness of office:

  • Registry path: HKEY_LOCAL_MACHINE\Software\Microsoft\Office\16.0\Outlook
  • if you have installed Office 2013 then use this Registry path: HKEY_LOCAL_MACHINE\Software\Microsoft\Office\16.0\Outlook
  • Registry key: Bitness
  • Value: either x86 or x64

seems that the Powershell file ignores all the if section I added.

Thank you
Amir

If you have the relevant section of the log file we could tell you why it skipped your IF statement.

If you would post that chunk of code that reads the registry, we might be able to help you with that too.

Btw: v3.9.2 added variables for Office C2R: $envOfficeVersion, $envOfficeBitness, $envOfficeCDNBaseURL, $envOfficeChannel. What version do you have and do these variables work for your version of office?

1 Like

Hi,
Thank you very much for addressing my question :slight_smile:
I am working with 3.9.3.
I will look for these variables and update you

Thanks again.
Amir

Hi,
Our company is working with Office 2016 windows installer version and that’s why the variables are not relevant in this case.

This is the code i added under INSTALLATION:

$officeBitnessKey = "HKLM:\SOFTWARE\Microsoft\Office\16.0\Common\Bitness"
                                 # Check if the Bitness key exists
                                if (Test-Path $officeBitnessKey) {
                                $bitnessValue = Get-ItemProperty -Path $officeBitnessKey -Name Bitness

                                if ($bitnessValue.Bitness -eq "x86") {
  Execute-Process -path "$dirfiles\AOFFICE28SP04P_1-70004974.EXE" -paramet'/product:sapcof /silent'
  Execute-Process -path "$dirfiles\AOFFICE28SP04P_1-70004974.EXE" -parameters '/product:SapEpm /silent'
Execute-MSI -Action 'Install' -Path "SAP Analysis for Microsoft Office.msi" -Parameters '/QN'
 } else {
 Execute-Process -path "$dirfiles\AOFFICE28SP04P_1-70004973-x64.EXE" -parameters '/product:SapCofx64 /silent'
 Execute-Process -path "$dirfiles\AOFFICE28SP04P_1-70004973-x64.EXE" -parameters '/product:SapEPMx64 /silent'
 Execute-MSI -Action 'Install' -Path "SAP Analysis for Microsoft Office x64 icons.msi" -Parameters '/QN'
 }
 }

This is the log file itself.
For your attention i replaced the FILES folder with SOURCE folder in the settings files.

PS Microsoft.PowerShell.Core\FileSystem::\\Server1\SAP Analysis for Microsoft Office_v2.8> .\Deploy-Application.ps1
[08-07-2023 08:22:26.003] [Initialization] [PSAppDeployToolkit] :: *******************************************************************************
[08-07-2023 08:22:26.003] [Initialization] [PSAppDeployToolkit] :: *******************************************************************************
[08-07-2023 08:22:26.050] [Initialization] [PSAppDeployToolkit] :: [PS_AppDeployToolkitMain_v_EN_1.0] setup started.
[08-07-2023 08:22:26.113] [Initialization] [PSAppDeployToolkit] :: Script [\\server1\SAP Analysis for Microsoft Office_v2.8\AppDeployToolkit\AppDeployToolkitMain.ps1] dot-source invoked by [\\server1\SAP Analysis for Microsoft Office_v2.8\Deploy-Application.ps1]
[08-07-2023 08:22:26.128] [Initialization] [PSAppDeployToolkitExt] :: Script [\\server1\SAP Analysis for Microsoft Office_v2.8\AppDeployToolkit\AppDeployToolkitExtensions.ps1] dot-source invoked by [\\server1\SAP Analysis for Microsoft Office_v2.8\AppDeployToolkit\AppDeployToolkitMain.ps1]
[08-07-2023 08:22:26.144] [Initialization] [PSAppDeployToolkit] :: [PS_AppDeployToolkitMain_v_EN_1.0] script version is [1.0.0]
[08-07-2023 08:22:26.144] [Initialization] [PSAppDeployToolkit] :: [PS_AppDeployToolkitMain_v_EN_1.0] script date is [00/00/2023]
[08-07-2023 08:22:26.144] [Initialization] [PSAppDeployToolkit] :: [PS_AppDeployToolkitMain_v_EN_1.0] script author is [<>]
[08-07-2023 08:22:26.144] [Initialization] [PSAppDeployToolkit] :: [Deploy Application] script version is [3.9.3]
[08-07-2023 08:22:26.175] [Initialization] [PSAppDeployToolkit] :: [App Deploy Toolkit Main] script version is [3.9.3]
[08-07-2023 08:22:26.269] [Initialization] [PSAppDeployToolkit] :: [App Deploy Toolkit Extensions] version is [3.9.3]
[08-07-2023 08:22:26.284] [Initialization] [PSAppDeployToolkit] :: Computer Name is [FC-TEST-004.domain]
[08-07-2023 08:22:26.284] [Initialization] [PSAppDeployToolkit] :: Current User is [Domain\Username]
[08-07-2023 08:22:26.284] [Initialization] [PSAppDeployToolkit] :: OS Version is [Microsoft Windows 10 Enterprise 64-bit 10.0.19045.2965]
[08-07-2023 08:22:26.284] [Initialization] [PSAppDeployToolkit] :: OS Type is [Workstation]
[08-07-2023 08:22:26.347] [Initialization] [PSAppDeployToolkit] :: Current Culture is [en-US], language is [EN] and UI language is [EN]
[08-07-2023 08:22:26.503] [Initialization] [Get-HardwarePlatform] :: Retrieving hardware platform information.
[08-07-2023 08:22:26.613] [Initialization] [PSAppDeployToolkit] :: Hardware Platform is [Virtual:VMWare]
[08-07-2023 08:22:26.613] [Initialization] [PSAppDeployToolkit] :: PowerShell Host is [ConsoleHost] with version [5.1.19041.2673]
[08-07-2023 08:22:26.628] [Initialization] [PSAppDeployToolkit] :: PowerShell Version is [5.1.19041.2673 x64]
[08-07-2023 08:22:26.628] [Initialization] [PSAppDeployToolkit] :: PowerShell CLR (.NET) version is [4.0.30319.42000]
[08-07-2023 08:22:26.628] [Initialization] [PSAppDeployToolkit] :: *******************************************************************************
[08-07-2023 08:22:26.644] [Initialization] [Get-LoggedOnUser] :: Getting session information for all logged on users.
[08-07-2023 08:22:26.956] [Initialization] [Get-RegistryKey] :: Registry key [Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MUI\Settings] does not exist. Return $null.
[08-07-2023 08:22:26.988] [Initialization] [Get-RegistryKey] :: Getting registry key [Registry::HKEY_USERS\S-1-5-21-682003330-842925246-839522115-149624\Software\Policies\Microsoft\Windows\Control Panel\Desktop] value [PreferredUILanguages].
[08-07-2023 08:22:27.003] [Initialization] [Get-RegistryKey] :: Registry key value [Registry::HKEY_USERS\S-1-5-21-682003330-842925246-839522115-149624\Software\Policies\Microsoft\Windows\Control Panel\Desktop] [PreferredUILanguages] does not exist. Return $null.
[08-07-2023 08:22:27.019] [Initialization] [Get-RegistryKey] :: Getting registry key [Registry::HKEY_USERS\S-1-5-21-682003330-842925246-839522115-149624\Control Panel\Desktop] value [PreferredUILanguages].
[08-07-2023 08:22:27.034] [Initialization] [Get-RegistryKey] :: Registry key value [Registry::HKEY_USERS\S-1-5-21-682003330-842925246-839522115-149624\Control Panel\Desktop] [PreferredUILanguages] does not exist. Return $null.
[08-07-2023 08:22:27.034] [Initialization] [Get-RegistryKey] :: Getting registry key [Registry::HKEY_USERS\S-1-5-21-682003330-842925246-839522115-149624\Control Panel\Desktop\MuiCached] value [MachinePreferredUILanguages].
[08-07-2023 08:22:27.128] [Initialization] [PSAppDeployToolkit] :: Display session information for all logged on users:


NTAccount           : Domain\Username
SID                 : S-1-5-21-682003330-842925246-839522115-149624
UserName            : username
DomainName          : Domain
SessionId           : 1
SessionName         : RDP-Tcp#3
ConnectState        : Active
IsCurrentSession    : True
IsConsoleSession    : False
IsActiveUserSession : True
IsUserSession       : True
IsRdpSession        : True
IsLocalAdmin        : False
LogonTime           : 8/2/2023 3:59:46 PM
IdleTime            : 00:00:03.7343829
DisconnectTime      : 8/7/2023 8:02:54 AM
ClientName          : PSYSTEM-PC4
ClientProtocolType  : RDP
ClientDirectory     : C:\Windows\system32\mstscax.dll
ClientBuildNumber   : 14393




[08-07-2023 08:22:27.144] [Initialization] [PSAppDeployToolkit] :: The following users are logged on to the system: [Domain\Username].
[08-07-2023 08:22:27.144] [Initialization] [PSAppDeployToolkit] :: Current process is running with user account [Domain\Username] under logged in user session for [Domain\Username].
[08-07-2023 08:22:27.144] [Initialization] [PSAppDeployToolkit] :: There is no console user logged in (user with control of physical monitor, keyboard, and mouse).
[08-07-2023 08:22:27.159] [Initialization] [PSAppDeployToolkit] :: The active logged on user is [Domain\Username].
[08-07-2023 08:22:27.175] [Initialization] [PSAppDeployToolkit] :: The active logged on user [Domain\Username] has a primary UI language of [EN].
[08-07-2023 08:22:27.175] [Initialization] [PSAppDeployToolkit] :: The config XML file was configured to override the detected primary UI language with the following UI language: [EN].
[08-07-2023 08:22:27.175] [Initialization] [PSAppDeployToolkit] :: The following UI messages were imported from the config XML file: [UI_Messages_EN].
[08-07-2023 08:22:27.175] [Initialization] [PSAppDeployToolkit] :: The active logged on user [Domain\Username] has a DPI scale factor of [100] with DPI pixels [96].
[08-07-2023 08:22:27.191] [Initialization] [PSAppDeployToolkit] :: Unable to load COM Object [Microsoft.SMS.TSEnvironment]. Therefore, script is not currently running from a SCCM Task Sequence.
[08-07-2023 08:22:27.191] [Initialization] [PSAppDeployToolkit] :: Skipping attempt to check for and make the task scheduler services healthy, because the App Deployment Toolkit is not running under the [NT AUTHORITY\SYSTEM] account.
[08-07-2023 08:22:27.206] [Initialization] [PSAppDeployToolkit] :: Session 0 not detected.
[08-07-2023 08:22:27.206] [Initialization] [PSAppDeployToolkit] :: Installation is running in [Interactive] mode.
[08-07-2023 08:22:27.206] [Initialization] [PSAppDeployToolkit] :: Deployment type is [Installation].
[08-07-2023 08:22:27.269] [Pre-Installation] [Test-PowerPoint] :: Checking if PowerPoint is in either fullscreen slideshow mode or presentation mode...
[08-07-2023 08:22:27.300] [Pre-Installation] [Test-PowerPoint] :: PowerPoint application is not running.
[08-07-2023 08:22:27.300] [Pre-Installation] [Test-PowerPoint] :: PowerPoint is running in fullscreen mode [False].
[08-07-2023 08:22:27.300] [Pre-Installation] [Show-BalloonTip] :: Displaying balloon tip notification with message [Installation started.].
[08-07-2023 08:22:27.378] [Pre-Installation] [Show-InstallationProgress] :: Creating the progress dialog in a separate thread with message: [Installation in progress. Please wait...].
[08-07-2023 08:22:28.467] [Post-Installation] [Close-InstallationProgress] :: Closing the installation progress dialog.
[08-07-2023 08:22:28.484] [Post-Installation] [Close-InstallationProgress] :: Closing the installation progress dialog's runspace.
[08-07-2023 08:22:28.550] [Post-Installation] [Exit-Script] :: PS_AppDeployToolkitMain_v_EN_1.0 Installation completed with exit code [0].
[08-07-2023 08:22:28.566] [Post-Installation] [Test-PowerPoint] :: Checking if PowerPoint is in either fullscreen slideshow mode or presentation mode...
[08-07-2023 08:22:28.581] [Post-Installation] [Test-PowerPoint] :: PowerPoint application is not running.
[08-07-2023 08:22:28.581] [Post-Installation] [Test-PowerPoint] :: PowerPoint is running in fullscreen mode [False].
[08-07-2023 08:22:28.597] [Post-Installation] [Show-BalloonTip] :: Displaying balloon tip notification asynchronously with message [Installation complete.].
[08-07-2023 08:22:28.675] [Post-Installation] [Execute-Process] :: [C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe] is a valid fully qualified path, continue.
[08-07-2023 08:22:28.738] [Post-Installation] [Execute-Process] :: Working Directory is [C:\Windows\System32\WindowsPowerShell\v1.0].
[08-07-2023 08:22:28.769] [Post-Installation] [Execute-Process] :: Executing [C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe [PowerShell ScriptBlock]]...
[08-07-2023 08:22:28.816] [Post-Installation] [Execute-Process] :: NoWait parameter specified. Continuing without waiting for exit code...
[08-07-2023 08:22:28.847] [Post-Installation] [Exit-Script] :: -------------------------------------------------------------------------------
PS Microsoft.PowerShell.Core\FileSystem::\\server1\SAP Analysis for Microsoft Office_v2.8>

Maybe try this:

$bitnessValue = Get-ItemProperty -Path “HKLM:\SOFTWARE\Microsoft\Office\16.0\Common” -Name Bitness
if ($bitnessValue.Bitness -eq “x86”) { … }

1 Like

Thank you, found the solution.
found 2 mistakes in my code.

Thanks guys :slight_smile:

1 Like

Glad to hear that you found the issue. I was going to mention that if the application was SAP Analysis for Office, you may want to double check the XML parameters (cant remember if it was exit 70 or 129). We struggled with that one for a while as well.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.