Skip to content

Commit

Permalink
Merge branch 'release/3.2.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
Mindaugas Veblauskas committed Nov 14, 2023
2 parents 6a85c59 + ce60072 commit a8a3546
Show file tree
Hide file tree
Showing 49 changed files with 20,983 additions and 522 deletions.
9 changes: 7 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,24 @@ tests:
build-installer:
stage: build-installer
tags:
- windows
- windows-vpn-signer
dependencies:
- build-debug
- build-release
extends:
- .build-installer
variables:
BUILD_PATH: src/bin/win-x64/publish
FF_USE_FASTZIP: "true"
TRANSFER_METER_FREQUENCY: "2s"
ARTIFACT_COMPRESSION_LEVEL: "fastest"
CACHE_COMPRESSION_LEVEL: "fastest"
FASTZIP_ARCHIVER_BUFFER_SIZE: 128
artifacts:
paths:
- Setup/Installers/
expire_in: 4 weeks

build-BTI-installer:
stage: build-installer
when: manual
Expand Down
2 changes: 2 additions & 0 deletions Setup/Strings/Finnish.isl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[CustomMessages]
InstallProtonDriveTitle=Asenna Proton Drive - Salattu pilvitallennus (ilmainen Proton VPN:n kanssa)
2 changes: 2 additions & 0 deletions Setup/Strings/Japanese.isl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[CustomMessages]
InstallProtonDriveTitle=Proton Drive をインストール - 暗号化クラウドストレージ (無料で利用可能)
52 changes: 40 additions & 12 deletions Setup/setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#define Hash ""
#define VersionFolder "v" + MyAppVersion
#define AppFolder "Proton\VPN"
#define SourcePath GetEnv("BUILD_PATH")
#define IsBTISource SourcePath == "src/bin/win-x64/BTI/publish"
#if IsBTISource
Expand Down Expand Up @@ -104,6 +105,12 @@ Source: "..\{#SourcePath}\uk-UA\ProtonVPN.Translations.resources.dll"; DestDir:
Source: "..\{#SourcePath}\tr-TR\ProtonVPN.Translations.resources.dll"; DestDir: "{app}\{#VersionFolder}\tr-TR"; Flags: signonce;
Source: "..\{#SourcePath}\be-BY\ProtonVPN.Translations.resources.dll"; DestDir: "{app}\{#VersionFolder}\be-BY"; Flags: signonce;
Source: "..\{#SourcePath}\ka-GE\ProtonVPN.Translations.resources.dll"; DestDir: "{app}\{#VersionFolder}\ka-GE"; Flags: signonce;
Source: "..\{#SourcePath}\el-GR\ProtonVPN.Translations.resources.dll"; DestDir: "{app}\{#VersionFolder}\el-GR"; Flags: signonce;
Source: "..\{#SourcePath}\fi-FI\ProtonVPN.Translations.resources.dll"; DestDir: "{app}\{#VersionFolder}\fi-FI"; Flags: signonce;
Source: "..\{#SourcePath}\ko-KR\ProtonVPN.Translations.resources.dll"; DestDir: "{app}\{#VersionFolder}\ko-KR"; Flags: signonce;
Source: "..\{#SourcePath}\zh-TW\ProtonVPN.Translations.resources.dll"; DestDir: "{app}\{#VersionFolder}\zh-TW"; Flags: signonce;
Source: "..\{#SourcePath}\sv-SE\ProtonVPN.Translations.resources.dll"; DestDir: "{app}\{#VersionFolder}\sv-SE"; Flags: signonce;
Source: "..\{#SourcePath}\ja-JP\ProtonVPN.Translations.resources.dll"; DestDir: "{app}\{#VersionFolder}\ja-JP"; Flags: signonce;

Source: "..\{#SourcePath}\Resources\*.dll"; DestDir: "{app}\{#VersionFolder}\Resources"; Flags: signonce;
Source: "..\{#SourcePath}\Resources\*.exe"; DestDir: "{app}\{#VersionFolder}\Resources"; Flags: signonce;
Expand Down Expand Up @@ -133,7 +140,9 @@ Filename: "{app}\{#VersionFolder}\{#ProtonDriveDownloaderName}"; Parameters: "{c
[Languages]
Name: "en_US"; MessagesFile: "compiler:Default.isl,Strings\Default.isl"
Name: "cs_CZ"; MessagesFile: "compiler:Languages\Czech.isl,Strings\Czech.isl"
Name: "ja_JP"; MessagesFile: "compiler:Languages\Japanese.isl,Strings\Japanese.isl"
Name: "de_DE"; MessagesFile: "compiler:Languages\German.isl,Strings\German.isl"
Name: "fi_FI"; MessagesFile: "compiler:Languages\Finnish.isl,Strings\Finnish.isl"
Name: "fr_FR"; MessagesFile: "compiler:Languages\French.isl,Strings\French.isl"
Name: "nl_NL"; MessagesFile: "compiler:Languages\Dutch.isl,Strings\Dutch.isl"
Name: "it_IT"; MessagesFile: "compiler:Languages\Italian.isl,Strings\Italian.isl"
Expand All @@ -152,6 +161,7 @@ Type: filesandordirs; Name: "{app}\{#VersionFolder}\Resources"

[Dirs]
Name: "{localappdata}\ProtonVPN\DiagnosticLogs"
Name: "{commonappdata}\ProtonVPN\Updates"; AfterInstall: SetFolderPermissions;

[Code]
function InitLogger(logger: Longword): Integer;
Expand All @@ -169,6 +179,9 @@ external 'UninstallProduct@files:ProtonVPN.InstallActions.x86.dll cdecl delayloa
function IsProductInstalled(upgradeCode: String): Integer;
external 'IsProductInstalled@files:ProtonVPN.InstallActions.x86.dll cdecl delayload';
function SetUpdatesFolderPermission(updatesFolderPath: String): Integer;
external 'SetUpdatesFolderPermission@files:ProtonVPN.InstallActions.x86.dll cdecl delayload';
function UninstallTapAdapter(tapFilesPath: String): Integer;
external '[email protected] cdecl delayload uninstallonly';
Expand Down Expand Up @@ -231,25 +244,34 @@ begin
end;
end;
procedure SetFolderPermissions();
begin
SetUpdatesFolderPermission(ExpandConstant('{commonappdata}\ProtonVPN\Updates'));
end;
procedure DeleteNonRunningVersions(const Directory: string);
var
VersionFolder: TFindRec;
VersionFolderPath: String;
VersionFolderPath, ProcessPath: String;
i: Integer;
Processes: array of String;
IsRunningProcessFound: Boolean;
begin
Log('Using directory ' + Directory + ' to find previous app versions for deletion');
Processes := ['ProtonVPN.exe', 'ProtonVPNService.exe', 'ProtonVPN.WireGuardService.exe'];
if FindFirst(ExpandConstant(Directory + '\v*'), VersionFolder) then
try
repeat
Log('Found version folder ' + VersionFolder.Name);
VersionFolderPath := AddBackslash(Directory) + AddBackslash(VersionFolder.Name)
IsRunningProcessFound := False;
for i := 0 to GetArrayLength(Processes) - 1 do
begin
if IsProcessRunningByPath(VersionFolderPath + Processes[i]) then
ProcessPath := VersionFolderPath + Processes[i];
Log('Checking if the process ' + ProcessPath + ' is running');
if IsProcessRunningByPath(ProcessPath) then
begin
Log('Running process detected: ' + VersionFolderPath + Processes[i]);
Log('Running process detected: ' + ProcessPath);
IsRunningProcessFound := True;
Break;
end;
Expand Down Expand Up @@ -382,13 +404,24 @@ begin
Log('Service uninstall returned: ' + IntToStr(Result));
end;
function IsUpgrade: Boolean;
begin
Result := FileExists(ExpandConstant('{app}\{#LauncherExeName}'));
end;
function PrepareToInstall(var NeedsRestart: Boolean): String;
var
vpnFolderPath: String;
begin
DeleteNonRunningVersions(ExpandConstant('{app}'));
vpnFolderPath := '{app}';
if IsUpgrade = False then
vpnFolderPath := vpnFolderPath + '\{#AppFolder}';
DeleteNonRunningVersions(ExpandConstant(vpnFolderPath));
Log('Trying to save user settings for the old ProtonVPN app if it is installed');
SaveOldUserConfigFolder();
Log('Trying to update taskbar icon path if exists');
UpdateTaskbarIconTarget(ExpandConstant('{app}\{#VersionFolder}\{#MyAppExeName}'));
UpdateTaskbarIconTarget(ExpandConstant(vpnFolderPath + '\{#VersionFolder}\{#MyAppExeName}'));
Log('Trying to uninstall an old version of ProtonVPN app');
UninstallProduct('{2B10124D-2F81-4BB1-9165-4F9B1B1BA0F9}');
Log('Trying to uninstall an old version of ProtonVPN TUN adapter');
Expand Down Expand Up @@ -458,19 +491,14 @@ var
path: String;
begin
path := WizardForm.DirEdit.Text;
StringChangeEx(path, '\Proton\VPN', '\Proton\Drive', True);
StringChangeEx(path, ExpandConstant('\{#AppFolder}'), '\Proton\Drive', True);
Result := '"' + path + '"';
end;
function IsUpgrade: Boolean;
begin
Result := FileExists(ExpandConstant('{app}\{#LauncherExeName}'));
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if (CurPageID = wpPreparing) and (IsInstallPathModified = False) and (IsUpgrade = False) then begin
IsInstallPathModified := true;
WizardForm.DirEdit.Text := WizardForm.DirEdit.Text + '\Proton\VPN';
WizardForm.DirEdit.Text := WizardForm.DirEdit.Text + ExpandConstant('\{#AppFolder}');
end;
end;
11 changes: 8 additions & 3 deletions ci/build-scripts/guest_hole_server_loader.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import json
import random
from urllib.request import urlopen
import requests

def load():
# Constants
Expand All @@ -13,7 +12,13 @@ def load():

print('Started updating guest hole servers json')

original_json = json.loads(urlopen(server_list_api_url).read())
proxies = {
'http': 'http://proxy.plabs.ch:3128',
'https': 'http://proxy.plabs.ch:3128',
}

response = requests.get(server_list_api_url, proxies=proxies)
original_json = response.json()

logical_servers = original_json["LogicalServers"]
print(''.join(['Number of logical servers: ', str(len(logical_servers))]))
Expand Down
2 changes: 1 addition & 1 deletion ci/build-scripts/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def build(version, hash, setupFile):
with open(setupFile, 'w') as file:
file.write(fileData)

p = subprocess.Popen(['iscc', setupFile],
p = subprocess.Popen(['iscc', setupFile, "/Ssigntool=signtool.exe $p"],
env=os.environ,
stdout=subprocess.PIPE,
universal_newlines=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace ProtonVPN.Announcements.Contracts
public class Announcement
{
public string Id { get; set; }
public int Type { get; set; }
public AnnouncementType Type { get; set; }
public string Reference { get; set; }
public DateTime StartDateTimeUtc { get; set; }
public DateTime EndDateTimeUtc { get; set; }
Expand All @@ -34,5 +34,6 @@ public class Announcement
public Panel Panel { get; set; }
public bool Seen { get; set; }
public bool ShowCountdown { get; set; }
public bool IsDismissible { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public interface IAnnouncementService
{
public IReadOnlyCollection<Announcement> Get();

public Task Update();
public Task UpdateAsync();

public void MarkAsSeen(string id);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public async Task ItShouldClearAnnouncementsIfFeatureIsTurnedOff()
AnnouncementService sut = GetAnnouncementService();

// Act
await sut.Update();
await sut.UpdateAsync();

// Assert
_announcementCache.Get().Should().BeEmpty();
Expand All @@ -135,28 +135,28 @@ private IReadOnlyList<Announcement> GetAnnouncements()
new()
{
Id = "1",
Type = (int)AnnouncementType.Standard,
Type = AnnouncementType.Standard,
StartDateTimeUtc = DateTime.UtcNow,
EndDateTimeUtc = DateTime.UtcNow.AddDays(1),
},
new()
{
Id = "2",
Type = (int)AnnouncementType.Standard,
Type = AnnouncementType.Standard,
StartDateTimeUtc = DateTime.UtcNow,
EndDateTimeUtc = DateTime.UtcNow.AddDays(1),
},
new()
{
Id = "3",
Type = (int)AnnouncementType.OneTime,
Type = AnnouncementType.OneTime,
StartDateTimeUtc = DateTime.UtcNow,
EndDateTimeUtc = DateTime.UtcNow.AddDays(1),
},
new()
{
Id = "4",
Type = (int)AnnouncementType.OneTime,
Type = AnnouncementType.OneTime,
StartDateTimeUtc = DateTime.UtcNow,
EndDateTimeUtc = DateTime.UtcNow.AddDays(1),
}
Expand Down
Loading

0 comments on commit a8a3546

Please sign in to comment.