Skip to content

Commit

Permalink
fix: 替换文件前版本检测错误,更新地址错误
Browse files Browse the repository at this point in the history
  • Loading branch information
benzBrake committed Oct 24, 2023
1 parent 8584540 commit 68ce311
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

### 最近更新

2023.10.24 移除旧版本的更新地址,修复一直以来各种更新问题,支持设置 GitHub Mirror 选项

2023.04.15 新增浏览器自动更新开关

2023.04.12 支持多语言
Expand Down
14 changes: 10 additions & 4 deletions RunFirefox.au3
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
Opt("GUIOnEventMode", 1)
Opt("WinTitleMatchMode", 4)

Global Const $CustomArch = "RunFloorp"
Global Const $AppVersion = "2.7.8"
Global Const $CustomArch = "RunFirefox"
Global Const $AppVersion = "2.7.9"
Global $FirstRun, $FirefoxExe, $FirefoxDir
Global $TaskBarDir = @AppDataDir & "\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar"
Global $AppPID, $TaskBarLastChange
Expand Down Expand Up @@ -108,6 +108,7 @@ If Not FileExists($inifile) Then
IniWrite($inifile, "Settings", "ExApp2", "")
IniWrite($inifile, "Settings", "LastPlatformDir", "")
IniWrite($inifile, "Settings", "LastProfileDir", "")
IniWrite($inifile, "Settings", "GithubMirror", "https://github.mfzy.ru")
EndIf

$CheckAppUpdate = IniRead($inifile, "Settings", "CheckAppUpdate", 1) * 1
Expand Down Expand Up @@ -135,6 +136,7 @@ $ExApp2 = IniRead($inifile, "Settings", "ExApp2", "")
$LastPlatformDir = IniRead($inifile, "Settings", "LastPlatformDir", 1)
$LastProfileDir = IniRead($inifile, "Settings", "LastProfileDir", "")
$LANGUAGE = IniRead($inifile, "Settings", "Language", "zh-CN")
$GithubMirror = IniRead($inifile, "Settings", "GithubMirror", "https://gh.gh2233.ml")
If Not $LANGUAGE Then
$LANGUAGE = 'zh-CN'
EndIf
Expand Down Expand Up @@ -393,7 +395,10 @@ EndFunc ;==>OnExit

;~ 查检 RunFirefox更新
Func CheckAppUpdate()
Local $AppUpdateLastCheck, $repo = 'benzBrake/RunFirefox', $latestVersion, $releaseNotes, $downloadUrl, $MirrorAddress = 'https://ghproxy.com/'
Local $AppUpdateLastCheck, $repo = 'benzBrake/RunFirefox', $latestVersion, $releaseNotes, $downloadUrl, $MirrorAddress = $GithubMirror
if Not _StringEndsWith($MirrorAddress, "/") Then
$MirrorAddress = $MirrorAddress & "/"
EndIf
$AppUpdateLastCheck = _NowCalc()
IniWrite($inifile, "Settings", "AppUpdateLastCheck", $AppUpdateLastCheck)

Expand Down Expand Up @@ -421,6 +426,7 @@ Func CheckAppUpdate()
$archStr &= "_x64"
EndIf
$downloadUrl = $MirrorAddress & 'https://github.com/' & $repo & '/releases/download/v' & $latestVersion & '/' & $CustomArch & '_' & $latestVersion & $archStr &'.zip'
ConsoleWrite($downloadUrl)

Local $temp = @ScriptDir & "\RunFirefox_temp"
$file = $temp & "\RunFirefox.zip"
Expand Down Expand Up @@ -454,7 +460,7 @@ Func CheckAppUpdate()
FileSetAttrib($file, "+A")
_Zip_UnzipAll($file, $temp)
$FileName = $CustomArch & ".exe"
If @OSArch = "X64" Then
If @AutoItX64 Then
$FileName = $CustomArch & "_x64.exe"
EndIf
If FileExists($temp & "\" & $FileName) Then
Expand Down

0 comments on commit 68ce311

Please sign in to comment.