Skip to content

Commit a8a3546

Browse files
author
Mindaugas Veblauskas
committed
Merge branch 'release/3.2.7'
2 parents 6a85c59 + ce60072 commit a8a3546

File tree

49 files changed

+20983
-522
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+20983
-522
lines changed

.gitlab-ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,24 @@ tests:
9898
build-installer:
9999
stage: build-installer
100100
tags:
101-
- windows
101+
- windows-vpn-signer
102102
dependencies:
103103
- build-debug
104104
- build-release
105105
extends:
106106
- .build-installer
107107
variables:
108108
BUILD_PATH: src/bin/win-x64/publish
109+
FF_USE_FASTZIP: "true"
110+
TRANSFER_METER_FREQUENCY: "2s"
111+
ARTIFACT_COMPRESSION_LEVEL: "fastest"
112+
CACHE_COMPRESSION_LEVEL: "fastest"
113+
FASTZIP_ARCHIVER_BUFFER_SIZE: 128
109114
artifacts:
110115
paths:
111116
- Setup/Installers/
112117
expire_in: 4 weeks
113-
118+
114119
build-BTI-installer:
115120
stage: build-installer
116121
when: manual

Setup/Strings/Finnish.isl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[CustomMessages]
2+
InstallProtonDriveTitle=Asenna Proton Drive - Salattu pilvitallennus (ilmainen Proton VPN:n kanssa)

Setup/Strings/Japanese.isl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[CustomMessages]
2+
InstallProtonDriveTitle=Proton Drive をインストール - 暗号化クラウドストレージ (無料で利用可能)

Setup/setup.iss

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
#define Hash ""
2121
#define VersionFolder "v" + MyAppVersion
22+
#define AppFolder "Proton\VPN"
2223
#define SourcePath GetEnv("BUILD_PATH")
2324
#define IsBTISource SourcePath == "src/bin/win-x64/BTI/publish"
2425
#if IsBTISource
@@ -104,6 +105,12 @@ Source: "..\{#SourcePath}\uk-UA\ProtonVPN.Translations.resources.dll"; DestDir:
104105
Source: "..\{#SourcePath}\tr-TR\ProtonVPN.Translations.resources.dll"; DestDir: "{app}\{#VersionFolder}\tr-TR"; Flags: signonce;
105106
Source: "..\{#SourcePath}\be-BY\ProtonVPN.Translations.resources.dll"; DestDir: "{app}\{#VersionFolder}\be-BY"; Flags: signonce;
106107
Source: "..\{#SourcePath}\ka-GE\ProtonVPN.Translations.resources.dll"; DestDir: "{app}\{#VersionFolder}\ka-GE"; Flags: signonce;
108+
Source: "..\{#SourcePath}\el-GR\ProtonVPN.Translations.resources.dll"; DestDir: "{app}\{#VersionFolder}\el-GR"; Flags: signonce;
109+
Source: "..\{#SourcePath}\fi-FI\ProtonVPN.Translations.resources.dll"; DestDir: "{app}\{#VersionFolder}\fi-FI"; Flags: signonce;
110+
Source: "..\{#SourcePath}\ko-KR\ProtonVPN.Translations.resources.dll"; DestDir: "{app}\{#VersionFolder}\ko-KR"; Flags: signonce;
111+
Source: "..\{#SourcePath}\zh-TW\ProtonVPN.Translations.resources.dll"; DestDir: "{app}\{#VersionFolder}\zh-TW"; Flags: signonce;
112+
Source: "..\{#SourcePath}\sv-SE\ProtonVPN.Translations.resources.dll"; DestDir: "{app}\{#VersionFolder}\sv-SE"; Flags: signonce;
113+
Source: "..\{#SourcePath}\ja-JP\ProtonVPN.Translations.resources.dll"; DestDir: "{app}\{#VersionFolder}\ja-JP"; Flags: signonce;
107114

108115
Source: "..\{#SourcePath}\Resources\*.dll"; DestDir: "{app}\{#VersionFolder}\Resources"; Flags: signonce;
109116
Source: "..\{#SourcePath}\Resources\*.exe"; DestDir: "{app}\{#VersionFolder}\Resources"; Flags: signonce;
@@ -133,7 +140,9 @@ Filename: "{app}\{#VersionFolder}\{#ProtonDriveDownloaderName}"; Parameters: "{c
133140
[Languages]
134141
Name: "en_US"; MessagesFile: "compiler:Default.isl,Strings\Default.isl"
135142
Name: "cs_CZ"; MessagesFile: "compiler:Languages\Czech.isl,Strings\Czech.isl"
143+
Name: "ja_JP"; MessagesFile: "compiler:Languages\Japanese.isl,Strings\Japanese.isl"
136144
Name: "de_DE"; MessagesFile: "compiler:Languages\German.isl,Strings\German.isl"
145+
Name: "fi_FI"; MessagesFile: "compiler:Languages\Finnish.isl,Strings\Finnish.isl"
137146
Name: "fr_FR"; MessagesFile: "compiler:Languages\French.isl,Strings\French.isl"
138147
Name: "nl_NL"; MessagesFile: "compiler:Languages\Dutch.isl,Strings\Dutch.isl"
139148
Name: "it_IT"; MessagesFile: "compiler:Languages\Italian.isl,Strings\Italian.isl"
@@ -152,6 +161,7 @@ Type: filesandordirs; Name: "{app}\{#VersionFolder}\Resources"
152161

153162
[Dirs]
154163
Name: "{localappdata}\ProtonVPN\DiagnosticLogs"
164+
Name: "{commonappdata}\ProtonVPN\Updates"; AfterInstall: SetFolderPermissions;
155165

156166
[Code]
157167
function InitLogger(logger: Longword): Integer;
@@ -169,6 +179,9 @@ external 'UninstallProduct@files:ProtonVPN.InstallActions.x86.dll cdecl delayloa
169179
function IsProductInstalled(upgradeCode: String): Integer;
170180
external 'IsProductInstalled@files:ProtonVPN.InstallActions.x86.dll cdecl delayload';
171181
182+
function SetUpdatesFolderPermission(updatesFolderPath: String): Integer;
183+
external 'SetUpdatesFolderPermission@files:ProtonVPN.InstallActions.x86.dll cdecl delayload';
184+
172185
function UninstallTapAdapter(tapFilesPath: String): Integer;
173186
external '[email protected] cdecl delayload uninstallonly';
174187
@@ -231,25 +244,34 @@ begin
231244
end;
232245
end;
233246
247+
procedure SetFolderPermissions();
248+
begin
249+
SetUpdatesFolderPermission(ExpandConstant('{commonappdata}\ProtonVPN\Updates'));
250+
end;
251+
234252
procedure DeleteNonRunningVersions(const Directory: string);
235253
var
236254
VersionFolder: TFindRec;
237-
VersionFolderPath: String;
255+
VersionFolderPath, ProcessPath: String;
238256
i: Integer;
239257
Processes: array of String;
240258
IsRunningProcessFound: Boolean;
241259
begin
260+
Log('Using directory ' + Directory + ' to find previous app versions for deletion');
242261
Processes := ['ProtonVPN.exe', 'ProtonVPNService.exe', 'ProtonVPN.WireGuardService.exe'];
243262
if FindFirst(ExpandConstant(Directory + '\v*'), VersionFolder) then
244263
try
245264
repeat
265+
Log('Found version folder ' + VersionFolder.Name);
246266
VersionFolderPath := AddBackslash(Directory) + AddBackslash(VersionFolder.Name)
247267
IsRunningProcessFound := False;
248268
for i := 0 to GetArrayLength(Processes) - 1 do
249269
begin
250-
if IsProcessRunningByPath(VersionFolderPath + Processes[i]) then
270+
ProcessPath := VersionFolderPath + Processes[i];
271+
Log('Checking if the process ' + ProcessPath + ' is running');
272+
if IsProcessRunningByPath(ProcessPath) then
251273
begin
252-
Log('Running process detected: ' + VersionFolderPath + Processes[i]);
274+
Log('Running process detected: ' + ProcessPath);
253275
IsRunningProcessFound := True;
254276
Break;
255277
end;
@@ -382,13 +404,24 @@ begin
382404
Log('Service uninstall returned: ' + IntToStr(Result));
383405
end;
384406
407+
function IsUpgrade: Boolean;
408+
begin
409+
Result := FileExists(ExpandConstant('{app}\{#LauncherExeName}'));
410+
end;
411+
385412
function PrepareToInstall(var NeedsRestart: Boolean): String;
413+
var
414+
vpnFolderPath: String;
386415
begin
387-
DeleteNonRunningVersions(ExpandConstant('{app}'));
416+
vpnFolderPath := '{app}';
417+
if IsUpgrade = False then
418+
vpnFolderPath := vpnFolderPath + '\{#AppFolder}';
419+
420+
DeleteNonRunningVersions(ExpandConstant(vpnFolderPath));
388421
Log('Trying to save user settings for the old ProtonVPN app if it is installed');
389422
SaveOldUserConfigFolder();
390423
Log('Trying to update taskbar icon path if exists');
391-
UpdateTaskbarIconTarget(ExpandConstant('{app}\{#VersionFolder}\{#MyAppExeName}'));
424+
UpdateTaskbarIconTarget(ExpandConstant(vpnFolderPath + '\{#VersionFolder}\{#MyAppExeName}'));
392425
Log('Trying to uninstall an old version of ProtonVPN app');
393426
UninstallProduct('{2B10124D-2F81-4BB1-9165-4F9B1B1BA0F9}');
394427
Log('Trying to uninstall an old version of ProtonVPN TUN adapter');
@@ -458,19 +491,14 @@ var
458491
path: String;
459492
begin
460493
path := WizardForm.DirEdit.Text;
461-
StringChangeEx(path, '\Proton\VPN', '\Proton\Drive', True);
494+
StringChangeEx(path, ExpandConstant('\{#AppFolder}'), '\Proton\Drive', True);
462495
Result := '"' + path + '"';
463496
end;
464497
465-
function IsUpgrade: Boolean;
466-
begin
467-
Result := FileExists(ExpandConstant('{app}\{#LauncherExeName}'));
468-
end;
469-
470498
procedure CurPageChanged(CurPageID: Integer);
471499
begin
472500
if (CurPageID = wpPreparing) and (IsInstallPathModified = False) and (IsUpgrade = False) then begin
473501
IsInstallPathModified := true;
474-
WizardForm.DirEdit.Text := WizardForm.DirEdit.Text + '\Proton\VPN';
502+
WizardForm.DirEdit.Text := WizardForm.DirEdit.Text + ExpandConstant('\{#AppFolder}');
475503
end;
476504
end;

ci/build-scripts/guest_hole_server_loader.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import json
21
import random
3-
from urllib.request import urlopen
2+
import requests
43

54
def load():
65
# Constants
@@ -13,7 +12,13 @@ def load():
1312

1413
print('Started updating guest hole servers json')
1514

16-
original_json = json.loads(urlopen(server_list_api_url).read())
15+
proxies = {
16+
'http': 'http://proxy.plabs.ch:3128',
17+
'https': 'http://proxy.plabs.ch:3128',
18+
}
19+
20+
response = requests.get(server_list_api_url, proxies=proxies)
21+
original_json = response.json()
1722

1823
logical_servers = original_json["LogicalServers"]
1924
print(''.join(['Number of logical servers: ', str(len(logical_servers))]))

ci/build-scripts/installer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def build(version, hash, setupFile):
1818
with open(setupFile, 'w') as file:
1919
file.write(fileData)
2020

21-
p = subprocess.Popen(['iscc', setupFile],
21+
p = subprocess.Popen(['iscc', setupFile, "/Ssigntool=signtool.exe $p"],
2222
env=os.environ,
2323
stdout=subprocess.PIPE,
2424
universal_newlines=True)

src/Announcements/ProtonVPN.Announcements.Contracts/Announcement.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace ProtonVPN.Announcements.Contracts
2424
public class Announcement
2525
{
2626
public string Id { get; set; }
27-
public int Type { get; set; }
27+
public AnnouncementType Type { get; set; }
2828
public string Reference { get; set; }
2929
public DateTime StartDateTimeUtc { get; set; }
3030
public DateTime EndDateTimeUtc { get; set; }
@@ -34,5 +34,6 @@ public class Announcement
3434
public Panel Panel { get; set; }
3535
public bool Seen { get; set; }
3636
public bool ShowCountdown { get; set; }
37+
public bool IsDismissible { get; set; }
3738
}
3839
}

src/Announcements/ProtonVPN.Announcements.Contracts/IAnnouncementService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public interface IAnnouncementService
2727
{
2828
public IReadOnlyCollection<Announcement> Get();
2929

30-
public Task Update();
30+
public Task UpdateAsync();
3131

3232
public void MarkAsSeen(string id);
3333

src/Announcements/ProtonVPN.Announcements.Tests/AnnouncementServiceTest.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public async Task ItShouldClearAnnouncementsIfFeatureIsTurnedOff()
115115
AnnouncementService sut = GetAnnouncementService();
116116

117117
// Act
118-
await sut.Update();
118+
await sut.UpdateAsync();
119119

120120
// Assert
121121
_announcementCache.Get().Should().BeEmpty();
@@ -135,28 +135,28 @@ private IReadOnlyList<Announcement> GetAnnouncements()
135135
new()
136136
{
137137
Id = "1",
138-
Type = (int)AnnouncementType.Standard,
138+
Type = AnnouncementType.Standard,
139139
StartDateTimeUtc = DateTime.UtcNow,
140140
EndDateTimeUtc = DateTime.UtcNow.AddDays(1),
141141
},
142142
new()
143143
{
144144
Id = "2",
145-
Type = (int)AnnouncementType.Standard,
145+
Type = AnnouncementType.Standard,
146146
StartDateTimeUtc = DateTime.UtcNow,
147147
EndDateTimeUtc = DateTime.UtcNow.AddDays(1),
148148
},
149149
new()
150150
{
151151
Id = "3",
152-
Type = (int)AnnouncementType.OneTime,
152+
Type = AnnouncementType.OneTime,
153153
StartDateTimeUtc = DateTime.UtcNow,
154154
EndDateTimeUtc = DateTime.UtcNow.AddDays(1),
155155
},
156156
new()
157157
{
158158
Id = "4",
159-
Type = (int)AnnouncementType.OneTime,
159+
Type = AnnouncementType.OneTime,
160160
StartDateTimeUtc = DateTime.UtcNow,
161161
EndDateTimeUtc = DateTime.UtcNow.AddDays(1),
162162
}

0 commit comments

Comments
 (0)