Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/camalot/chatbotscriptupdater
An application that can be used to update your chatbot scripts
https://github.com/camalot/chatbotscriptupdater
Last synced: about 1 month ago
JSON representation
An application that can be used to update your chatbot scripts
- Host: GitHub
- URL: https://github.com/camalot/chatbotscriptupdater
- Owner: camalot
- Created: 2019-09-13T19:42:46.000Z (over 5 years ago)
- Default Branch: develop
- Last Pushed: 2022-12-08T06:47:15.000Z (about 2 years ago)
- Last Synced: 2024-05-02T01:22:07.901Z (8 months ago)
- Language: C#
- Size: 397 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# APPLICATION UPDATER
This is an application that can update an application, or script from a release published as a zip file on github.
There is a verison that requires administrator access, and one that runs at the user level of the invoking user.
# STREAMLABS CHATBOT SCRIPT EXAMPLE
```json
{
..."OpenScriptUpdater": {
"type": "button",
"label": "Check For Updates",
"tooltip": "Check for updates",
"function": "OpenScriptUpdater",
"wsevent": "EVENT_NONE"
}...
}```
```python
# Add Global Variable to the top
Repo = "camalot/chatbot-shoutout"#
# ...
## Add this function to the Script Module
def OpenScriptUpdater():
currentDir = os.path.realpath(os.path.dirname(__file__))
chatbotRoot = os.path.realpath(os.path.join(currentDir, "../../../"))
libsDir = os.path.join(currentDir, "libs/updater")
Parent.Log(ScriptName, libsDir)
try:
src_files = os.listdir(libsDir)
tempdir = tempfile.mkdtemp()
Parent.Log(ScriptName, tempdir)
for file_name in src_files:
full_file_name = os.path.join(libsDir, file_name)
if os.path.isfile(full_file_name):
Parent.Log(ScriptName, "Copy: " + full_file_name)
shutil.copy(full_file_name, tempdir)
updater = os.path.join(tempdir, ApplicationUpdater.exe")
updaterConfigFile = os.path.join(tempdir, "update.manifest")
repoVals = Repo.split('/')# Create the update.manifest
updaterConfig = {
"path": os.path.realpath(os.path.join(currentDir,"../")),
"version": Version,
"name": ScriptName,
"folderName": os.path.basename(os.path.dirname(os.path.realpath(__file__))),
"requiresRestart": True, # Shutdown and restart Chatbot
"processName": "Streamlabs Chatbot",
"application": os.path.join(chatbotRoot, "Streamlabs Chatbot.exe"),
"kill": [], # Array of process names to stop
"execute": {
"before": [{
"command": "cmd",
"arguments": [ "/c", "del /f /q /s *" ],
"workingDirectory": "${PATH}\\${SCRIPT}\\Libs\\",
"ignoreExitCode": True,
"validExitCodes": [0]
}], # commands to run before extraction
"after": [] # command to run after extraction
},
"script": os.path.basename(os.path.dirname(os.path.realpath(__file__))),
"website": Website,
"repository": {
"owner": repoVals[0],
"name": repoVals[1]
}
}
Parent.Log(ScriptName, updater)
configJson = json.dumps(updaterConfig)
Parent.Log(ScriptName, configJson)
with open(updaterConfigFile, "w+") as f:
f.write(configJson)
os.startfile(updater)
except OSError as exc: # python >2.5
raise```