Since we are about to rewrite the installer, I figured we should give out a guideline for a better and more robust script.NEW OR UPDATED SCRIPTS WILL NOT BE PUBLISHED IF THEY DON'T MEET THE GUIDELINE!Language
Try and keep everything in english or atleast some things so everyone understands, if a script is aimed at only one language (eg: undertexter.se script, which has only swedish subtitles) you can use that language. If you write very poorly in english, try and get someone to help you with this. Also translation into several languages is a nice thing to include. If your script isn't english, yet your description is, make sure to make that clear. Common way of naming non-english scripts is: Scriptname (nationality) e.g: Undertexter.se (swedish)Folder
The first thing to do is make a folder for your script, (example for a script "Google Videos" then name the folder "Google Videos"). Use this foldername and do not add any versionnumbers or other things. When releasing a new version, it will automatically overwrite the old installation meaning the users scriptsfolder won't be filled with old versions.
If you don't make a folder the script will end up directly in Q:\scripts, which isn't a good idea.Main python file
Always name the main python file to "DEFAULT.PY". This is to use the directoryflattening in XBMC, meaning you will only click on the folder to run the python.Icon
Also (for cosmetic reasons) include a "DEFAULT.TBN" which is a renamed .jpg or .png picture with a preferred size 256x256, that will be used for icon to the script.Path to script
After that you create a variable named for example "SCRIPT_DIR" in your script, use this variable to refer to it whenever you need the path to your script.
either with: SCRIPT_DIR = os.getcwd().replace(";","")+"\\"
or: SCRIPT_DIR = sys.path + '\\'
This is for the reason that some users might rename the installfolder and that will give them an error if you for instance linked a file to "Q:\\Scripts\\MyScript\\". Also you know that it always ends with a \Readme and changelog
Other things to take in mind is a "README.TXT" containing description of the script, contact details, forumthreads etc. Also writing a changelog can be a good idea, so the user can see whats been changed.Versionnumbers
This is really a good thing to implement. Both in the zipfilename and also somewhere in the script.
A good practice is Version:Wikipedia
for determing the version numbers.Pack things up
ZIP this up, and name the zip GoogleVideos-v1.0.1.zip (for the script "Google Videos" version 1.0.1 as this will make it easier for us to update the scripts on the site.
You should end up with a package that looks like the following.Why isn't my upload accepted?
1. Wrong filename (version number is needed)
2. Your script isn't inside a folder, meaning it will unpack to q:\scripts
3. No default.tbn (this needs to be added, we don't accept it without)
4. Main .py file is NOT named default.py
5. Readme.txt isn't included.Still unsecure?
If you have any questions please use the contact link on the main page.
You can also download this testpackage
or join #xbmc-scripting on irc.freenode.com