Add-on Install & Upgrade

Add-on Install & Upgrade 1.4.3

No permission to download
A question, files like "instructions.html" or "readme.txt" are leaved behind, right?
If they're in the upload folder, they'll be copied to the root of your installation. But no add-on developer should leave those files in there. If they're in the zip but not in the upload folder then they'll be ignored.

Everything in the zip file is extracted to the server so even if you had a no upload folder - that would be on the server too. There's no way around this as fundamentally, the entire contents of the zip file need to be extracted to the server.

However, only the contents of the "upload" folder are copied into the root of your XenForo installation.
Chris,

With XF Arcade there is an optional .xml file that needs to be included for admins wanting to use MochiMedia games. We need to include in the zip file for admins to have available to them but there is no way your installer would be able to handle it because it needs to be in the site root folder. For that reason I like the idea that somebody suggested earlier about having a "no_upload" folder that is ignored during the copy routine. That way can still be in 'compliance' with your installer while having extra files that are optional for the site admin to manually FTP themselves.

I see that you also mentioned that you're using a staging folder for the upload prior to the copy; is it safe to assume that folder is getting cleared out after the files copies are done?

Regarding a 'readme.html' file, it would be excellent if that file was able to be viewed inline or launched to the browser as part of the installation process. As it is now with a readme.html file admins typically unzip the file on the local PC, read the instructions file, and then FTP to the server. With an automated upload process it eliminates the admin even knowing that there might be an instructions file in the zip making such a file totally useless unless there was some way for the admin to either be alerted to it or be able to view it during the automated install.
 
Chris,

With XF Arcade there is an optional .xml file that needs to be included for admins wanting to use MochiMedia games. We need to include in the zip file for admins to have available to them but there is no way your installer would be able to handle it because it needs to be in the site root folder.
Any file that is in the upload folder is copied to the root of the XenForo installation. So of course it can handle it... unless I'm missing something?

For that reason I like the idea that somebody suggested earlier about having a "no_upload" folder that is ignored during the copy routine. That way can still be in 'compliance' with your installer while having extra files that are optional for the site admin to manually FTP themselves.
Only files in the upload folder are uploaded and copied, so this is do-able yourself. The structure would look something like this:

dkvnLG2.png


I see that you also mentioned that you're using a staging folder for the upload prior to the copy; is it safe to assume that folder is getting cleared out after the files copies are done?
Nope. This version (beta) doesn't make any effort to clear the addon-prestage folder. When I finish the next version (soon) it should clear up after each install routine.

Regarding a 'readme.html' file, it would be excellent if that file was able to be viewed inline or launched to the browser as part of the installation process. As it is now with a readme.html file admins typically unzip the file on the local PC, read the instructions file, and then FTP to the server. With an automated upload process it eliminates the admin even knowing that there might be an instructions file in the zip making such a file totally useless unless there was some way for the admin to either be alerted to it or be able to view it during the automated install.
I'm finding more and more that the readme files are pretty rare. Due to the ease of updating, the rich text formatting then most of the time people are placing what they'd normally have in a readme in their add-on presentation in the RM. I appreciate this doesn't help if you haven't yet released it :p

But, sure, I will look at this. Regardless it is a good idea. I do have plans to display preview and summary pages before and after the add-ons are installed so this idea works quite well with that plan.
 
Any file that is in the upload folder is copied to the root of the XenForo installation. So of course it can handle it... unless I'm missing something?
Site root, not XF root. ;) To clarify, if XF is installed at http://MySite.com/XF then the Mochi file needs to be accessible at http://MySite.com/crossdomain.xml, not http://MySite.com/XF/crossdomain.xml. XF add-ons should not even be attempting to automatically write to outside of the XF folder tree.

Nope. This version (beta) doesn't make any effort to clear the addon-prestage folder. When I finish the next version (soon) it should clear up after each install routine.
Cool, will play more then. :)

I'm finding more and more that the readme files are pretty rare.
I'm getting negative feedback about not having a readme.html available. :(

But, sure, I will look at this. Regardless it is a good idea. I do have plans to display preview and summary pages before and after the add-ons are installed so this idea works quite well with that plan.
Excellent.
 
Site root, not XF root. ;) To clarify, if XF is installed at http://MySite.com/XF then the Mochi file needs to be accessible at http://MySite.com/crossdomain.xml, not http://MySite.com/XF/crossdomain.xml. XF add-ons should not even be attempting to automatically write to outside of the XF folder tree.
Oh, I see... it's a crossdomain.xml file. That makes sense :)

Yeah so as previously mentioned, if you didn't want this automatically uploaded (which you wouldn't in most cases) then you can literally put it anywhere that isn't inside the upload folder.

The only thing is, because it's an XML file, it should not be in the root of the zip. Obviously the installer only expects to see the add-on install xml in the root so having a second in there would probably throw an error (need to handle that better).

So, have an additional folder "no_upload", "upload_to_root", "yellow_bananas" whatever it is, as long as it isn't inside the upload folder it will not upload :)
 
Coming soon (no ETA)... plus much more...
  • Rewritten, cleaner code.
  • Redesigned user interface - both installing and upgrading add-ons available from the same page in the Admin CP > Install & Upgrade
  • Files are extracted to the install/addons folder which is protected by .htaccess to prevent access from a browser, directory viewing etc.
  • Once the add-on is installed or upgraded, the files are deleted.
  • The installer checks to see if the add-on is already installed, if it is, then it performs an upgrade.
  • Biggest new thing: The installer will now install any add-on. It doesn't matter what the directory structure is or even where the XML file is (as long as it has one).
sYJC7Go.png
 
So for add-ons that do not work with this you can upload them the regular way?

Edit:
NM I see it :)

If I ever make an add on (which I will be) it will definately be Auto-Install Approved
 
Just as it says, really.

Permission denied. The Zip process is trying to extract files to the addon-prestage folder. This is in the root of your XenForo install.

Maybe consult your host or look to set permissions on that folder. I do not know the best permissions combination, but whatever you do just make sure it keeps the rest of your XenForo installation secure.
I seem to be having the same issue as Hugo Santos. I was looking for this addon-prestage folder, but I don't seem to have one. Or is that not the literal name? Also, where is the the zip file stored before it's unzipped? I don't see it anywhere now, but maybe it gets deleted?
 
I can't really provide much assistance with permissions errors because it really is down to how your server is setup, therefore something that your hosts and/or server people should help with.

However, there should definitely be an addon-prestage folder. That will be in the root of your XenForo install... so there should be a folder called addon-prestage in the same folder as library, styles, js, install, data etc.

If it doesn't exist, create it.

If you post the exact error message if it still doesn't work I'll see what else it might be failing on.



By the way everyone...... you may have noticed that I haven't released an update yet.

I've identified some improvements to make and there was also one or two bugs. I will release the update when these are all sorted out.
 
I can't really provide much assistance with permissions errors because it really is down to how your server is setup, therefore something that your hosts and/or server people should help with.

However, there should definitely be an addon-prestage folder. That will be in the root of your XenForo install... so there should be a folder called addon-prestage in the same folder as library, styles, js, install, data etc.

If it doesn't exist, create it.

If you post the exact error message if it still doesn't work I'll see what else it might be failing on.
Thank you, Chris. It seems my problem might be that the files & folders in my XF installation are owned by me, whereas Apache is running as a different user (www-data). So to make your add-on work I have to do one of the following:
  • Change the owner of all the relevant folders & files to www-data
  • Set permissions on all the relevant files & folders allowing www-data to access them (rw on files, rwx on directories).
 
Is that a workable solution for you? Is it still secure?

I'm hearing that suphp and suexec can help too but I don't fully understand what they do other than elevating the permissions of PHP scripts or something?

I'm really showing how much I know about this kind of stuff right? :p
 
Is that a workable solution for you? Is it still secure?
Not sure. I suppose I can ask in a suitable forum here on XF.

I'm hearing that suphp and suexec can help too but I don't fully understand what they do other than elevating the permissions of PHP scripts or something?

I'm really showing how much I know about this kind of stuff right? :p
I've never knowingly used any of them... I'm guessing maybe suphp can be configured so that the XF admin.php script will run as me rather than Apache, in which case (hopefully) your add-on won't have any problems.
 
Top Bottom