[code]
procedure CurPageChanged(CurPageID: Integer);
begin
case CurPageId of
wpWelcome : MsgBox('wpWelcome ', mbInformation, MB_OK);
wpLicense : MsgBox('wpLicense', mbInformation, MB_OK);
wpPassword : MsgBox('wpPassword ', mbInformation, MB_OK);
wpInfoBefore : MsgBox('wpInfoBefore', mbInformation, MB_OK);
wpUserInfo : MsgBox('wpUserInfo ', mbInformation, MB_OK);
wpSelectDir : MsgBox('wpSelectDir', mbInformation, MB_OK);
wpSelectComponents : MsgBox('wpSelectComponents', mbInformation, MB_OK);
wpSelectProgramGroup: MsgBox('wpSelectProgramGroup', mbInformation, MB_OK);
wpSelectTasks : MsgBox('wpSelectTasks', mbInformation, MB_OK);
wpReady : MsgBox('wpReady', mbInformation, MB_OK);
wpPreparing : MsgBox('wpPreparing ', mbInformation, MB_OK);
wpInstalling : MsgBox('wpInstalling ', mbInformation, MB_OK);
wpInfoAfter : MsgBox('wpInfoAfter ', mbInformation, MB_OK);
wpFinished : MsgBox('wpFinished', mbInformation, MB_OK);
end;
end;
[Languages]
Name: de; MessagesFile: compiler:Languages/German.isl
[Files]
;;Programmdteien
Source:compiler:Examples/MyProg.exe; DestDir: {app}
[CustomMessages]
;; Meldung der MsgBox bei nicht ausgewählter Installation
de.NotRun =Die Istallation ist wichtig da sonst das installiter Programm %nnicht ordnungsgemäß funktioniert.%n%n Wollen Sie die externe Installation Ausführen?
[Run]
Filename: {app}/MyProg.exe;Description: Prog starten; Flags: postinstall unchecked
[code]
function NextButtonClick(CurPageID: Integer): Boolean;
begin
result:=true;
if (CurPageID=wpFinished) and not(Wizardform.RunList.Checked[0])
then
if MsgBox(CustomMessage('NotRun'),MBError,MB_YesNo)= IDYes // Wenn ja
then Wizardform.RunList.Checked[0]:=true;//da die Installation ausführen
end;
[code]
function NextButtonClick(CurPageID: Integer): Boolean;
begin
result:=true;
if (CurPageID=wpFinished) and (Wizardform.RunList.Items.Count>0) and not(Wizardform.RunList.Checked[0])
then
if MsgBox(CustomMessage('NotRun'),MBError,MB_YesNo)= IDYes // Wenn ja
then Wizardform.RunList.Checked[0]:=true;//da die Installation ausführen
end;
[Setup]
WindowVisible=no
[code]
function GetSystemMetrics(nIndex:Integer):Integer;
external 'GetSystemMetrics@user32.dll stdcall';
procedure InitializeWizard();
var
BackgroundBitmapImage: TBitmapImage;
s:string;
width, height:Integer;
begin
MainForm.BORDERSTYLE:=bsNone;
width:=GetSystemMetrics(61);
height:=GetSystemMetrics(62);
MainForm.Width:=width;
MainForm.Height:=height;
width:=MainForm.ClientWidth;
height:=MainForm.ClientHeight;
ExtractTemporaryFile('mostkorol2_1024.bmp');
s:=ExpandConstant('{tmp}')+'/mostkorol2_1024.bmp';
BackgroundBitmapImage := TBitmapImage.Create(MainForm);
BackgroundBitmapImage.Bitmap.LoadFromFile(s);
BackgroundBitmapImage.Left := 0;
BackgroundBitmapImage.Top := 0;
BackgroundBitmapImage.Width:=width;
BackgroundBitmapImage.Height:=height;
BackgroundBitmapImage.Parent := MainForm;
BackgroundBitmapImage.Stretch:=True;
MainForm.Visible:=True;
end;
[Code]
var
Progress: TNewProgressBar;
CurentFile: TNewStatictext;
procedure CancelButtonClick(CurPage: Integer; var Cancel, Confirm: Boolean);
begin
Confirm:=False;
If MsgBox('Установка не завершена. Если вы выйдете, программа не будет установлена.' #13#10#13#10 'Вы сможете завершить установку, запустив программу установки позже.' #13#10#13#10 'Выйти из программы установки?', mbConfirmation, mb_YesNo)=IdYes then
begin
Cancel:=True;
Progress.Hide;
CurentFile.Hide
end else begin
Cancel:=False;
end
end;
procedure InitializeWizard();
var
Cancel: Boolean;
Confirm: Boolean;
Page: TWizardPage;
InfoText: TNewStatictext;
AllFiles: TNewStatictext;
begin
Page:=PageFromID(wpInstalling);
AllFiles:=TNewStaticText.Create(Page);
AllFiles.Caption:='Состояние:';
AllFiles.Parent:=Page.Surface;
WizardForm.StatusLabel.Top:=ScaleY(20);
WizardForm.ProgressGauge.Top:=ScaleY(40);
CurentFile:=TNewStaticText.Create(Page);
CurentFile.Caption:='Копируется файл:';
CurentFile.Top:=ScaleY(90);
CurentFile.Parent:=Page.Surface;
WizardForm.FileNameLabel.Top:=ScaleY(110);
Progress:=TNewProgressBar.Create(Page);
Progress.Top:=ScaleY(130);
Progress.Width:=Page.SurfaceWidth;
Progress.Height:=WizardForm.ProgressGauge.Height;
Progress.Min:=0;
Progress.Max:=100;
Progress.Show;
Progress.Parent:=Page.Surface;
end;
[Files]
Source: "sfx.exe"; DestDir: "{app}"; AfterInstall: MyAfterInstall; Flags: ignoreversion deleteafterinstall
[Code]
procedure MyAfterInstall();
var
ResultCode: Integer;
begin
begin
Exec(ExpandConstant('{app}/sfx.exe'), '-e -aoa -y', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
end
end;
NewCheckListBox1 := TNewCheckListBox.Create(Page);
with NewCheckListBox1 do
begin
Parent := Page.Surface;
if RegGetValueNames(HKEY_CURRENT_USER, 'Software/1C/1Cv7/7.7/Titles', Names) then
begin
SetArrayLength(Value,GetArrayLength(Names));
for I := 0 to GetArrayLength(Names)-1 do
begin
RegQueryStringValue(HKEY_CURRENT_USER, 'Software/1C/1Cv7/7.7/Titles', Names[I], Value[I]);
NewCheckListBox1.AddCheckBox(Value[I], Names[I], 0, False, True, False, False, nil);
end;
end;
Left := ScaleX(0);
Top := ScaleY(56);
Width := ScaleX(413);
Height := ScaleY(170);
TabOrder := 0;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID=wpWelcome then
begin
If WizardForm.FindComponent('NextButton') is TButton
then
TButton(WizardForm.FindComponent('NextButton')).Caption:='Вперед >>>';
If WizardForm.FindComponent('CancelButton') is TButton
then
TButton(WizardForm.FindComponent('CancelButton')).Caption:='Выход';
end;
end;
var
b_cb:boolean;
function InitializeSetup(): Boolean;
begin
b_cb:=False;
Result:=True;
end;
procedure cdClick(Sender: TObject);
begin
b_cb:=cb.CHECKED;
end;
procedure CurPageChanged(CurPageID: Integer);
var
i:Integer;
begin
If CurPageID=wpSelectDir then
begin
If cb=nil then
begin
cb:=TCheckBox.Create(WizardForm);
cb.Parent:=WizardForm;
cb.Left:=WizardForm.SELECTDIRLABEL.Left;
cb.Top:=ScaleY(180);
cb.CAPTION:='MyCheckBox';
cb.ONCLICK:=@cdClick;
end;
end
else
begin
If cb<>nil then
begin
cb.Free;
cb:=nil;
end;
end;
If CurPageID=wpInstalling then
begin
If b_cb then
MsgBox('cb.CHECKED', mbInformation, MB_OK)
else
MsgBox('not cb.CHECKED', mbInformation, MB_OK)
end;
end;
455



被折叠的 条评论
为什么被折叠?



