Kodi Community Forum
possible to run script on first run or/and on update? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+--- Thread: possible to run script on first run or/and on update? (/showthread.php?tid=362347)



possible to run script on first run or/and on update? - marantz - 2021-04-29

hello, im looking for a way to run a script on a scripts first run or at installation, also on every update would be nice.

thanks for any tips


RE: possible to run script on first run or/and on update? - pkscout - 2021-04-29

One thing you could try is to have a hidden skin setting with the version number. Then use a conditional to check that setting against a string. If it doesn't match (and empty would count as not matching) then run the script and save the updated version number to the setting. I do something similar for my Estuary mod, although I only load some variables, not run a script. The only thing you have to remember to do is bump the version string in the skin where you do the conditional.