feat(@desktop/Windows): status-im:// protocol support and installer fixes

This commit is contained in:
Andrei Smirnov 2021-09-06 11:58:54 +03:00 committed by Iuri Matias
parent 8519577fcb
commit 03022742d8
3 changed files with 15 additions and 8 deletions

View File

@ -135,7 +135,7 @@ proc mainProc() =
defer: wallet2.delete()
engine.setRootContextProperty("walletV2Model", wallet2.variant)
var chat = chat.newController(status, appService)
var chat = chat.newController(status, appService, OPENURI)
defer: chat.delete()
engine.setRootContextProperty("chatsModel", chat.variant)

View File

@ -1,12 +1,17 @@
from os import getAppDir, joinPath
from os import getAppDir, joinPath, commandLineParams
from winlean import Handle, shellExecuteW
proc restoreParamsString(strings: seq[string]): string =
result = ""
for str in strings:
result = result & " " & str
const NULL: Handle = 0
let launcherDir = getAppDir()
let workDir_str = joinPath(launcherDir, "bin")
let exePath_str = joinPath(workDir_str, "Status.exe")
let open_str = "open"
let params_str = ""
let params_str = restoreParamsString(commandLineParams())
let workDir = newWideCString(workDir_str)
let exePath = newWideCString(exePath_str)
let open = newWideCString(open_str)

View File

@ -17,11 +17,12 @@ AppSupportURL={#URL}
AppUpdatesURL={#URL}
DefaultDirName={localappdata}\{#Name}App
UsePreviousAppDir=no
PrivilegesRequired=lowest
PrivilegesRequired=admin
WizardStyle=modern
UninstallDisplayIcon={app}\{#ExeName}
DefaultGroupName={#Name}
CloseApplications=yes
ArchitecturesInstallIn64BitMode=x64
; output dir for installer
OutputBaseFileName={#BaseName}
@ -64,6 +65,7 @@ Name: "{group}\Uninstall {#Name}"; Filename: "{uninstallexe}"
Name: "{userdesktop}\{#Name}"; Filename: "{app}\{#ExeName}"; IconFilename: "{app}\resources\{#IcoName}"; Tasks: desktopicon
[Run]
Filename: "{app}\vendor\vc_redist.x64.exe"; Parameters: "/install /quiet /norestart"; StatusMsg: "Installing VS2017 redistributable package (64 Bit)";
Filename: "{app}\{#ExeName}"; Description: {cm:LaunchProgram,{#Name}}; Flags: nowait postinstall skipifsilent
[UninstallDelete]
@ -72,10 +74,10 @@ Type: files; Name: "{userdesktop}\{#Name}"
Type: files; Name: "{commondesktop}\{#Name}"
[Registry]
Root: HKCU; Subkey: "Software\Classes\status-im"; ValueType: "string"; ValueData: "URL:status-im protocol"; Flags: uninsdeletekey
Root: HKCU; Subkey: "Software\Classes\status-im"; ValueType: "string"; ValueName: "URL Protocol"; ValueData: ""
Root: HKCU; Subkey: "Software\Classes\status-im\DefaultIcon"; ValueType: "string"; ValueData: "{app}\Status.exe,1"
Root: HKCU; Subkey: "Software\Classes\status-im\shell\open\command"; ValueType: "string"; ValueData: """{app}\Status.exe"" ""--url=""%1"""
Root: HKCR; Subkey: "status-im"; ValueType: "string"; ValueData: "URL:status-im Protocol"; Flags: uninsdeletekey
Root: HKCR; Subkey: "status-im"; ValueType: "string"; ValueName: "URL Protocol"; ValueData: ""
Root: HKCR; Subkey: "status-im\DefaultIcon"; ValueType: "string"; ValueData: "{app}\Status.exe,1"
Root: HKCR; Subkey: "status-im\shell\open\command"; ValueType: "string"; ValueData: """{app}\bin\Status.exe"" ""--uri=%1"""
[Code]
function IsAppRunning(const FileName : string): Boolean;