leeolayvar Posted November 3, 2013 Posted November 3, 2013 Is there any type of event during the installation of a workflow, that you can hook into? Eg, what if you wanted to install custom modules/etc during installation since it may be better *not* packing them into the workflow itself. Is this possible?
vitor Posted November 3, 2013 Posted November 3, 2013 I think it’s not possible (and I’m guessing it’ll stay that way, for security reasons), but what you could do is add a “configure” option to your workflow (similar to how workflows that need login credentials and other specific information do), that’ll do that for you.
leeolayvar Posted November 3, 2013 Author Posted November 3, 2013 Why not, in regards to security reasons? Eg, if you are able to run python/bash/etc, security is out the window. By not allowing installation hooks/scripts/etc, all you do is move the security concerns from installation, to runtime.. which doesn't seem to matter to me. I'm not arguing for it necessarily, just commenting At any rate, if i (or any developer) *needs* an installation/configure stage, all you're going to do is make that phase trigger on first run of your application. Eg, some Workflows popup asking for configuration (such as API Keys, etc).
vitor Posted November 4, 2013 Posted November 4, 2013 By not allowing installation hooks/scripts/etc, all you do is move the security concerns from installation, to runtime.. which doesn't seem to matter to me. It does matter. I (and I’m guessing others) tend to open up new workflows to see how they work, in search for interesting solutions; by doing this, it means we can find security issues and alert others without having our own machines compromised in the process. If the code runs at installation time, there’s no way to check it before running, and that is really bad. Let’s take a non-security-related example. With DownVid, I chose not to implement a way to extract the audio by default. I did this since that action would rely on ffmpeg, which is not public domain, and I want to maintain my workflow as such (I believe allowing other people to tinker with the code to be so important that I’m willing to sacrifice that feature for it). Since some people asked for that feature, what I did was make a small tutorial to implement it. With your suggestion, what I could do is simply install ffmpeg at runtime, but imagine you don’t want ffmpeg, why should I be installing something on your system, outside of Alfred, without your consent? Having that extra step (having to run a command to configure, vs doing it automatically at runtime) makes for a slightly worse user experience, sure, but the tradeoffs are, as I see it, worth it — they give you a choice.
leeolayvar Posted November 4, 2013 Author Posted November 4, 2013 Fair, and i agree with your points. I'm new to the common user alfred workflow .. workflows, so pardon any incorrect assumptions.
rice.shawn Posted November 4, 2013 Posted November 4, 2013 One way to "force" the configuration on first run is to use a script filter. Then you can check to see if a "first-run" file exists in your data directory. If it doesn't, then you can present the user with only the option to configure. If you need more interaction than a script filter would provide for the actual configuration, then I'd recommend using some applescript dialogs. I do think that it's a good idea not to install anything on the user's computer without letting them know and giving them the option to just delete the workflow instead of installing. If you do install something, then you should probably put it in the data directory, and, if you want to get fancy, then add in an "uninstall" command to remove those components.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now