/build/static/layout/Breadcrumb_cap_w.png

Scripting Question


kace script to install 32bit or 64bit installer depending on processor architecture.

03/24/2015 6981 views
Hi there, 

I'm running into an unusual issue trying to create a batch script that determines if a workstation is 64bit or 32 bit, and chooses the appropriate dependency to execute. When I run the script, I get an msi error 1603. Looking in the msi install logs, the error says its trying to install the 32 bit msi on the 64 bit system. Logging in locally to this machine, when i run the same batch script, the logic works fine and it executes the correct installer. As a work around, i tried to put the script in a secondary batch script which i uploaded as a dependency, and executed that script as a sub-shell somewhat. Same issue.  Also worth noting, i have tried running the script as both "Logged in User" and "Local System". Same results both ways. 

Has anyone run into anything like this before?  

Here is the script below

@echo off
IF EXIST "C:\install.txt" (del C:\install.txt)

IF %PROCESSOR_ARCHITECTURE%==x86 (msiexec /i "install_x86.msi" /l*v "C:\install.txt"  /qn)
ELSE (msiexec /i "install_x64.msi" /l*v "C:\install.txt"  /qn)



0 Comments   [ + ] Show comments

Comments



Community Chosen Answer

4
The Kace Agent is 32 bit software, so doing a processor arch check will not give you your expected results. Probably easiest to verify presence of Program Files (x86)...

IF EXIST "C:\Program Files (x86)" msiexec /i "install_x64.msi" /l*v "C:\install.txt"  /qn
IF NOT EXIST C:\Program Files (x86)" msiexec /i "install_x86.msi" /l*v "C:\install.txt"  /qn
Answered 03/24/2015 by: SDNBTP
Third Degree Blue Belt

All Answers

0

this did work for me:

1) add a verify process, selecting Verify a WMI value exist...
                            Class Name  Win32_OperatingSystem
                            Attribute  :   OsArchitecture
                            Value :          32 bits         (or 64 bits depending on your system)

then
2) use on Success to execute or do something if comprobation is True
or Remedation Success to execute or do something if comprobation is False





Good Luck!

Answered 05/13/2019 by: ewoywood
White Belt

0
        @echo off

        IF EXIST "C:\install.txt" (del C:\install.txt)

        reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x32" > NUL && set OS=32BIT || set OS=64BIT

        if %OS%==32BIT (msiexec /i "install_x86.msi" /l*v "C:\install.txt"  /qn)
        if %OS%==64BIT (msiexec /i "install_x64.msi" /l*v "C:\install.txt"  /qn)
Answered 03/31/2015 by: rock_star
3rd Degree Black Belt

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ