Deploy software through KACE K1000 is really easy but how we can deploy a software that has multiple installers each for every platform (Windows XP & Windows 7) and architecture (x64 & x86)?
I realized a script that helps you to detect the architecure and the platform.
@echo off
if %PROCESSOR_ARCHITECTURE% ==x86 (
goto :x86
)
else (
goto :x64
)
:x86
if exist "C:\Users\All Users\ntuser.dat" goto win7x86
if exist "C:\Documents and Settings\All Users\ntuser.dat" goto winxpx86
goto osnotdetected
:win7x86
REM Place here the installer command for Windows 7 or Vista 32bit
SetupForWin7x86.exe /S
goto :eof
:winxpx86
REM Place here the installer command for XP 32bit
SetupForXPx86.exe /S
goto :eof
:x64
if exist "C:\Users\All Users\ntuser.dat" goto win7x64
if exist "C:\Documents and Settings\All Users\ntuser.dat" goto winxpx64
goto osnotdetected
:win7x64
REM Place here the installer command for Windows 7 or Vista 64bit
SetupForWindows7x64.exe /S
:winxpx64
REM Place here the installer command for Windows XP 64bit
SetupForWindowsXPx64.exe /S
goto :eof
:osnotdetected
Echo I have no idea what OS is this one
REM The end
Caveats:
- The script is given AS IS. You need to test it and adapt it to you needs before to adopt it.
- The script bases the decision about the OS (XP or Vista/7) based on the presence of a system file in a specifc path: if your OS language is not English you may need to refurbish it a bit...
@echo off
Set RegQry=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion
REG.exe Query %RegQry% > clientversion.txt
Find /i "6.1" < clientversion.txt > StringCheck.txt
If %ERRORLEVEL% == 0 (
DO STUFF HERE THAT WOULD BE DONE ON WINDOWS 7/R2
goto exit
) ELSE (
DO STUFF HERE THAT WOULD BE DONE ON WINDOWS XP, ETC
goto exit
)
:exit
Expand on the functionality or text within the find string if you want to search for different things (i.e. combine search for Client vs. Server) - drose23 11 years ago