Обновил шапкуОбновлен компилятор от китайцев.
[Setup]
AppName=Test
AppVersion=1.0
DefaultDirName={pf}\Test
DefaultGroupName=Test
AllowNoIcons=yes
OutputDir=.
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
DisableReadyMemo=true
DisableProgramGroupPage=true
[Languages]
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
[Types]
Name: full; Description: Components; Flags: iscustom
[Components]
Name: text; Description: Test; Types: full
Name: text\rus; Description: Test comp; Flags: exclusive
[Tasks]
Name: a; Description: 2; Flags: exclusive
Name: a; Description: 2
[Files]
Source: "Click.wav"; DestDir: "{tmp}"; Flags: dontcopy
Source: "Check.wav"; DestDir: "{tmp}"; Flags: dontcopy
[ code]
function PlaySound(lpszSoundName: AnsiString; uFlags: cardinal):integer; external 'sndPlaySoundA@winmm.dll stdcall';
procedure Click (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
PlaySound(ExpandConstant('{tmp}\Click.wav'),$0001);
end;
procedure Check (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
PlaySound(ExpandConstant('{tmp}\Check.wav'),$0001);
end;
procedure ClickWav();
begin
if not FileExists(ExpandConstant('{tmp}\Click.wav')) then ExtractTemporaryFile('Click.wav');
if not FileExists(ExpandConstant('{tmp}\Check.wav')) then ExtractTemporaryFile('Check.wav');
end;
var
CheckBoxChecked: Boolean;
CheckBox1: TCheckBox;
procedure ClickButton();
begin
with WizardForm do begin
with NextButton do begin
OnMouseDown := @Click;
end
with BackButton do begin
OnMouseDown := @Click;
end
with CancelButton do begin
OnMouseDown := @Click;
end
with NoIconsCheck do begin
OnMouseDown := @Check;
end
with DirBrowseButton do begin
OnMouseDown := @Click;
end
with GroupBrowseButton do begin
OnMouseDown := @Click;
end
with YesRadio do begin
OnMouseDown := @Check;
end
with NoRadio do begin
OnMouseDown := @Check;
end
with DirEdit do begin
OnMouseDown := @Click;
end
with GroupEdit do begin
OnMouseDown := @Click;
end
with TypesCombo do begin
OnMouseDown := @Click;
end
with PreparingYesRadio do begin
OnMouseDown := @Check;
end
with PreparingNoRadio do begin
OnMouseDown := @Check;
end
with ReadyMemo do begin
OnMouseDown := @Click;
end
with TypesCombo do begin
OnMouseDown := @Click;
end
with WelcomeLabel1 do begin
OnMouseDown := @Click;
end
with ReadyLabel do begin
OnMouseDown := @Click;
end
with TasksList do begin
OnMouseDown := @Check;
end
with RunList do begin
OnMouseDown := @Check;
end
with LicenseAcceptedRadio do begin
OnMouseDown := @Check;
end
with LicenseNotAcceptedRadio do begin
OnMouseDown := @Check;
end
with ComponentsList do begin
OnMouseDown := @Click;
end
with SelectComponentsPage do begin
OnMouseDown := @Click;
end
end;
end;
Procedure InitializeWizard();
begin
ClickButton();
ClickWav();
end;
[Setup]
AppId={{B4AF0554-6E6C-46E9-8CA3-DF407492C258}
AppName=Test
AppVersion=1.0
;AppVerName=Test 1.0
AppPublisher=Моя компания, Inc.
AppPublisherURL=http://www.сайт.com/
AppSupportURL=http://www.сайт.com/
AppUpdatesURL=http://www.сайт.com/
DefaultDirName={pf}\Test
DefaultGroupName=Test
AllowNoIcons=yes
OutputDir=.
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
DisableReadyMemo=true
DisableProgramGroupPage=true
[Languages]
Name: russian; MessagesFile: compiler:Languages\Russian.isl
[Messages]
russian.WizardSelectDir=Выбор папки установки и папки меню пуск
russian.SelectDirDesc=В какую папку вы хотите установить [name] и в какой папке должны создаться ярлыки?
[CustomMessages]
russian.DirEdit=Папка установки
russian.GroupEdit=Папка меню пуск
[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
[Icons]
Name: {group}\Test; Filename: {app}\MyProg.exe
Name: {group}\{cm:UninstallProgram,Test}; Filename: {uninstallexe}
Name: {commondesktop}\Test; Filename: {app}\MyProg.exe; Tasks: desktopicon
[Run]
Filename: {app}\MyProg.exe; Description: {cm:LaunchProgram,Test}; Flags: nowait postinstall skipifsilent
[ Code]
var
NewGroupBox1: TNewGroupBox;
NewGroupBox2: TNewGroupBox;
procedure InitializeWizard();
begin
with WizardForm do
begin
AutoScroll := False;
ClientHeight := ScaleY(400);
ClientWidth := ScaleX(537);
end;
with WizardForm.Bevel do
begin
Top := ScaleY(353);
Width := ScaleX(537);
end;
with WizardForm.Bevel1 do
begin
Width := ScaleX(539);
end;
with WizardForm.CancelButton do
begin
Left := ScaleX(452);
Top := ScaleY(367);
end;
with WizardForm.NextButton do
begin
Left := ScaleX(367);
Top := ScaleY(367);
end;
with WizardForm.BackButton do
begin
Left := ScaleX(288);
Top := ScaleY(367);
end;
with WizardForm.OuterNotebook do
begin
Width := ScaleX(537);
Height := ScaleY(353);
end;
with WizardForm.WizardBitmapImage do
begin
Height := ScaleY(354);
end;
with WizardForm.InnerNotebook do
begin
Width := ScaleX(457);
Height := ScaleY(277);
end;
with WizardForm.LicenseNotAcceptedRadio do
begin
Top := ScaleY(248);
end;
with WizardForm.LicenseAcceptedRadio do
begin
Top := ScaleY(228);
end;
with WizardForm.LicenseMemo do
begin
Width := ScaleX(457);
Height := ScaleY(188);
end;
with WizardForm.PasswordEdit do
begin
Width := ScaleX(305);
end;
with WizardForm.InfoBeforeMemo do
begin
Width := ScaleX(457);
Height := ScaleY(245);
end;
with WizardForm.UserInfoSerialEdit do
begin
Width := ScaleX(457);
end;
with WizardForm.UserInfoOrgEdit do
begin
Width := ScaleX(457);
end;
with WizardForm.UserInfoNameEdit do
begin
Width := ScaleX(457);
end;
with WizardForm.ComponentsList do
begin
Width := ScaleX(457);
end;
with WizardForm.TypesCombo do
begin
Width := ScaleX(457);
end;
with WizardForm.TasksList do
begin
Width := ScaleX(457);
Height := ScaleY(232);
end;
with WizardForm.ReadyMemo do
begin
Width := ScaleX(457);
Height := ScaleY(245);
end;
with WizardForm.ProgressGauge do
begin
Width := ScaleX(457);
end;
with WizardForm.InfoAfterMemo do
begin
Width := ScaleX(457);
Height := ScaleY(245);
end;
with WizardForm.MainPanel do
begin
Width := ScaleX(537);
end;
with WizardForm.WizardSmallBitmapImage do
begin
Left := ScaleX(480);
end;
with WizardForm.WizardBitmapImage2 do
begin
Height := ScaleY(354);
end;
NewGroupBox1 := TNewGroupBox.Create(WizardForm);
with NewGroupBox1 do
begin
Name := 'NewGroupBox1';
Parent := WizardForm.SelectDirPage;
Left := ScaleX(0);
Top := ScaleY(0);
Width := ScaleX(457);
Height := ScaleY(136);
Caption := CustomMessage('DirEdit');
end;
NewGroupBox2 := TNewGroupBox.Create(WizardForm);
with NewGroupBox2 do
begin
Name := 'NewGroupBox2';
Parent := WizardForm.SelectDirPage;
Left := ScaleX(0);
Top := ScaleY(136);
Width := ScaleX(457);
Height := ScaleY(136);
Caption := CustomMessage('GroupEdit');
end;
with WizardForm.SelectDirBitmapImage do
begin
Parent := NewGroupBox1;
Top := ScaleY(15);
Left := ScaleX(8);
end;
with WizardForm.SelectDirLabel do
begin
Parent := NewGroupBox1;
Top := ScaleY(25);
// Width := ScaleX(325);
Left := ScaleX(44);
end;
with WizardForm.SelectDirBrowseLabel do
begin
Parent := NewGroupBox1;
Top := ScaleY(48);
Left := ScaleX(8);
// Width := ScaleX(393);
end;
with WizardForm.DiskSpaceLabel do
begin
Parent := NewGroupBox1;
Left := ScaleX(8);
Top := ScaleY(110);
// Width := ScaleX(393);
end;
with WizardForm.DirBrowseButton do
begin
Parent := NewGroupBox1;
Left := ScaleX(372);
end;
with WizardForm.DirEdit do
begin
Parent := NewGroupBox1;
Left := ScaleX(8);
Width := ScaleX(362);
end;
with WizardForm.SelectGroupBitmapImage do
begin
Parent := NewGroupBox2;
Top := ScaleY(15);
Left := ScaleX(8);
end;
with WizardForm.SelectStartMenuFolderLabel do
begin
Parent := NewGroupBox2;
// Width := ScaleX(325);
Top := ScaleY(25);
Left := ScaleX(44);
end;
with WizardForm.SelectStartMenuFolderBrowseLabel do
begin
Parent := NewGroupBox2;
Top := ScaleY(48);
// Width := ScaleX(393);
Left := ScaleX(8);
end;
with WizardForm.GroupBrowseButton do
begin
Parent := NewGroupBox2;
Left := ScaleX(372);
end;
with WizardForm.GroupEdit do
begin
Parent := NewGroupBox2;
Left := ScaleX(8);
Width := ScaleX(362);
end;
with WizardForm.NoIconsCheck do
begin
Parent := NewGroupBox2;
Top := ScaleY(110);
Left := ScaleX(8);
// Width := ScaleX(401);
end;
NewGroupBox1.TabOrder := 5;
NewGroupBox2.TabOrder := 6;
end;
допиливать не сталкак правильней допилить его, чтоб там где не надо не озвучивало и работала озвучка при наведении
[Setup]
AppName=My Program
AppVerName=My Program v 1.5
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
OutputDir=.
LicenseFile=compiler:License.txt
[Files]
Source: UI\buttonclick.WAV; Flags: dontcopy
Source: UI\buttonclickrelease.WAV; Flags: dontcopy
Source: UI\buttonrollover.WAV; Flags: dontcopy
[ Code]
function sndPlaySound(lpszSoundName: AnsiString; uFlags: cardinal): Integer; external 'sndPlaySoundA@winmm stdcall delayload'; /// функция проигрывания звука
procedure PlaySoundOnEnter(Sender: TObject); /// процедура при наведении
begin
sndPlaySound(ExpandConstant('{tmp}\buttonrollover.WAV'),$0001);
end;
procedure PlaySoundOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); /// при нажатии кнопки
begin
sndPlaySound(ExpandConstant('{tmp}\buttonclick.WAV'),$0001);
end;
procedure PlaySoundOnMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); /// при отпускании кнопки
begin
sndPlaySound(ExpandConstant('{tmp}\buttonclickrelease.WAV'),$0001);
end;
procedure InitializeWizard;
begin
ExtractTemporaryFile('buttonclick.WAV'); /// функцией ExtractTemporaryFile извлекаем файл во временную папку - при нажатии кнопки мыши по контролу (не путать с кликом)
ExtractTemporaryFile('buttonclickrelease.WAV'); /// при отпускании кнопки мыши с контрола
ExtractTemporaryFile('buttonrollover.WAV'); /// при наведении
with WizardForm do
begin
with NextButton do
begin
OnMouseEnter := @PlaySoundOnEnter;
OnMouseDown := @PlaySoundOnMouseDown;
OnMouseUp := @PlaySoundOnMouseUp;
end;
with BackButton do
begin
OnMouseEnter := NextButton.OnMouseEnter;
OnMouseDown := NextButton.OnMouseDown;
OnMouseUp := NextButton.OnMouseUp;
end;
with CancelButton do
begin
OnMouseEnter := NextButton.OnMouseEnter;
OnMouseDown := NextButton.OnMouseDown;
OnMouseUp := NextButton.OnMouseUp;
end;
with DirBrowseButton do
begin
OnMouseEnter := NextButton.OnMouseEnter;
OnMouseDown := NextButton.OnMouseDown;
OnMouseUp := NextButton.OnMouseUp;
end;
with GroupBrowseButton do
begin
OnMouseEnter := NextButton.OnMouseEnter;
OnMouseDown := NextButton.OnMouseDown;
OnMouseUp := NextButton.OnMouseUp;
end;
end;
end;
[Setup]
AppName=UninsPassword
AppVerName=UninsPassword
DisableProgramGroupPage=true
DisableStartupPrompt=true
DefaultDirName={pf}\UninsPassword
[ Code]
function AskPassword(): Boolean;
var
Form: TSetupForm;
OKButton, CancelButton: TButton;
PwdEdit: TPasswordEdit;
NewStaticText1: TNewStaticText;
begin
Result := false;
Form := CreateCustomForm();
try
Form.ClientWidth := ScaleX(380);
Form.ClientHeight := ScaleY(145);
Form.Caption := 'Подтверждение удаления';
Form.BorderIcons := [biSystemMenu];
Form.BorderStyle := bsDialog;
Form.Center;
OKButton := TButton.Create(Form);
OKButton.Parent := Form;
OKButton.Width := ScaleX(75);
OKButton.Height := ScaleY(23);
OKButton.Left := Form.ClientWidth - ScaleX(275);
OKButton.Top := Form.ClientHeight - ScaleY(30);
OKButton.Caption := 'OK';
OKButton.ModalResult := mrOk;
OKButton.Default := true;
CancelButton := TButton.Create(Form);
CancelButton.Parent := Form;
CancelButton.Width := ScaleX(75);
CancelButton.Height := ScaleY(23);
CancelButton.Left := Form.ClientWidth - ScaleX(175);
CancelButton.Top := Form.ClientHeight - ScaleY(30);
CancelButton.Caption := 'Отмена';
CancelButton.ModalResult := mrCancel;
CancelButton.Cancel := True;
NewStaticText1 := TNewStaticText.Create(Form);
NewStaticText1.Parent := Form;
NewStaticText1.Caption := 'Если вы согласны, введите в поле для ввода "Yes" (с большой буквы)' + #13#10 +
'При этом, все что связанно с игрой (кроме сохранений)' + #13#10 +
'Будет удалено с вашего компьютера' + #13#10 +
'Если вы не согласны, просто нажмите кнопку "Отмена"' + #13#10 +
'Вы действительно хотите удалить игру ?';
NewStaticText1.Left := ScaleX(15);
NewStaticText1.Top := ScaleY(15);
NewStaticText1.Width := ScaleX(359);
NewStaticText1.Height := ScaleY(66);
PwdEdit := TPasswordEdit.Create(Form);
PwdEdit.Parent := Form;
PwdEdit.Width := ScaleX(210);
PwdEdit.Height := ScaleY(23);
PwdEdit.Left := ScaleX(85);
PwdEdit.Top := ScaleY(90);
Form.ActiveControl := PwdEdit;
if Form.ShowModal() = mrOk then
begin
Result := PwdEdit.Text = 'Yes';
if not Result then
MsgBox('Неправильный ответ, удаление отменено.', mbInformation, MB_OK);
end;
finally
Form.Free();
end;
end;
function InitializeUninstall(): Boolean;
begin
Result := AskPassword();
end;
#ifdef IS_ENHANCED
#if (Ver < 0x5020300) || (Pos('ee', IS_Ver_Str) < 1)
#pragma error 'Enhanced edition of Inno Setup (5.2.3.ee1 or higher) is required to compile this script'
#endif
#else
#error Enhanced edition of Inno Setup (restools) is required to compile this script
#endif
[Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}\My Application
SolidCompression=yes
Compression=lzma/ultra
PrivilegesRequired=none
OutputDir=.
UninstallFilesDir={app}\uninstall
[Files]
Source: "key.ico"; DestDir: {#SetupSetting("UninstallFilesDir")}; Flags: ignoreversion nocompression solidbreak sortfilesbyextension; Attribs: hidden system
[ code]
var
Ico: UINT;
const
IMAGE_ICON = 1;
LR_LOADFROMFILE = $10;
function LoadImage(hInst: UINT; ImageName: String; ImageType: UINT; X, Y: Integer; Flags: UINT): THandle;
#ifdef UNICODE
external 'LoadImageW@user32.dll stdcall';
#else
external 'LoadImageA@user32.dll stdcall';
#endif
function LoadIcon(hInstance: UINT; lpIconName: UINT): HICON;
#ifdef UNICODE
external 'LoadIconW@user32.dll stdcall';
#else
external 'LoadIconA@user32.dll stdcall';
#endif
function CheckUninstallPassword(): Boolean;
var
AResult: Boolean;
AResultStr: String;
begin
Result := False;
AResult := InputBoxEx(0, 'This is a Example' + #13#10#13#10 + 'Enter your password:', 'Confirm Password', 'пароль', '', ico, 300, 0, 0, AResultStr);
Result := AResult and (AResultStr = '123');
end;
function InitializeUninstall(): Boolean;
var
ErrorCode: Integer;
begin
Result := False;
if not UninstallSilent then
begin
Exec(ExpandConstant('{uninstallexe}'), '/VERYSILENT', '', SW_SHOW, ewNoWait, ErrorCode);
Exit;
end;
if FileCopy(ExpandConstant('{#SetupSetting("UninstallFilesDir")}\key.ico'), ExpandConstant('{tmp}\key.ico'), True) then
begin
Ico := LoadImage(0, ExpandConstant('{tmp}\key.ico'), IMAGE_ICON, 32, 32, LR_LOADFROMFILE);
Result := CheckUninstallPassword;
end;
end;
а попподробнее можно как именно страницы сделать?AVG
держи прототипы функций создания страниц
function CreateInputQueryPage(const AfterID: Integer; const ACaption, ADescription, ASubCaption: String): TInputQueryWizardPage;
function CreateInputOptionPage(const AfterID: Integer; const ACaption, ADescription, ASubCaption: String; Exclusive, ListBox: Boolean): TInputOptionWizardPage;
function CreateInputDirPage(const AfterID: Integer; const ACaption, ADescription, ASubCaption: String; AAppendDir: Boolean; ANewFolderName: String): TInputDirWizardPage;
function CreateInputFilePage(const AfterID: Integer; const ACaption, ADescription, ASubCaption: String): TInputFileWizardPage;
function CreateOutputMsgPage(const AfterID: Integer; const ACaption, ADescription, AMsg: String): TOutputMsgWizardPage;
function CreateOutputMsgMemoPage(const AfterID: Integer; const ACaption, ADescription, ASubCaption: String; const AMsg: AnsiString): TOutputMsgMemoWizardPage;
function CreateOutputProgressPage(const ACaption, ADescription: String): TOutputProgressWizardPage;
function CreateCustomPage(const AfterID: Integer; const ACaption, ADescription: String): TWizardPage;