/build/static/layout/Breadcrumb_cap_w.png

Checking model of PC

Hi,

Can someone share with knowledge about custom action in MSI, what I need is custom action which checks type of model on XP OS and if it is correct the installs the drivers if not then skips.

I have no idea that there is such but I may think that some of you may know it.


0 Comments   [ + ] Show comments

Answers (3)

Posted by: SMal.tmcc 12 years ago
Red Belt
3

you can use wmi to get info also

wmic csproduct get name

then use it a a script like:

@ECHO OFF
REM do a wmi query to get the info we want and put it in a variable
FOR /F "tokens=2 delims==" %%A IN ('WMIC csproduct GET Name /VALUE ^| FIND /I "Name="') DO SET machine=%%A
ECHO Computer model: "%machine%"

REM Now we have the model in a variable we can do some logic and run commands, for example...
REM Watch for stray spaces at the end, take out all spaces with: SET machine=%machine: =%
IF /I "%machine%" == "Latitude E6410" (
REM do something specific for an E6410
) ELSE (
REM do something for other types
)

Posted by: AgentMrQ 12 years ago
Senior White Belt
2

I'm not sure of any native way to make a MSI look for a model. However you can make an easy script to verify the make or model of a workstation prior to installing the MSI package.

Model.vbs

 Dim objWMI : Set objWMI = GetObject("winmgmts:")
Dim colSettingsComp : Set colSettings = objWMI.ExecQuery("Select * from Win32_ComputerSystem")
Dim colSettingsBios : Set colSettingsBios = objWMI.ExecQuery("Select * from Win32_BIOS")
Dim objComputer, strModel, strSerial
For Each objComputer in colSettings
  strModel = objComputer.Model
Next
For Each objComputer in colSettingsBios
  strSerial = objComputer.SerialNumber
Next
wscript.echo strModel
wscript.echo strSerial
 

This will return the SN and model of the computer. If you modify this to do an IF statment to RUN your package when they match, this should do it for you.

If strModel = "ProLiant ML110 G6" Then Call InstallPKG

wscript.quit

Sub InstallPKG

objShell.Run("\\server\share\package.MSI")

end sub

Just modify the code to how you want it. Then just run the VBScript and not the MSI to verify for you if the model matches. You can use other WMI fields to check for OS, RAM, Speed, etc...

 

Hope this helps.

Posted by: dunnpy 12 years ago
Red Belt
-2

SCCM can handle this with its own in-built queries, so that you populate a collection to deploy to based on model number etc.

 

If you don't have a deployment method that can identify these items, then the script above would do the job.

 

Hope that helps,

 

Dunnpy

 
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