About
Some may be wondering what this is or does. Its quite simple. It makes the creation of an installer file for your SMF mod automatic. Create your mod on a clean install of SMF, compare the files to that of another clean install of SMF using the *nix 'diff' utility, and run the file through this parser and out you will have your XML install file.
Making mods can be a tedious process, which may involve editing lots of files, and you may forget one file you edited, and that can throw your whole mod off. This can cause delays in approval, and maybe even unhappy recipents of the mod. Fret no more. You can catch every change made to the files in your Mod easily and pain free and get them into a properly formatted XML file. Unsure of how to actually create the installer file? No worries, this does it for you.
Requirements
- » Two clean copies of SMF
One copy will be your working copy, or an installed version of SMF that you use to create your mod on. One will be a base copy, or original, to compare your edited files to.
- » diff utility (*nix)
You can use the diff command to show differences between two files, or each corresponding file in two directories. This can be output to a file which you can feed through this parser to create your xml file. For you Windows users, no fear. There is a version of diffutil for Windows as well. I will show you how to install and use it too.
That's all! Those two(three) things are all that you need to properly create your mod.
Diff utils on Windows
The first thing you need to do is go to this page (
http://gnuwin32.sourceforge.net/downlinks/diffutils.php) and save the file to your desktop or other location that you can remember.
After it downloads, run the installer. Install it using all of the defaults, and the default location (unless you know what you're doing). The default location should be C:\Program Files\GnuWin32.
Once installed, right-click on 'My Computer' and go to properties.
Click the 'Advanced' tab, then click 'Environment Variables'.
In the 'System variables' box, look for a variable named 'Path'. Double-click it.
ADD ;c:\Program Files\GnuWin32\bin to the end of the 'Variable value'.
Click Ok, Click Ok, Click Ok.
Now go to Start -> Run, type in 'cmd', then in the new window that opens, type 'diff --help' and you should see the help information for the diff utility. If not, try restarting your computer first, then try again. If still no luck, ensure all of your paths are correct.
Creating the 'diff' or 'patch' file
Ok, so you've got diff installed (or you're using *nix and already have it). Great! I recommend having both of your SMF copies have a common root directory (in my case, www). Mine are in C:\Webserver\www\joomla\smf and C:\Webserver\www\smf2. The first one is the one I've created my mod on, the second one is the bone dry SMF files.
On the bone dry copy, you MUST remove the following files: Settings.php and Settings_bak.php. You don't want your mod overwriting someone elses Settings.php file with your information, none-the-less will your mod probably not install anyway.
For you Windows users, open up 'cmd' again from the Start -> Run box. In my example, I 'cd'd into my www directory. I then ran the following command (replace [MY_MOD_NAME] with an appropriate name)
diff -urx Packages smf2 joomla/smf > [MY_MOD_NAME].patch
The bone dry copy of SMF must be right after 'Packages', and your modified copy must be second. You can put a .patch or .diff extension on your file and either will work through this parser.
This does three things. It creates a Unified diff file, it recurses through every sub-directory, and it excludes the Packages directory.
Now I looked in my www directory, and sure enough, there was the patch file. Now all you have to do is run it through the parser. See the next section for using the parser.
Using the Parser
There are a few options to fill in on the parser in order for it to properly create your install.xml file. I'll go through them here and explain in more detail the ones that seem fuzzy.
- » File
Click the browse button and find the .diff or .patch file on your system.
- » Directories to strip
This is used to remove extra directories in the tree leading to your SMF installation. You can play with this by trial and error if you're unsure, however it is very easy to know this value. In my example above, my working copy of smf was in 'joomla/smf'. That is two directories, so the number I enter in this field will be '2'.
- » Username
For the username, always use something unique - put your name or your SMF username, or something with no spaces.
- » Mod ID
For the id, always use something unique - the package name with no spaces.
- » Version
Current version of your mod.
- » Display output
When checked, the XML output will be displayed on the screen. When unchecked, you will be prompted to save the file to your computer.
Now that you know the options, you can
go to the parser.
Change Log (Hey, no software is perfect, right?):
v1.0 Beta (07/10/07)
» Initial Release
| © 2007 www.mattzuba.com & Matt Zuba |  |