-
Notifications
You must be signed in to change notification settings - Fork 0
JSON Config Files
SSI uses a JSON-formatted configuration file to create its installers. These files have two parts, each representing a different part of the install process: Install and Setup. The Install step is where the installer downloads (and decompresses, if needed) the program and copies the files to the correct locations, and the Setup step is where the installer creates desktop shortcuts, registers file extensions, and the like. At the beginning of the file, there is also a header section with information on the program being installed.
The header is the simplest part of the file, and contains information about the program being installed.
Parameter | Usage |
---|---|
*name |
The name of the program |
author |
The program's author |
root |
Whether the program needs admin privleges to install |
*Required
"header": {
"name": "Example Program",
"author": "Ginger Industries"
}
This section contains a list of URLs to download data from, along with where to copy that data to and how to decompress it.
Parameter | Usage |
---|---|
*rootpath |
The root path of the program data |
*targets |
A list of files to download (see below) |
*Required
Parameter | Usage |
---|---|
*url |
The URL to download from |
*path |
The target location of the downloaded file (relative to the root path) |
*abspath |
The target location of the downloaded file (relative to the root folder (i.e. / ), can be used instead of path ) |
compression |
The compression type of the file (any of "zip", "gzip", "tar", if not passed assumed to be uncompressed) |
*Required
- For absolute paths, "~" represents the current user's home folder.
- For relative paths, an empty path represents the root folder. (i.e. if the root is
/Programs/somefolder
then an empty path would point to that.) - For compressed files, their root level will be what is extracted into the path. (i.e. if my archive contaians a folder containing more files, that folder will be placed at the path instead of the contents of the folder.)
"install": {
"rootpath": "/Program Files/Ginger Industries/Example Program/",
"targets": [
{
"url": "https://raw.githubusercontent.com/Ginger-Industries/SSI/main/example_program/test.txt",
"abspath": "~/AppData/Roaming/ExampleProgram"
},
{
"url": "https://raw.githubusercontent.com/Ginger-Industries/SSI/main/example_program/example_archive.zip",
"path": "",
"compression": "zip"
}
]
}
This section contains information about data like filetypes, desktop shortcuts, and similar.
Parameter | Usage |
---|---|
shortcuts |
A list of desktop shortcuts to create |
menuitems |
A list of desktop "start" menu items to create |
filetypes |
A list of filetypes to register |
*Required
Parameter | Usage |
---|---|
*target
|
The command to run when the shortcut is clicked |
*name
|
The friendly name to show on the shortcut |
icon |
The path to the icon image to use (defaults to the target's icon if available, else uses the system default icon) |
iconname |
The name of the icon to use (where supported, cannot be used with icon ) |
*Required
- In the
target
parameter, you can use%F
for the file's path and%R
for its URI.
Parameter | Usage |
---|---|
*extension
|
The extension to register |
*name
|
The name of the filetype (discarded if extension already exists) |
*target
|
The command to run when the file is clicked (see above for pathcodes) |
*Required
"setup": {
"shortcuts": [
{
"target": "notepad",
"name": "Notepad"
}
],
"filetypes": [
{
"extension": ".txt",
"name": "Text",
"target": "notepad %F"
}
]
}
{
"header": {
"name": "Example Program",
"author": "Ginger Industries"
},
"install": {
"rootpath": "/Program Files/Ginger Industries/Example Program/",
"targets": [
{
"url": "https://raw.githubusercontent.com/Ginger-Industries/SSI/main/example_program/test.txt",
"abspath": "~/AppData/Roaming/ExampleProgram"
},
{
"url": "https://raw.githubusercontent.com/Ginger-Industries/SSI/main/example_program/example_archive.zip",
"path": "",
"compression": "zip"
}
]
},
"setup": {
"shortcuts": [
{
"target": "notepad",
"name": "Notepad"
}
],
"filetypes": [
{
"extension": ".txt",
"name": "Text",
"target": "notepad %F"
}
]
}
}