Смотрите видео ниже, чтобы узнать, как установить наш сайт в качестве веб-приложения на домашнем экране.
Примечание: Эта возможность может быть недоступна в некоторых браузерах.
var
Portable,Installer: TNewRadioButton;
function CheckParam(s: string): boolean;
var
i: integer;
begin
for i := 0 to ParamCount do begin
Result := ParamStr(i) = s;
if Result then Break;
end;
end;
function GetInstallDir(S: String): String;
begin
if CheckParam('/P') then
Result:= ExpandConstant('{userdesktop}\My Application Portable')
else
Result:= ExpandConstant(S);
end;
function PortableCheck: Boolean;
begin
Result := Portable.Checked or CheckParam('/P');
end;
function InstallerCheck: Boolean;
begin
Result := Installer.Checked or CheckParam('/I');
end;
procedure InitializeWizard();
begin
WizardForm.DirEdit.Text:= ExpandConstant('{code:GetInstallDir|{pf}\My Application}');
Portable := TNewRadioButton.Create(WizardForm);
with Portable do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(110);
Top := ScaleY(175);
Width := ScaleX(100);
Height := ScaleY(17);
Caption := 'Портативная';
Checked := CheckParam('/P');
end;
Installer := TNewRadioButton.Create(WizardForm);
with Installer do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(0);
Top := ScaleY(175);
Width := ScaleX(100);
Height := ScaleY(17);
Caption := 'Стационарная';
Checked := not CheckParam('/P');
end;
end;
setup.exe /VERYSILENT /D="D:\Пробная Директория Portable dir"
Убрать ключ /I. Делать проверку только на /PПерепробовал все примеры! При тихой распаковке, обычная версия как устанавливалась так и устанавливается. Может кто подскажет, что к чему?
function PanelZadachCheckParam: Boolean;
begin Result := Pos('/SZ', GetCmdTail) <= 0;
end;
[Setup]
AppName=My Program
AppVersion=1.1
DefaultDirName={pf}\My Program
DirExistsWarning=no
DisableDirPage=yes
DefaultGroupName=My Program
DisableWelcomePage=yes
DisableProgramGroupPage=yes
DisableReadyPage=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Languages\English.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
[Files]
Source: "{app}\FileEng.txt"; DestDir: "{app}"; Check: "LEng"; Flags: ignoreversion
Source: "{app}\FileRus.txt"; DestDir: "{app}"; Check: "LRus"; Flags: ignoreversion
Source: "{app}\FileUkr.txt"; DestDir: "{app}"; Check: "LUkr"; Flags: ignoreversion
[Icons]
Name: "{group}\My Program\FileRus.txt"; Filename: "{app}\FileRus.txt"; Check: "LRus and StartMenuIcon";
Name: "{group}\My Program\FileEng.txt"; Filename: "{app}\FileEng.txt"; Check: "LEng and StartMenuIcon";
Name: "{group}\My Program\FileUkr.txt"; Filename: "{app}\FileUkr.txt"; Check: "LUkr and StartMenuIcon";
Name: "{commondesktop}\FileRus.txt"; Filename: "{app}\FileRus.txt"; Check: "LRus and DesktopIcon";
Name: "{commondesktop}\FileEng.txt"; Filename: "{app}\FileEng.txt"; Check: "LEng and DesktopIcon";
Name: "{commondesktop}\FileUkr.txt"; Filename: "{app}\FileUkr.txt"; Check: "LUkr and DesktopIcon";
[_Code]
var
CustomPage: TWizardPage;
LangRus, LangEng, LangUkr: TNewRadioButton;
DesktopIconCheckBox, StartMenuCheckBox: TNewCheckBox;
function InitializeLanguageDialog(): Boolean;
var
i : Integer;
begin
Result := True;
for i := 1 to ParamCount do
if LowerCase(ParamStr(i)) = '/s' then
begin
Result := False;
Break;
end;
end;
function InitializeSetup(): Boolean;
var
i, ResultCode: Integer;
begin
begin
for i := 1 to ParamCount do
if LowerCase(ParamStr(i)) = '/s' then
begin
Exec(ExtractFileName(ExpandConstant('{srcexe}')), '/verysilent', ExtractFileDir(ExpandConstant('{srcexe}')), SW_SHOWNORMAL, ewNoWait, ResultCode);
Exit;
end;
Result := True;
end;
end;
function CheckParam(s: string): boolean;
var
i: integer;
begin
for i := 0 to ParamCount do begin
Result := ParamStr(i) = s;
if Result then Break;
end;
end;
function LRus: Boolean; begin Result:= LangRus.Checked or CheckParam('/RU') or CheckParam('/R'); end;
function LEng: Boolean; begin Result:= LangEng.Checked or CheckParam('/EN') or CheckParam('/E'); end;
function LUkr: Boolean; begin Result:= LangUkr.Checked or CheckParam('/UA') or CheckParam('/U'); end;
function DesktopIcon: Boolean; begin if not CheckParam('/ND') and not CheckParam('/NoDesktop') then Result := DesktopIconCheckBox.Checked end;
function StartMenuIcon: Boolean; begin if not CheckParam('/NM') and not CheckParam('/NoStartMenu') then Result := StartMenuCheckBox.Checked end;
procedure InitializeWizard();
begin
{ Custom wizard page }
CustomPage := CreateCustomPage(wpSelectTasks, 'CustomPage_Caption', 'CustomPage_Description');
{ LangRus_RadioButton }
LangRus := TNewRadioButton.Create(WizardForm);
with LangRus do
begin
Parent := CustomPage.Surface;
SetBounds(ScaleX(8),ScaleY(24),ScaleX(113),ScaleY(17));
Caption := 'Русский';
Checked:= not CheckParam('/RU') or not CheckParam('/R');
end;
{ LangEng_RadioButton }
LangEng := TNewRadioButton.Create(WizardForm);
with LangEng do
begin
Parent := CustomPage.Surface;
SetBounds(ScaleX(8),ScaleY(48),ScaleX(113),ScaleY(17));
Caption := 'Английский';
Checked:= CheckParam('/EN') or CheckParam('/E');
end;
{ LangUkr_RadioButton }
LangUkr := TNewRadioButton.Create(WizardForm);
with LangUkr do
begin
Parent := CustomPage.Surface;
SetBounds(ScaleX(8),ScaleY(72),ScaleX(113),ScaleY(17));
Caption := 'Украинский';
Checked:= CheckParam('/UA') or CheckParam('/U');
end;
{ DesktopIcon_CheckBox }
DesktopIconCheckBox := TNewCheckBox.Create(WizardForm);
with DesktopIconCheckBox do
begin
Parent := CustomPage.Surface;
SetBounds(ScaleX(8),ScaleY(130),ScaleX(166),ScaleY(17));
Caption := 'Ярлык на рабочем столе';
Checked:=not CheckParam('/ND') or not CheckParam('/NoDesktop');
end;
{ StartMenu_CheckBox }
StartMenuCheckBox := TNewCheckBox.Create(WizardForm);
with StartMenuCheckBox do
begin
Parent := CustomPage.Surface;
SetBounds(ScaleX(8),ScaleY(150),ScaleX(166),ScaleY(17));
Caption := 'Ярлыки в меню Пуск';
Checked:=not CheckParam('/NM') or not CheckParam('/NoStartMenu');
end;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
case CurPageID of
CustomPage.ID:
begin
WizardForm.NextButton.Caption := SetupMessage(msgButtonInstall);
end;
end;
end;
function InitializeSetup(): Boolean;
var
i, ResultCode: Integer;
begin
for i := 1 to ParamCount do// перебираем параметры
if LowerCase(ParamStr(i)) = '/s' then //если находим параметр /s
begin//то запускаем инсталлятор заново с единственным ключем /verysilent, остальные идут лесом
Exec(ExtractFileName(ExpandConstant('{srcexe}')), '/verysilent', ExtractFileDir(ExpandConstant('{srcexe}')), SW_SHOWNORMAL, ewNoWait, ResultCode);
Exit;// из текущего процесса мы тут выходим.
end;
Result := True;
end;
function InitializeSetup(): Boolean;
var
i, k, ResultCode: Integer;
params, p: String;
begin
for i := 1 to ParamCount do begin
// Skip non /S paramters
if LowerCase(ParamStr(i)) <> '/s' then
Continue;
// Build param string
params:= '';
for k := 1 to ParamCount do begin
// Skip /S option
if (k = i) then
Continue;
// Skip srcexe and /SL5 params
p:= ParamStr(k);
if (Pos('/SL5', p) = 1) or (Pos(ExpandConstant('{srcexe}'), p) = 1) then
Continue;
// Append parameter
params:= params + ' ' + AddQuotes(p);
end;
Exec(ExtractFileName(ExpandConstant('{srcexe}')), '/verysilent' + params, ExtractFileDir(ExpandConstant('{srcexe}')), SW_SHOWNORMAL, ewNoWait, ResultCode);
Exit;
end;
Result := True;
end;
;InnoSetupVersion=5.5.1 ee2(a)
#define MyAppName "My Program"
#define MyAppVersion "1.1.1"
[Setup]
AppName={#MyAppName}
AppVersion={#MyAppVersion}
DefaultDirName={pf}\{#MyAppName}
DisableWelcomePage=yes
DisableDirPage=yes
[Types]
Name: "custom"; Description: "Custom installation"; Flags: iscustom;
[Components]
Name: "CompA"; Description: "{cm:CompLabelA}"; Types: "custom"; Check: "RegConvert";
Name: "CompB"; Description: "{cm:CompLabelB}"; Check: "HelpInst";
[Files]
Source: "{app}\ExeFile1.exe"; DestDir: "{app}"; Components: "CompA" ; Flags: ignoreversion
Source: "{app}\HelpFile.chm"; DestDir: "{app}"; Components: "CompB" ; Flags: ignoreversion
[Languages]
Name: "en"; MessagesFile: "compiler:Languages\english.isl";
Name: "ru"; MessagesFile: "compiler:Languages\russian.isl";
[CustomMessages]
ru.CompLabelA=Конвертер
ru.CompLabelB=Справка
en.CompLabelA=Converter
en.CompLabelB=Help
[_Code]
function CheckParam(s: string): boolean;
var
i: integer;
begin
for i := 0 to ParamCount do begin
Result := ParamStr(i) = s;
if Result then Break;
end;
end;
//***Функции для отключения чекбоксов компонентов***\\
// Тут вроде работает, но чувствую, что то-то не так...
function RegConvert: Boolean; begin if not CheckParam('/NK') and not CheckParam('/NoRegConverter') then Result := True; end;
//***Функции для включения чекбоксов компонентов***\\
// Тут не работает...
function HelpInst: Boolean;
begin
begin
if CheckParam('/IH') and CheckParam('/InstallHelp')
then
WizardForm.ComponentsList.Checked[1] := True;
//IsComponentSelected('CompB');
end;
Result := True;
end;
Result := True; Эта строчка у тебя безусловна. тоесть, HelpInst всегда вернет True, невзирая ни на какие ключи.// Тут не работает...
function HelpInst: Boolean;
begin
if CheckParam('/IH') and CheckParam('/InstallHelp')
then begin
WizardForm.ComponentsList.Checked[1] := True;
Result := True;
end;
end;