Detection Method file

Hi,
I’m installing an exe application.
I’m trying to get an SCCM detection method to detect a file and it’s version.
Unfortunately it is always failing. If I retry the deployment it detects the installation correctly.

I suppose the reason is PSAppdeploy launching another process and SCCM check too early for the file.
Is there any way to get around this?

Thanks

I’ve always found that detection of registry changes works the best. I have mine verify the display version of the application. Doing this will allow for easy upgrades of the application in the future because rather than checking for file location It’ll check for the version number. Most of the time applications use the same location from version to version. Also using a Start-Sleep command after install for a minute will sometimes fix the error you are having because it will give the script time to finish before SCCM verifies the install.

I’ve had good luck with doing this with a do until command. Two ways to do this. First is watch the task manager to see what the name of the child process that is actually going the install (not the setup.exe as this is just a wrapper) and have your script loop until that process is complete. The second is to do a loop to wait until the exe your using in the detection method is present. In other words…

Do
{
$exePresent = Test-Path -path
}
Until $exePresent

Or this

Do
{
$running = Get-process -name
}
Until $running

Hope this helps.

1 Like

ConfigMgr does not detect the version number in all file types. I think it is only .exe files (not sure about .dll files) and it must adhere to the .net version standard.

I try to avoid using it unless absolutely necessary.

Check in pslogs, which application is launching and what process. You can then script it to kill that process, if it is hampering in application installation on your machine.

Also, you can check for how much time you have allowed application to get installed on the machine. My understanding is detection logic tries to find application only in beginning and after installation has completed from sccm(please correct me if I am wrong here) .