Create Task to uninstall app in Mac

I cant get app to uninstall from Mac. Would someone please take a look at action I wrote below based on info from application uninstall guide from app maker below.

  1. Procedure:Open a Terminal window. Navigate (cd) to the “/Library/Application Support/AccessX” directory
  2. Run the command ./uninstall when prompted, enter the password for an account with admin permissions
  3. Delete the “/Library/Application Support/AccessX” directoryReboot
    //stop activity

START OF BIGFIX ACTION****
//Stop process
wait killall accessx

//Change working directory and uninstall
wait cd /Library/Application Support/Accessx
wait ./uninstall

//Delete AgentX folder
wait rm -rf /Library/Application\ Support/Accessx

Thanks!

What happens when you run these commands in the command line as root, outside of BigFix?

This won’t work as the cd and the uninstall are on separate instances of a shell

You can chain them

wait cd "/Library/Application Support/Accessx"; ./uninstall
folder delete "/Library/Application Support/Accessx"

Running the commands in terminal works fine.

Thanks @AlanM. I followed your instruction via following steps below. The AccessX process terminated but the folder “/Library/Application Support/AccessX” didn’t get deleted. Am I missing anything? I also tried wait /bin/sh -c “rm -rf /Library/Application Support/AccessData” but it also did not remove the folder.

Here are the steps I had taken:

//Stop Process
wait killall AccessX

Delete __createfile
Delete runme.sh

createfile until myend
!/bin/sh
wait cd “/Library/Application Support/AccessX”; ./uninstall
folder delete "/Library/Application Support/AccessX"
Myend

move __createfile runme.sh

wait sh runme.sh

You didn’t need the shell

You can just do this as these are all Actionscript commands

//Stop Process
wait killall AccessX
wait cd "/Library/Application Support/AccessX"; ./uninstall
folder delete "/Library/Application Support/AccessX"

Thanks @AlanM. I tried the steps above but it still resulted in failure.

Here is the Action Script Execution Detail:

Completed
//Stop Process

Completed
wait killall AccessX

Completed
wait cd “/Library/Application Support/AccessX”;
./uninstall

Failed
folder delete “/Library/Application
Support/AccessX”

Note that you need to type it like this (all on one line) not on two lines like you showed

You may need to type it like this too

wait /bin/sh -c "cd '/Library/Application Support/AccessX'; ./uninstall"

@AlanM, Sorry for delayed response. I tried your suggestion and it does remove the process but the folder is still there.

Hi @AlanM

I’m using the below script to uninstall FortiClient from Mac OS X but it’s getting failed at this line:

folder delete “/Library/Application Support/Fortinet/FortiClient”
Exit Code: 127 as illigal_command Exit Codes With Special Meanings

//Uninstall FortiClient
//Stop Process
wait killall FortiClient
wait /bin/sh -c "cd '/Library/Application Support/Fortinet/FortiClient'; ./uninstall"
folder delete "/Library/Application Support/Fortinet/FortiClient"
if {exists folder "/Applications/FortiClient.app"}
    wait /bin/rm -rfd "/Applications/FortiClient.app"
endif 

If I’m removing the line “folder delete…” from the script, it runs successfully and able to uninstall the app but all folder still exist in the desired path.
Can you please help me on this ?

Thank You.

If the folder is in use we may not be able to delete it. The client log should give more detailed information (it will log the reason for the failure not log an exit code)

1 Like