Skip to content

Detection rule ... BUT ... for successfuly uninstalled application

Featured Replies

Hello,

 

I've been reading the forum for a while but this is my first post on this fantastic forum. First of all thank you for the great informations :)

 

My issue is actually a bit tricky and related to the SCCM 2012 application installation detection rule. I'm actually trying to install Lync 2010 (the install works well) but as a pre-req and to ensure the systems no longer have a previous OCS or Lync version installed I would like to run the Following command prior to the install : Lyncsetup.exe /uninstall /silent

 

The tricky part is about the detection rule of such a command line. It always fails because I'm not able to test the presence of a folder/file, a windows installer or a registry key since the application will no longer be present on the system. :unsure:

 

I might be missing something but is it possible to create something like that by simply using several deployment types dependencies in one single application ???

 

Many thanks in advance

  • Author

THank you very much for the reply :) I acutally came with something which seems to work, by using the following script

 

Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oShell = WScript.CreateObject("WScript.Shell")

If oFSO.FileExists(oShell.ExpandEnvironmentStrings("%ProgramFiles%\Microsoft Lync\communicator.exe")) or oFSO.FileExists(oShell.ExpandEnvironmentStrings("%ProgramFiles(x86)%\Microsoft Lync\communicator.exe")) or oFSO.FileExists(oShell.ExpandEnvironmentStrings("%ProgramFiles%\microsoft office communicator\communicator.exe")) or oFSO.FileExists(oShell.ExpandEnvironmentStrings("%ProgramFiles(x86)%\microsoft office communicator\communicator.exe")) Then
WScript.Quit(0)
Else
WScript.StdOut.Write "The application is installed"
WScript.Quit(0)
End If

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.