MASTER PROMPT — CONNECT A PROGRAM TO VIMPULSE UPDATE SERVER v2.1 Update this program so its built-in updater connects to my Vimpulse Update Server v2.1. SERVER Public: http://99.232.137.208:8765 Internal: http://10.0.0.30:8765 Distributed copies should normally use the public URL. DO NOT USE JSON - Do not use update.json. - Do not use version.json. - Do not use manifest.json. - Do not use JSON version checking. IMPORTANT: UPDATE FILENAMES ARE NOT FIXED The updater must NOT expect a particular filename such as: StoryCut_Update.exe RigCore_Update.exe GobhaInk_Update.exe I may name the update file anything I want. Examples for StoryCut: StoryCutV2.exe StoryCut New.exe StoryCut September.exe final build.exe The Vimpulse Update Server automatically finds the newest supported update file inside that application's updates folder. CLIENT UPDATE URL The client only uses this application's /latest/ endpoint. StoryCut: http://99.232.137.208:8765/latest/StoryCut StoryRealm Studio: http://99.232.137.208:8765/latest/StoryRealm%20Studio Vault: http://99.232.137.208:8765/latest/Vault VimpulseAutoClicker: http://99.232.137.208:8765/latest/VimpulseAutoClicker GobhaInk: http://99.232.137.208:8765/latest/GobhaInk VitalTrack: http://99.232.137.208:8765/latest/VitalTrack CyberVault: http://99.232.137.208:8765/latest/cybervault FreshCore: http://99.232.137.208:8765/latest/freshcore RigCore: http://99.232.137.208:8765/latest/rigcore StorageMedic: http://99.232.137.208:8765/latest/storagemedic Vimpulse Tech Toolkit: http://99.232.137.208:8765/latest/vimpulsetechtoolkit VimVNC: http://99.232.137.208:8765/latest/vimvnc HOW THE CHECK WORKS 1. Perform an HTTP HEAD request to the program's /latest/ URL. 2. Do not download the update during the check. 3. The server automatically chooses the newest valid update file. 4. Read these response headers: - X-File-Created-Unix - X-File-Created - Last-Modified - X-Update-Filename - Content-Length 5. Prefer X-File-Created-Unix for timestamp comparison. 6. X-Update-Filename tells the client the real filename chosen by the server. 7. Store the timestamp of the last successfully installed server update in the application's persistent AppData/config area. 8. If server timestamp > locally stored installed-update timestamp: show Update Available. 9. If server timestamp <= local timestamp: show Up to Date. 10. If the server is unavailable: continue running normally and do not crash. DOWNLOADING When the user chooses Update Now: 1. Send GET to the SAME /latest/ URL. 2. Do not construct a filename-specific URL. 3. Read X-Update-Filename and/or Content-Disposition to determine the actual filename sent by the server. 4. Download it to a temporary location. 5. Validate the HTTP response. 6. Verify that the downloaded file exists and is not empty. 7. Preserve any existing Authenticode, signature, or hash verification. 8. Never execute an HTML error page or arbitrary response as an installer. SUPPORTED UPDATE PAYLOADS The current Vimpulse Update Server accepts: .exe .msi .msix .msixbundle .zip The client should preserve its existing install/update behavior based on the type of update package it already supports. Do not add unsafe arbitrary execution behavior. FIRST RUN If the application has no saved installed-update timestamp: - Do not force an update just because the timestamp is missing. - Initialize a reasonable local baseline when possible. - Otherwise offer the newest server update rather than forcing it. SUCCESS / FAILURE Only save the server timestamp locally AFTER the update successfully installs. If downloading or installation fails: - keep the old local timestamp - leave the update available for the next check - do not corrupt the existing installation GUI / THREADING All update checks and downloads must run outside the main GUI thread. The application must remain responsive while: - contacting the server - performing HEAD checks - downloading updates Do not allow the application to show Not Responding because of the updater. Use timeouts. Follow redirects where appropriate. Use the application's existing logging system when available. USER DATA Preserve: - AppData - settings - databases - projects - saved documents - templates - configuration - license information - user-created content SERVER AVAILABILITY The Vimpulse Update Server only runs while run.bat is open. If it is offline: - the program still launches - automatic checks fail non-destructively - manual checks may show "Update server unavailable" - no crash occurs DO NOT REWRITE UNRELATED CODE Integrate this into the application's existing updater/update config. Keep the existing appearance and behavior except where needed for this updater. VERIFY ALL OF THESE 1. Program starts when server is offline. 2. Manual check handles server offline cleanly. 3. HEAD request to /latest/ works. 4. Server can choose an update regardless of filename. 5. X-Update-Filename is read correctly. 6. X-File-Created-Unix is read correctly. 7. Newer timestamp produces Update Available. 8. Same/older timestamp produces Up to Date. 9. GET to /latest/ downloads the exact file selected by the server. 10. Filename with spaces works. 11. GUI remains responsive. 12. Failed download does not change local timestamp. 13. Failed install does not change local timestamp. 14. Successful install records server timestamp. 15. Existing user data survives the update.