Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: gimmie - maaliskuu 06, 2014, 01:30:17 AP

Otsikko: Cannot zip and make package file
Kirjoitti: gimmie - maaliskuu 06, 2014, 01:30:17 AP
Hi, I'm making plugin for integrate our product to SMF board but when I zip folder and try to upload package to my test smf board, it rejects the file and don't install my mod but when upload whole folder via ftp it can install successful. I don't know what's wrong with my package-info.xml.

Can anyone help me review my source in github.com/gimmie/smf-plugin

Thanks.
Otsikko: Re: Cannot zip and make package file
Kirjoitti: Branko. - maaliskuu 06, 2014, 03:15:18 AP
In package-info.xml : <install for="X.0 - X.XX.XX"> or <install for="X.0"> etc

EDIT: Also readme.md change to readme.txt and rename file readme.md to readme.txt
Otsikko: Re: Cannot zip and make package file
Kirjoitti: gimmie - maaliskuu 06, 2014, 04:03:08 AP
Hi Branko,

I updated it and pushed to github. However, after zip all the file and upload to smf 2.0.7. I still got this message.

Package upload failed due to the following error:
"Although the package was downloaded to the server it appears to be empty. Please check the Packages directory, and the "temp" sub-directory are both writable. If you continue to experience this problem you should try extracting the package on your PC and uploading the extracted files into a subdirectory in your Packages directory and try again. For example, if the package was called shout.tar.gz you should:
1) Download the package to your local PC and extract it into files.
2) Using an FTP client create a new directory in your "Packages" folder, in this example you may call it "shout".
3) Upload all the files from the extracted package to this directory.
4) Go back to the package manager browse page and the package will be automatically found by SMF."


I can upload other plugins file and successfully install but only my package file I cannot install it except upload whole folder to Packages folder.
Otsikko: Re: Cannot zip and make package file
Kirjoitti: margarett - maaliskuu 06, 2014, 04:32:16 AP
The zip file you get from GH has the script contents in a folder. SMF's package manager expects to find the MOD contents in the root of the zip file.
Otsikko: Re: Cannot zip and make package file
Kirjoitti: gimmie - maaliskuu 06, 2014, 05:06:47 AP
I changed my archive from .zip to .tar.gz and it's work. Just curious why I can't zip it in .zip file.

Here is my packages.

I can install this .tar.gz
https://dl.dropboxusercontent.com/u/3519378/gimmie.tar.gz

but not this one
https://dl.dropboxusercontent.com/u/3519378/gimmie.zip

Both files has same structure.
I added error_log to smf code and got this package_get_error_is_zero. Not sure why it's empty.
Otsikko: Re: Cannot zip and make package file
Kirjoitti: margarett - maaliskuu 06, 2014, 05:21:51 AP
It sometimes also happens when the method used to zip the file can't be matched in your server (and, as such, the server can't unzip it). It's not the first time that users fixed that by simply unpacking and repacking (in another computer or zip tool).
Otsikko: Re: Cannot zip and make package file
Kirjoitti: gimmie - maaliskuu 06, 2014, 05:59:18 AP
Ok thanks. Solved the issue now.