/build/static/layout/Breadcrumb_cap_w.png

Verify Windows architecture in Scripting


I am creating a script for installing Google Chrome.

However I had to create a script for each architecture (x86 and x64).

I could not finish the script in x64 version because it does not finish the installation. How do I create a script that checks whether it is x86 or x64 before installing? And depending on the answer, do you run different installation packages?







  
  





  


    
      
    

    

      
      

      
      

    

  

  

    

    
      
    

    
      
      

      
      

      
      

    

  





Thank you!

0 Comments   [ + ] Show comments

Answers (3)

Answer Summary:
Posted by: Desktop Jockey 6 years ago
Second Degree Green Belt
2

Top Answer

If you are using the K1000 then you could put this as a verify task:

Verify a registry value is exactly...
Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
Name: PROCESSOR_ARCHITECTURE
Equal to: x86

32 bit will be on the Success side and 64 bit will be on the remediation side.

Comments:
  • This really works. When I use Google Chrome, what is the best option to see if the program has actually been installed? - lpansarini 6 years ago
    • Normally after the install process, I would put a runkbot 4 0 so that the Kace inventory gets updated.

      Launch a program:
      Directory: $(KACE_INSTALL)
      File: runkbot.exe
      Parameters: 4 0 - Desktop Jockey 6 years ago
      • Ok, I got it. But is there any best practice to see if the program was installed correctly in the script? In my case, I'm releasing this script to the end user, and tell him if the software was installed or not - lpansarini 6 years ago
      • I said this because my park is almost 5000 computers and I can not update the inventory for every installation I make - lpansarini 6 years ago
      • I also work in a large challenging environment.
        I just create a label for that software and follow the deployment through the label.

        If you have the script set to break on error then it will fail if your software returns any code other than 0.

        If you would like to add redundancy, then you can verify that the software GUID was placed in HKEY_CLASSES_ROOT\Installer\Products\XXXXXX - Desktop Jockey 6 years ago
Posted by: Nico_K 6 years ago
Red Belt
2

If %PROCESSOR_ARCHITECTURE% == x86 set archtype=x86
If %PROCESSOR_ARCHITECTURE% == AMD64 set archtype=x64

If %archtype%==x86 GOTO X86
If %archtype%==x64 GOTO X64

:X86
echo this is an IA32 system

GOTO END

:X64
echo this is an EM64T/AMD64 system

GOTO END

:END


I would setup two different installs and collect the info of the architecture using a device label, since you can reuse these labels... 


Comments:
  • It works, but it is not fully functional for installations with software that are inside Kace already, but with softwares in dependence. Thank you - lpansarini 6 years ago
Posted by: lpansarini 6 years ago
Senior Yellow Belt
1
<?xml version="1.0" encoding="utf-8" ?><kbots xmlns="http://kace.com/Kbots.xsd"><kbot><config name="Instalação do Google Chrome - via SD" type="policy" id="184" version="1497895536" description="Instalação do Google Chrome pelo Service Desk">  <execute disconnected="false" logged_off="true">  </execute></config><compliance>    If %PROCESSOR_ARCHITECTURE% == x86 set archtype=x86If %PROCESSOR_ARCHITECTURE% == AMD64 set archtype=x64If %archtype%==x86 GOTO X86If %archtype%==x64 GOTO X64:X86      <verify on_failure="break" attempts="2">    <on_verify_success>       <install software_id="8462" name="Google Chrome" install_cmd="C:\ProgramData\Dell\KACE\downloads\8462\ChromeStandaloneSetup.exe /SILENT /INSTALL" download_location="http://spsrv079-vm.klabin.net/packages/7767/ChromeStandaloneSetup.exe" checksum="ee8b8c9ef8701aa4389a0054c2095bdc" flags="" />    </on_verify_success>    <on_verify_failure>      <on_remediation_success>      </on_remediation_success>      <on_remediation_failure>      </on_remediation_failure>    </on_verify_failure>  </verify>      <verify on_failure="break" attempts="1">    <directory_exists path="C:\Program Files\Google\Chrome\Application" />    <on_verify_success>      <create_message_window name="InstalaçãoFinalizada" title="Instalação do Google Chrome finalizado" message="A instalação foi realizada. Qualquer dúvida entre em contato com o 5522" timeout="60" />    </on_verify_success>    <on_verify_failure>      <create_message_window name="InstalaçãoFinalizada" title="Instalação Google Chrome não finalizada" message="Entrar em contato com o 5522" timeout="60" />      <always_fail />      <on_remediation_success>      </on_remediation_success>      <on_remediation_failure>      </on_remediation_failure>    </on_verify_failure>  </verify>GOTO END:X64    <verify on_failure="break" attempts="2">    <on_verify_success>      <install software_id="8619" name="Google Chrome x64" install_cmd="C:\ProgramData\Dell\KACE\downloads\8619\ChromeStandaloneSetup64.exe /SILENT /INSTALL" download_location="http://spsrv079-vm.klabin.net/packages/7773/ChromeStandaloneSetup64.exe" checksum="908ca6e3aba47c8f30a29a87ddb0d98e" flags="" />    </on_verify_success>    <on_verify_failure>      <on_remediation_success>      </on_remediation_success>      <on_remediation_failure>      </on_remediation_failure>    </on_verify_failure>  </verify>      <verify on_failure="break" attempts="2">    <directory_exists path="C:\Program Files (x86)\Google\Chrome\Application" />    <on_verify_success>      <create_message_window name="InstalaçãoFinalizada" title="Instalação do Google Chrome finalizado" message="A instalação foi realizada. Qualquer dúvida entre em contato com o 5522" timeout="60" />    </on_verify_success>    <on_verify_failure>      <create_message_window name="InstalaçãoFinalizada" title="Instalação Google Chrome não finalizada" message="Entrar em contato com o 5522" timeout="60" />      <always_fail />      <on_remediation_success>      </on_remediation_success>      <on_remediation_failure>      </on_remediation_failure>    </on_verify_failure>  </verify>GOTO END:END</compliance></kbot></kbots>

I used that XML and i got that error

 
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