@@ -22,18 +22,20 @@ namespace Flow.Launcher.Core
22
22
{
23
23
public class Updater
24
24
{
25
- public string GitHubRepository { get ; }
25
+ public bool UpdateToPrerelease { get ; set ; }
26
+
27
+ public const string ReleaseRepository = "https://github.com/Flow-Launcher/Flow.Launcher" ;
28
+ public const string PrereleaseRepository = "https://github.com/Flow-Launcher/Prereleases" ;
29
+
30
+ public string GitHubRepository => UpdateToPrerelease ? PrereleaseRepository : ReleaseRepository ;
26
31
27
- public Updater ( string gitHubRepository )
28
- {
29
- GitHubRepository = gitHubRepository ;
30
- }
31
32
32
33
private SemaphoreSlim UpdateLock { get ; } = new SemaphoreSlim ( 1 ) ;
33
34
34
35
public async Task UpdateAppAsync ( IPublicAPI api , bool silentUpdate = true )
35
36
{
36
37
await UpdateLock . WaitAsync ( ) . ConfigureAwait ( false ) ;
38
+
37
39
try
38
40
{
39
41
if ( ! silentUpdate )
@@ -54,6 +56,7 @@ public async Task UpdateAppAsync(IPublicAPI api, bool silentUpdate = true)
54
56
{
55
57
if ( ! silentUpdate )
56
58
MessageBox . Show ( api . GetTranslation ( "update_flowlauncher_already_on_latest" ) ) ;
59
+
57
60
return ;
58
61
}
59
62
@@ -94,7 +97,7 @@ public async Task UpdateAppAsync(IPublicAPI api, bool silentUpdate = true)
94
97
Log . Exception ( $ "|Updater.UpdateApp|Check your connection and proxy settings to github-cloud.s3.amazonaws.com.", e ) ;
95
98
else
96
99
Log . Exception ( $ "|Updater.UpdateApp|Error Occurred", e ) ;
97
-
100
+
98
101
if ( ! silentUpdate )
99
102
api . ShowMsg ( api . GetTranslation ( "update_flowlauncher_fail" ) ,
100
103
api . GetTranslation ( "update_flowlauncher_check_connection" ) ) ;
@@ -134,6 +137,7 @@ private async Task<UpdateManager> GitHubUpdateManagerAsync(string repository)
134
137
{
135
138
Proxy = Http . WebProxy
136
139
} ;
140
+
137
141
var downloader = new FileDownloader ( client ) ;
138
142
139
143
var manager = new UpdateManager ( latestUrl , urlDownloader : downloader ) ;
0 commit comments