I is possible to eject a volume from a LC project running on that volume?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
I is possible to eject a volume from a LC project running on that volume?
I want to put my app on a USB flash drive. When it quits, I want it to eject the volume on which it resides. Is this possible?
I have been able to eject a flash drive volume when the app was not on it (by issuing a shell command), but I have been unable to eject the volume when the app is on that drive.
I have been able to eject a flash drive volume when the app was not on it (by issuing a shell command), but I have been unable to eject the volume when the app is on that drive.
-
- VIP Livecode Opensource Backer
- Posts: 9842
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: I is possible to eject a volume from a LC project running on that volume?
I don't believe an app can eject the volume it's mounted on.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: I is possible to eject a volume from a LC project running on that volume?
I was afraid of that.
Thanks.
Thanks.
Re: I is possible to eject a volume from a LC project running on that volume?
Yes, that would be a bit like trying to lift yourself up off the ground by pulling your shoes. Well, nothing like it at all, but you see where I'm going.
You could write a script file to a temp folder on the PC and when shutting down the LC app, you could launch the temp script to eject the drive, maybe with a slight delay to allow LC app to close gracefully. The temp script could not then delete itself, but it would only leave a little cruft on the computer.
You could write a script file to a temp folder on the PC and when shutting down the LC app, you could launch the temp script to eject the drive, maybe with a slight delay to allow LC app to close gracefully. The temp script could not then delete itself, but it would only leave a little cruft on the computer.
Re: I is possible to eject a volume from a LC project running on that volume?
Thanks SparkOut for the suggestion. Actually I am working on exactly that. When the app on the flash drive shuts down, it launches another app on a different drive that ejects the flash drive. Not ideal but it will serve the purpose. Now I am trying to figure out how to get the second app (that ejects the drive) to do so automatically without user intervention (like clicking a button).
Re: I is possible to eject a volume from a LC project running on that volume?
From LC
"launch"
or maybe "open process"
And actually this open source tool is apparently able to eject the drive it is on... go figure. Or test, anyway
https://quickandeasysoftware.net/softwa ... sk-ejector
"launch"
or maybe "open process"
And actually this open source tool is apparently able to eject the drive it is on... go figure. Or test, anyway
https://quickandeasysoftware.net/softwa ... sk-ejector
-
- VIP Livecode Opensource Backer
- Posts: 9842
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: I is possible to eject a volume from a LC project running on that volume?
Uninstallers do that, including LiveCode's, which is made in LiveCode.xyz wrote: ↑Fri Apr 10, 2020 2:17 pmThanks SparkOut for the suggestion. Actually I am working on exactly that. When the app on the flash drive shuts down, it launches another app on a different drive that ejects the flash drive. Not ideal but it will serve the purpose. Now I am trying to figure out how to get the second app (that ejects the drive) to do so automatically without user intervention (like clicking a button).
On launch it checks the folder it's in, and if it's not in temp it copies itself to temp, launches it, and quits. Then the new copy in temp takes over, and because there's no active app in the app folder it can then delete that folder and it's contents.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn