Closed raiguard closed 6 years ago
Documentation for future purposes:
This script compares semver-formatted version strings and executes Rainmeter bang actions based on the result. It can be used to notify users of a skin suite that an update is available for download. It can also be utilized to extract options from a downloaded INI file
Copy the script into your skin suite and create a script measure pointing to it. You will need to add the following additional options to the measure:
IniFilePath
- The path to the file that will be used for comparison.
UpToDateAction
- Bangs to execute when the skin suite is up to date.
UpdateAvailableAction
- Bangs to execute when there is an available update.
ErrorAction
- Bangs to execute when the script encounters an error.
By default, IniFilePath
will point to DownloadFile.inc in the current skin's folder. If any of the action options are not provided, nothing will happen when that result is given.
The GetIniOption(section, key)
function can be used with Inline LUA to retrieve and display options from the INI file.
TO BE CONTINUED
Done!
Currently the update checker executes a series of hard-coded bangs. This is usually fine, but I want to make the update checker script available for others to use. So, it will be generalized. The new script will not require any hard-coding on the user's part.
The script measure will now accept additional options:
UpToDateAction
,UpdateAvailableAction
, andErrorAction
. Each of these will have a series of bangs to execute when the corresponding outcome is given.To invoke an update check, a
!CommandMeasure
bang will be used:[!CommandMeasure MeasureUpdateCheckerScript "CheckForUpdate(section, key, cVersion)"]
.section
specifies the section of the INI to check;key
specifies which key in that section to use as the version for comparison;cVersion
specifies the suite's current version that you wish to compare.The script will also be able to return any of the options in the INI through the
GetIniOption(section, key)
function, invoked through Inline LUA. If the option is nil, it will return nothing.These enhancements will allow the inclusion of changelogs in the update notification screen, rather than the user needing to go to GitHub to view the changelog. It will also make the script ready for general use, rather than being specifically designed for ModernGadgets.
To-do