Tutorial #2: Adding new files

One of the great features about the install script generator is the ease and speed at which you can add new files/folders to an install package.  That was one of my original goals and I think I've done a pretty good job with it so I'll go over some of that functionality with you.

Open up "Example1.sg2" as you did for tutorial #1 (you did read tutorial #1 didn't you?).  Ok I'll give you some help in case you didn't read tutorial #1.  You can find Example1.sg2 in the templates folder of the package you downloaded.  Ok got it open now?  Good.  Now go the "File list" tab.  You can see there is only one item in the file list here.  As in tutorial #1 you will need to change the path of the "My Documents" item to a relevant path on your computer.  Any folder of course will do, you don't have to use your my documents folder.

Lets add a new folder to the list, anyone will do.  Open up a Windows file explorer window and drag a folder onto the file list grid.


Adding a new folder to the file list

How did things turn out for you?  You should see the folder you dropped onto the grid at the bottom of list much like in the image above.  Next you'll need to assign that file to a define group and fill in some of the columns so the install package will know where to place the files from this folder on the installing system.  What are define groups exactly you're wondering?  That will be covered in more detail in future tutorials.  For now simply type in %FILES% in the define column for the folder you just added.


Attaching the folder to a define group and setting it's installation properties


You'll notice that only the file/directory name column is filled in and although there are defaults for many of the columns there are some columns which you may be required to set or may want to change from the default.  I'll take a stroll through the column headers to review their purpose.

The first column to note is the "Define" column.  This is the define group keyword that the files you group together are referenced on in template scripts, I often refer to them as placeholders.  As I mentioned earlier I will cover define groups in future tutorials.  For now what you want to do is type in the same text for the item currently on the file/folder list which is "%FILES%".  The rest of the columns are...

Many of these items have much more capabilites than what is detailed here.  This tutorial is only meant to give you an idea of the descipription of each column and to become more familiar with the tool.  Now hit the "Generate" button as in tutorial one.  Once the generation has finished go to your output folder.  Run up your installer and try it out.  You should find that the folder you added to your installer now ends up in your install folder.

The process for adding folders works just the same for files.  Take a look at the image below... 


Adding a file to the file listing


I've added an image file "schedule.jpg" to the file list here.  Notice that I haven't filled in the recurse and ignore columns as they aren't applicable for files.  The Rename to field becomes applicable here however.  I've chosen to rename this image to myschedule.jpg when it is installed on the installing system. 

Made with CityDeskSourceForge.net Logo