This script is designed to automatically update the NinjaView application on Windows. It checks for the latest version of the app, downloads it if available, and replaces the old executable while preserving user settings.
- Automatic version checking against a remote server
- Secure downloading of the new version over HTTPS
- Silent replacement of the old version
- Error handling and logging for troubleshooting
- Custom alert dialogs to inform users of updates
Before running the script, ensure that Python and all required packages are installed on your system. The script uses ctypes
, win32api
, http.client
, and packaging.version
.
- Create A New Folder called "updater" in the same folder as NinjaView.exe.
- Place the script in the "updater" directory.
- Execute the script using Python:
python updater.py
pip install pyinstaller
cd path\to\your\script
pyinstaller --onefile updater.py
Determine the current version of NinjaView installed. Check for updates by contacting https://ninja-view.com/current_version.txt. If a new version is available, it will notify the user and initiate the download process. Once the new version is downloaded, it will replace the old executable with the new one. It will clean up any temporary files if necessary. Requirements Python 3.x Windows Operating System Internet Connection The packaging Python module, which can be installed via pip with pip install packaging Configuration No additional configuration is required. However, ensure that the URLs within the script are correct and pointing to your update server.
The script assumes that the executable has a standard naming convention (NinjaView.exe). If your executable follows a different naming pattern, you will need to adjust the script accordingly.
Alert dialogs will appear to notify the user when an update is available and when the update process is complete.
The script contains basic error handling for common issues such as network errors, file access issues, and update mismatches. Detailed errors will be printed to the console.
If you'd like to contribute to the development of this auto-updater script, please follow the standard GitHub fork & pull request workflow.
If you encounter any problems or have questions, please file an issue on this GitHub repository.