I'm trying to deploy Java using some of the tools here. One great tool I want to run as a dependency is a batch file that uninstalls all versions of Java. The only want to do this is to add it as an application through SCCM, but SCCM requires that all applications be detected of it's presence to continue. How would I go about doing this if msi & registry keys aren't really in the mix (or maybe they are)?

The JavaUninstall.bat can be found here http://www.itninja.com/blog/view/deploying-java-7-through-gpo

3 Comments   [ + ] Show Comments

Comments

  • I'm not a SCCM guy, but could you just use the uninstall strings to detect since that should be in the registry? HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall
    • I could. For some reason I thought I could only add one msi to the detection rule. This may work out. I'll give it a shot and reply back. Thanks!
  • I've done some stuff with scripts where I didn't have a file or folder to validate against because it was deleted. In these scenarios, I add a line to the script that copies a file to a temp folder called complete.flag and validate against it's modified date to verify my script ran. I can then "edit" this complete.flag file (just a plain text file) and alter the modified date as needed with each deployment. This lets me run updated versions of the same script without it triggering as already run and skipping it.
  • I use a custom script, VBScript, as a detection method, to see if a folder has been correctly deleted:

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    strFolder = "<folder location>"
    If not (objFSO.FolderExists(strFolder)) Then Wscript.Echo "Ok"
    End If

    As long as the check returns something (in this case, the text Ok, the check is considered to be successfull.
Please log in to comment

There are no answers at this time

Answers

Answer this question or Comment on this question for clarity
Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja

Share