Deleting .app file

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
hrcap
Posts: 131
Joined: Mon Jan 14, 2019 5:20 pm

Deleting .app file

Post by hrcap » Sun Jul 04, 2021 8:56 am

Hi Guys

I hope that you are all having a good weekend.

I wonder if anyone could shed some light on the following please: I have my standalone saved on my desktop on Mac. The path to the standalone is:

/Users/user1/Desktop/Eample.app

When running the following script it returns 'can't delete that file'.

I have ensured that the Example.app file is not running and is closed.

Code: Select all


on mouseup

   put specialfolderpath(desktop) into t_pre
   set the defaultfolder to t_pre
   
   
   put t_pre & "/" & "Example.app" into t_file_delete
      
      
   -- attempt 1
   delete file t_file_delete
   put the result
   
   
   -- attempt 2
   delete file specialFolderPath(desktop) & "/Example.app"
    put the result
   
   -- attempt 3
   delete folder t_file_delete
    put the result
   
   -- attempt 4
   delete URL ("file:" & t_file_delete)
    put the result
   
   ---
   
end mouseup



Many Thanks

Hadleigh

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Deleting .app file

Post by jmburnod » Sun Jul 04, 2021 11:32 am

Hi,
Same result here (OS X 10.14.6, LC 9.6.1, file unlocked read and write allowed)
I never needed to delete a livecode.app file.
I'm curiose to know why you need this.
Best regards
Jean-Marc
https://alternatic.ch

hrcap
Posts: 131
Joined: Mon Jan 14, 2019 5:20 pm

Re: Deleting .app file

Post by hrcap » Sun Jul 04, 2021 11:40 am

Hi Jean Marc

Thanks for looking in to this.

I am making an Uninstaller to delete the App and its supporting files.


*Update
I have also now tried changing the file name within the script to remove the '.app' suffix to see if this would allow the delete, but again no luck.


Any further help from anyone would be appreciated.


Many Thanks

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Deleting .app file

Post by FourthWorld » Sun Jul 04, 2021 5:26 pm

A Mac app bundle isn't a file, it's a folder.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

hrcap
Posts: 131
Joined: Mon Jan 14, 2019 5:20 pm

Re: Deleting .app file

Post by hrcap » Sun Jul 04, 2021 5:46 pm

Hi Richard

Thank you, I have also tried the delete folder command, but to no avail.


Many Thanks

Hadleigh

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7227
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Deleting .app file

Post by jacque » Sun Jul 04, 2021 6:00 pm

You can't delete a folder unless it's empty, you need to remove all its contents first. Try the revDeleteFolder command, it does that for you.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Deleting .app file

Post by jmburnod » Sun Jul 04, 2021 6:05 pm

Thanks Jacque

Code: Select all

revDeleteFolder t_file_delete
works :D
Best regards
Jean-Marc
Last edited by jmburnod on Mon Jul 05, 2021 1:37 pm, edited 3 times in total.
https://alternatic.ch

hrcap
Posts: 131
Joined: Mon Jan 14, 2019 5:20 pm

Re: Deleting .app file

Post by hrcap » Mon Jul 05, 2021 12:28 pm

Thanks Jacque

That has also worked for me :D

Every day is a school day



Many Thanks

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”