Jump to content


Hexa

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

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.