#define MyAppName "Inv_web Client" #define MyAppVersion "2.0" #define MyAppPublisher "Inv_web" #define MyAppExeName "Inv_web Client.exe" [Setup] AppId={{6F0D1694-CACE-4F7D-97A2-BB01C240775B} AppName={#MyAppName} AppVersion={#MyAppVersion} AppPublisher={#MyAppPublisher} DefaultDirName={localappdata}\Programs\{#MyAppName} DefaultGroupName={#MyAppName} PrivilegesRequired=lowest OutputDir=dist OutputBaseFilename=Inv_web_Client_Setup SetupIconFile=picture\ICON\icon_client.ico UninstallDisplayIcon={app}\{#MyAppExeName} Compression=lzma2 SolidCompression=yes WizardStyle=modern ArchitecturesAllowed=x64compatible ArchitecturesInstallIn64BitMode=x64compatible CloseApplications=yes RestartApplications=no DisableProgramGroupPage=yes DisableDirPage=yes DisableReadyPage=yes [Languages] Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl" [Files] Source: "dist\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion [Icons] Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" [Run] Filename: "{app}\{#MyAppExeName}"; Parameters: "--configure-only --server ""{code:GetServerAddress}"" --token ""{code:GetAgentToken}"""; Flags: runhidden waituntilterminated Filename: "{app}\{#MyAppExeName}"; Description: "Запустить {#MyAppName}"; Flags: nowait postinstall skipifsilent unchecked [Code] var ConnectionPage: TInputQueryWizardPage; procedure InitializeWizard; begin ConnectionPage := CreateInputQueryPage( wpWelcome, 'Подключение к серверу', 'Укажите параметры подключения клиента', 'Введите адрес сервера и токен. Эти данные будут сохранены в профиле текущего пользователя.' ); ConnectionPage.Add('Адрес сервера:', False); ConnectionPage.Add('Токен:', True); end; function NextButtonClick(CurPageID: Integer): Boolean; begin Result := True; if CurPageID <> ConnectionPage.ID then Exit; if Trim(ConnectionPage.Values[0]) = '' then begin MsgBox('Укажите адрес сервера.', mbError, MB_OK); Result := False; Exit; end; if Trim(ConnectionPage.Values[1]) = '' then begin MsgBox('Укажите токен.', mbError, MB_OK); Result := False; Exit; end; if (Pos('"', ConnectionPage.Values[0]) > 0) or (Pos('"', ConnectionPage.Values[1]) > 0) then begin MsgBox('Адрес сервера и токен не должны содержать двойные кавычки.', mbError, MB_OK); Result := False; end; end; function GetServerAddress(Param: String): String; begin Result := Trim(ConnectionPage.Values[0]); end; function GetAgentToken(Param: String): String; begin Result := Trim(ConnectionPage.Values[1]); end;