mirror of
https://github.com/ONLYOFFICE/desktop-apps.git
synced 2026-04-07 14:09:22 +08:00
[win-nix] keep key for analysis of the portal registration
This commit is contained in:
@ -120,6 +120,11 @@ procedure GetSystemTimeAsFileTime(var lpFileTime: TFileTime); external 'GetSyste
|
||||
function SendTextMessageTimeout(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: PAnsiChar; fuFlags: UINT; uTimeout: UINT; out lpdwResult: DWORD): LRESULT;
|
||||
external 'SendMessageTimeoutA@user32.dll stdcall';
|
||||
|
||||
function GetCommandlineParam(inParamName: String):String; forward;
|
||||
function StartsWith(SubStr, S: String) : Boolean; forward;
|
||||
function StringReplace(S, oldSubString, newSubString: String) : String; forward;
|
||||
|
||||
|
||||
//procedure checkArchitectureVersion; forward;
|
||||
function GetHKLM: Integer; forward;
|
||||
|
||||
@ -320,6 +325,7 @@ end;
|
||||
procedure CurStepChanged(CurStep: TSetupStep);
|
||||
var
|
||||
commonCachePath, userCachePath: string;
|
||||
paramStore: string;
|
||||
begin
|
||||
if CurStep = ssPostInstall then
|
||||
begin
|
||||
@ -334,6 +340,44 @@ begin
|
||||
DirectoryCopy(commonCachePath, userCachePath);
|
||||
end
|
||||
end;
|
||||
|
||||
paramStore := GetCommandlineParam('/store');
|
||||
if Length(paramStore) > 0 then
|
||||
begin
|
||||
RegWriteStringValue(HKEY_LOCAL_MACHINE, ExpandConstant('{#APP_REG_PATH}'), 'Store', paramStore);
|
||||
end;
|
||||
end;
|
||||
|
||||
function StartsWith(SubStr, S: String) : Boolean;
|
||||
begin
|
||||
Result := Pos(SubStr, S) = 1;
|
||||
end;
|
||||
|
||||
function StringReplace(S, oldSubString, newSubString: String) : String;
|
||||
var
|
||||
stringCopy : String;
|
||||
begin
|
||||
stringCopy := S; //Prevent modification to the original string
|
||||
StringChange(stringCopy, oldSubString, newSubString);
|
||||
Result := stringCopy;
|
||||
end;
|
||||
|
||||
function GetCommandlineParam(inParamName: String) : String;
|
||||
var
|
||||
paramNameAndValue: String;
|
||||
i: Integer;
|
||||
begin
|
||||
Result := '';
|
||||
|
||||
for i:= 1 to ParamCount do
|
||||
begin
|
||||
paramNameAndValue := Lowercase(ParamStr(i));
|
||||
if StartsWith(inParamName, paramNameAndValue) then
|
||||
begin
|
||||
Result := StringReplace(paramNameAndValue, inParamName + ':', '');
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
@ -1205,7 +1205,13 @@ void CMainPanel::onPortalNew(QString in)
|
||||
|
||||
void CMainPanel::onPortalCreate()
|
||||
{
|
||||
int res = m_pTabs->newPortal(URL_SIGNUP, tr("Sign Up"));
|
||||
QString _url = URL_SIGNUP;
|
||||
|
||||
GET_REGISTRY_SYSTEM(reg_system)
|
||||
if ( reg_system.contains("Store") )
|
||||
_url += "&store=" + reg_system.value("Store").toString();
|
||||
|
||||
int res = m_pTabs->newPortal(_url, tr("Sign Up"));
|
||||
if (res == 2) { RecalculatePlaces(); }
|
||||
|
||||
QTimer::singleShot(200, this, [=]{
|
||||
|
||||
Reference in New Issue
Block a user