Skip to content

Commit e18b7fd

Browse files
authored
1.5.1
1 parent 37e5675 commit e18b7fd

5 files changed

Lines changed: 58 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
All notable changes to AI Text Tools will be documented in this file.
44

5+
## [1.5.0] - 2026-01-19
6+
7+
### Fixed
8+
- Installer no longer incorrectly sets FirstLaunch=0 (was preventing "install" analytics event)
9+
- Updater now uses WinHTTP with redirect handling for reliable GitHub downloads
10+
11+
### Improved
12+
- Download mechanism in updater.ahk now matches installer's robust implementation
13+
- Uses ADODB.Stream for binary file handling (fixes COM SafeArray issues)
14+
515
## [1.4.10] - 2026-01-19
616

717
### Fixed

installer/Setup.ahk

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
; Compiler directives
55
;@Ahk2Exe-SetName AI Text Tools Setup
66
;@Ahk2Exe-SetDescription AI Text Tools Installer
7-
;@Ahk2Exe-SetVersion 1.4.10
7+
;@Ahk2Exe-SetVersion 1.5.0
88
;@Ahk2Exe-SetCopyright Copyright (c) 2026 Jamie Bykov-Brett
99

1010
; GitHub repository for downloading update files
1111
global GitHubRepo := "Netropolitan/AI-Text-Tools"
12-
global CurrentInstallerVersion := "1.4.10"
12+
global CurrentInstallerVersion := "1.5.0"
1313

1414
/**
1515
* Download file with proper redirect handling using WinHTTP
@@ -757,7 +757,8 @@ StartInstallation() {
757757

758758
; Write startup settings
759759
IniWrite(StartMinimized ? "1" : "0", settingsFile, "General", "StartMinimized")
760-
IniWrite("0", settingsFile, "General", "FirstLaunch")
760+
; Note: Don't set FirstLaunch here - let it default to "1" so the app
761+
; can detect first launch and send "install" analytics event
761762

762763
; Add to Windows startup if requested (with /startup flag to suppress settings window)
763764
if RunOnStartup {

src/core/updater.ahk

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class UpdateManager {
1212
static GitHubRepo := "Netropolitan/AI-Text-Tools"
1313
static GitHubAPI := "https://api.github.com/repos/" . UpdateManager.GitHubRepo . "/releases/latest"
14-
static CurrentVersion := "1.4.10"
14+
static CurrentVersion := "1.5.0"
1515

1616
; Analytics endpoint - Set to empty string "" to disable analytics
1717
static AnalyticsEndpoint := "https://brew.taila07ff3.ts.net/api/ping"
@@ -300,6 +300,45 @@ class UpdateManager {
300300
return 0
301301
}
302302

303+
/**
304+
* Download file with proper redirect handling using WinHTTP and ADODB.Stream
305+
* @param {string} url - URL to download
306+
* @param {string} savePath - Local path to save file
307+
*/
308+
static DownloadWithRedirect(url, savePath) {
309+
whr := ComObject("WinHttp.WinHttpRequest.5.1")
310+
whr.Open("GET", url, true)
311+
whr.SetRequestHeader("User-Agent", "AI-Text-Tools/" . this.CurrentVersion)
312+
whr.SetTimeouts(30000, 30000, 30000, 60000)
313+
whr.Send()
314+
whr.WaitForResponse(60)
315+
316+
; Check for redirect (GitHub returns 302)
317+
if whr.Status = 302 || whr.Status = 301 {
318+
redirectUrl := whr.GetResponseHeader("Location")
319+
if redirectUrl {
320+
whr := ComObject("WinHttp.WinHttpRequest.5.1")
321+
whr.Open("GET", redirectUrl, true)
322+
whr.SetRequestHeader("User-Agent", "AI-Text-Tools/" . this.CurrentVersion)
323+
whr.SetTimeouts(30000, 30000, 30000, 60000)
324+
whr.Send()
325+
whr.WaitForResponse(60)
326+
}
327+
}
328+
329+
if whr.Status != 200 {
330+
throw Error("HTTP " . whr.Status)
331+
}
332+
333+
; Save binary response using ADODB.Stream
334+
stream := ComObject("ADODB.Stream")
335+
stream.Type := 1 ; adTypeBinary
336+
stream.Open()
337+
stream.Write(whr.ResponseBody)
338+
stream.SaveToFile(savePath, 2) ; adSaveCreateOverWrite
339+
stream.Close()
340+
}
341+
303342
/**
304343
* Download update to temp folder
305344
* @param {Function} progressCallback - Optional callback(percent, status)
@@ -325,8 +364,8 @@ class UpdateManager {
325364
if progressCallback
326365
progressCallback(0, "Connecting...")
327366

328-
; Download file
329-
Download(this.DownloadUrl, tempPath)
367+
; Download file with proper redirect handling
368+
this.DownloadWithRedirect(this.DownloadUrl, tempPath)
330369

331370
if progressCallback
332371
progressCallback(100, "Download complete")

src/main.ahk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ DllCall("SetThreadDpiAwarenessContext", "ptr", -4, "ptr")
77
; Compiler directives for EXE
88
;@Ahk2Exe-SetName AI Text Tools
99
;@Ahk2Exe-SetDescription AI-powered text transformation
10-
;@Ahk2Exe-SetVersion 1.4.10
10+
;@Ahk2Exe-SetVersion 1.5.0
1111
;@Ahk2Exe-SetCopyright Copyright (c) 2026 Jamie Bykov-Brett
1212
;@Ahk2Exe-SetCompanyName Bykov-Brett Enterprises
1313

src/ui/settings.ahk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class SettingsWindow {
99
static Gui := ""
1010
static Tabs := ""
11-
static CurrentVersion := "1.4.10"
11+
static CurrentVersion := "1.5.0"
1212
static GitHubRepo := "https://github.com/Netropolitan/AI-Text-Tools"
1313

1414
/**

0 commit comments

Comments
 (0)