-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
49 changed files
with
20,983 additions
and
522 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[CustomMessages] | ||
InstallProtonDriveTitle=Proton Drive をインストール - 暗号化クラウドストレージ (無料で利用可能) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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; | ||
|
@@ -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" | ||
|
@@ -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; | ||
|
@@ -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'; | ||
|
@@ -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; | ||
|
@@ -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'); | ||
|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.