I have an install.bat file written for me by someone. It needs to install an app based on the bitness of MSOffice on a client terminal. It also needs to run an SQL client driver install file based on the bitness of Windows.
The SQL part works fine. But it constantly installs the 32bit version of the app instead of the 64bit when i definitely have 64bit office installation (have tested on 2 machines both with 64bit office). I'm sure that an expert would be able to glance through the code and quickly tell me what the issue is. This isn't my area of expertise but I know it's not terribly complicated. In the install folder there is a folder called Source32 and Source64. Two 32bit apps in the Source32 and two 64bit apps in the Source64 folder. It fetches these from the relevant folder and puts them into a created folder in root directory (C:\QuickSuite). I only have a very vague idea of what i am looking at so i am not even that sure what to try.
@Echo off&SetLocal
Set "KEY="&Set "GUID="&Set "IOV="&Set "MWB=32"&Set "MOB=32"
Echo=%PROCESSOR_ARCHITECTURE% %PROCESSOR_ARCHITEW6432%|Find "64">Nul&&(
Set "KEY=\Wow6432Node"&Set "MWB=64")
Set "KEY=HKLM\Software%KEY%\Microsoft\Windows\CurrentVersion\Uninstall"
For /f "Delims=" %%a In ('Reg Query %KEY% /k /f "*-001B-*0FF1CE}"') Do (
If Not Defined GUID Set "GUID=%%~nxa")
If Not Defined GUID (Echo=Unable to find Office Product&GoTo :EndIt)
If %GUID:~20,1% Equ 1 Set "MOB=64"
If %GUID:~4,1% Equ 4 (Set IOV=10) Else (If %GUID:~4,1% Equ 6 (Set IOV=16) Else (If %GUID:~4,1% Equ 2 (Set IOV=07) Else (
If %GUID:~4,1% Equ 5 (Set IOV=13) Else (Set IOV=??))))
Echo=&Echo= Office 20%IOV% %MOB%-bit Product installed on a %MWB%-bit OS
If %MWB% == 64 (
@Echo Windows 64-bit...
msiexec /i "%~dp0sql64\sqlncli_x64.msi" IACCEPTSQLNCLILICENSETERMS=YES /qb
)
If %MWB% == 32 (
@Echo Windows 32-bit...
msiexec /i "%~dp0sql32\sqlncli_x86.msi" IACCEPTSQLNCLILICENSETERMS=YES /qb
)
cd %~dp0
SET _source64=.\Source64
SET _source32=.\Source32
SET _dest=%systemdrive%\QuickSuite
SET _FrontOffice=.\FrontOffice
SET _RemoteSMS=.\RemoteSMS
SET _dest_RemoteSMS=%systemdrive%\QuickSuite\RemoteSMS
SET _dest_FrontOffice=%systemdrive%\QuickSuite\FrontOffice
If %MOB% == 64 (
@echo Microsoft Office is 64-bit
robocopy %_source64% %_dest% /E
robocopy %_FrontOffice% %_dest_FrontOffice% /E
robocopy %_RemoteSMS% %_dest_RemoteSMS% /E
)
If %MOB% == 32 (
@echo Microsoft Office is 32-bit
robocopy %_source32% %_dest% /E
robocopy %_FrontOffice% %_dest_FrontOffice% /E
robocopy %_RemoteSMS% %_dest_RemoteSMS% /E
)
:EndIt
TimeOut /t 5 1>Nul