Tuesday, April 30, 2013

Solved: How to enable LabTech remote uninstall

Uninstall Application vs. Uninstall Application User.  What's the difference and why are there two buttons for one process?  The most common workflow when someone new to LabTech finds the software uninstall option is to try it, then report to support it doesn't work.  What is going on under the covers and (more importantly) how do you make it work?

This command is no different from most other LabTech commands in that its run by the Local System Account (LSA).  What happens when you press that button is the exact same thing as if you did it on the local computer in Add\Remove Programs.  99 times out of 100, you'll be prompted 'Are you sure?'  Thing is, the LSA can not paint to the desktop so no one can ever see that prompt.  It sits and waits for a response that never comes and meanwhile it looks to the technician that the command has failed.

If you're skeptical try this next time: send the command to refresh the local processes.  I bet you'll see an msiexec.exe in there.  That's your uninstall prompt waiting for a response and that's the point of Uninstall Application User - it is run by the LabTech Tray (which is running in the user's security context) so the user will see the prompt and can click it for you.  In a pinch that's OK but we don't want to build a service offering around that jenked process.  How do we click that button?

We can't - we have to make it so that dialogue never occurs, just like if you had checked the 'In the future, don't show me this dialogue box'.  How do we do that progromatically?  Simple - use the registry!

You should use this process on every application you deploy thru LabTech.  This way, anytime you need to un\re install an app, you won't need to interrupt the user and you'll have 100% full control of all the application on a remote computer.  For example, on my ConnectWise install script, I've the following line:

Registry Set Value: HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\DontShowMeThisDialogAgain\{948e51fb-0a48-44f0-86ac-33c36def540c} = NO (reg_sz)

Now my right-click, uninstall application button in LabTech works flawlessly.

Remember, real men don't click. (hat-tip to an old web page that was mighty helpful back in the day)  Hope this tip helps you in your endeavors and Happy LabTeching everyone!

No comments:

Post a Comment