File.startAsProcess() wrapper
-
I'm considering adding this function to the API. It will allow us to launch an external file from within our plugins/apps.
This could be useful for example if your app automatically downloads a new installer when an update is released, you could ask the user if they want to run the installer and with their approval the installer will launch. You could also use it for opening a PDF file to display a user guide to the user.
There is however the possibility that it can be used maliciously to execute programs without the user's permission, this makes me hesitant to add a wrapper for it.
What is the general opinion here about such functionality?
-
This would be very useful to me as I'm currently designing a downloader app for my products.
-
@d-healey I think this would be pretty good. "Opening files" has already been used by lots of plugin manufacturers. For executing the installers, it would be awesome though.
I am not sure this is already available in Hise but, also "Opning folders" would be great too.
-
@d-healey +1 good idea
-
@orange said in File.startAsProcess() wrapper:
but, also "Opning folders" would be great too.
This is already possible. I think it's File.show().
Ok I've implemented the function now. I'll push it to my fork soon and make a pull request.
-
@d-healey Hmm... I thought Christoph implemented this already because I made one for my own use and prepared a pull request but I've seen it was done in the meantime. It's not in the API list though, but you might have a look before making a new one. But I might be mistaken here, mixing up with something else...
-
@ustk I couldn't see it in the source, any idea what it's called?
-
@d-healey Yeah neither do I (I searched all branches). I think it's a mistake of me, so go ahead :)
-
Done - https://github.com/christophhart/HISE/pull/226/commits/e7f4d9595f9cc47848a5abe01ebd4a63e75fd147
I also added a wrapper function to set the execute permissions on a file and one to check how much space is left on the disk - a good thing to check before downloading files.
-
I also added a
Engine.quit()
function so we can close our app once we've launched the update installer. I don't know if it's safe to use this function in a plugin, my use case if for a standalone app only, let me know if you try it in a plugin :) -
@ustk said in File.startAsProcess() wrapper:
@d-healey Yeah neither do I (I searched all branches). I think it's a mistake of me, so go ahead :)
I think the .unzip function was added a couple of months ago, maybe that's the cause of the confusion.