Uninstall Dropbox

(imported topic written by Phil.C)

Need help writing a fixlet to uninstall dropbox. Having trouble because Dropbox installs itself in the user’s profile and I want to do a silent uninstall. I can invoke the uninstaller using runascurrentuser.exe but it triggers UAC which gives the user the opportunity to cancel. Is there a way to get this working? Here is my current action script:

if {exists current user}

prefetch RunAsCurrentUser.exe sha1:ee47505ebfb2790b9da8a20ed70e67158e9753d0 size:342528 http://software.bigfix.com/download/bes/util/RunAsCurrentUser-2.0.3.1.exe

utility __Download\RunAsCurrentUser.exe

run __Download\RunAsCurrentUser.exe --w --q {value “UninstallString” of keys “Software\Microsoft\Windows\CurrentVersion\Uninstall\Dropbox” of keys of key “HKEY_USERS” of registry as string & " /S"}

(imported comment written by Phil.C)

A possible workaround, this gives me the correct SID of the logged in user:

parameter “sid” = “{component string of sid of security account (“DOMAIN” & name of current user)}”

I’ve been trying to figure out how I could use that to point directly to the uninstaller and run it as SYSTEM but haven’t been able to.

Any ideas?

(imported comment written by SystemAdmin)

Can you simply kill the process if its running, delete the files, and delete the registry keys (configuration and uninstall keys)?

I’ve never profiled DropBox.

Guess I found a new task for Monday!

If I can determine what gets put where, I’ll post details here.

At some point I can imagine my ISO asking me to do this at work anyway.

(imported comment written by Phil.C)

Now I’m really confused. I got this to run in the QnA tool:

parameter “sid” = “{component string of sid of security account (“DOMAIN” & name of current user)}”

waithidden {value “UninstallString” of keys (“HKEY_USERS” & (parameter “sid”) & “\Software\Microsoft\Windows\CurrentVersion\Uninstall\SkyDriveSetup.exe”) of registry as string}

Then I ran it in a fixlet and I got this error in the logs:

Command failed (Relevance substitution failed) parameter “sid” = “{component string of sid of security account (“DOMAIN” & name of current user)}”

And then when I went back and ran it in QnA again, it failed with:

evaluation error - Relevance clauses must be surrounded by { and } guards.

Why did this work and now does not work??

(imported comment written by Phil.C)

This is for Skydrive, not Dropbox as in the original post. But they should both have similar actionscripts.

(imported comment written by jgolembi)

Where is the installer for Skydrive?

(imported comment written by jgolembi)

I think it will only work with a logged on user.

Did you try something like this?

waithidden __Download\RunAsCurrentUser-2.0.3.1.exe --w --q {value "UninstallString" of key "Software\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome" of current user keys (logged on users) of registry} --force-uninstall

-John G

(imported comment written by Phil.C)

The installer for Skydrive is in the user’s profile and the exact path changes depending on what build they have installed. For me it is:

C:\Users%USERNAME%\AppData\Local\Microsoft\SkyDrive\16.4.6010.0727\SkyDriveSetup.exe

For Dropbox it is at:

C:\Users%USERNAME%\AppData\Roaming\Dropbox\bin\Uninstall.exe

The UninstallStrings are located at:

HKU<SID>\Software\Microsoft\Windows\CurrentVersion\Uninstall\SkyDriveSetup.exe

HKU<SID>\Software\Microsoft\Windows\CurrentVersion\Uninstall\Dropbox

(imported comment written by jgolembi)

Something similar to this should get you the uninstallstring

value “UninstallString” of key “Software\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome” of current user keys (logged on users) of registry

(imported comment written by Phil.C)

I changed the action script to

run {value “UninstallString” of key “Software\Microsoft\Windows\CurrentVersion\Uninstall\SkyDrive.exe” of current user keys (logged on users) of registry as string}

and I get error Singular expression refers to nonexistent object.

(imported comment written by jgolembi)

I installed skydrive and used an action to successfully uninstall it silently. see below.

I think the relevance I gave you will fail in the relevance debugger, but will work in the context of the agent.

In order to test this relevance you will need to download the

client API tester

try this for your action:

waithidden __Download\RunAsCurrentUser-2.0.3.1.exe --w --q {value "UninstallString" of key "Software\Microsoft\Windows\CurrentVersion\Uninstall\SkyDriveSetup.exe" of current user keys (logged on users) of registry} /silent

-John G

(imported comment written by SystemAdmin)

Try this (using Flash as an example)

q: value “UninstallString” of key whose((it = “Adobe Flash Player 11 ActiveX”) of (value “DisplayName” of it)) of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry as string

A: C:\windows\SysWOW64\Macromed\Flash\FlashUtil32_11_4_402_265_ActiveX.exe -maintain activex

(imported comment written by SystemAdmin)

If the uninstall is in the current users key then you can do:

key (name of current user key of registry + “Software\Microsoft\Windows\CurrentVersion\Uninstall\SkyDrive.exe”) of registry

or the equivalent with logged on users but remember you need the full string (and those only work in the real agent)

(imported comment written by SystemAdmin)

If this worked:

waithidden __Download\RunAsCurrentUser-2.0.3.1.exe --w --q {value “UninstallString” of key “Software\Microsoft\Windows\CurrentVersion\Uninstall\SkyDriveSetup.exe” of current user keys (logged on users) of registry} /silent

Then remember logged on user and current user only work in when evaluated by the agent. I’d change it to use the singular and check there is a “current user” logged on before running it.

If you are using TEM 8.2 or better you can also do the following which doesn’t need to download a program:

override wait

hidden=true

runas=currentuser

wait __Download\RunAsCurrentUser-2.0.3.1.exe --w --q {value “UninstallString” of key “Software\Microsoft\Windows\CurrentVersion\Uninstall\SkyDriveSetup.exe” of current user key (current user) of registry} /silent

(imported comment written by SystemAdmin)

Correcting myself here. This is what the command would look like then (no need for the program - cut and paste bit me):

override wait

hidden=true

runas=currentuser

wait {value “UninstallString” of key “Software\Microsoft\Windows\CurrentVersion\Uninstall\SkyDriveSetup.exe” of current user key (current user) of registry} /silent