AntonOVS
Junior Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору [Setup] AppName=My Application AppVersion=1.5 DefaultDirName={pf}\My Application [code] var ShotCheckBox: TNewCheckBox; procedure InitializeWizard(); begin ShotCheckBox := TNewCheckBox.Create(WizardForm); with ShotCheckBox do begin Parent := WizardForm.InstallingPage; SetBounds(ScaleX(0),ScaleY(65),ScaleX(225),ScaleY(15)); Caption := 'Выключить компьютер после установки'; Checked := true; end; end; procedure CurPageChanged(CurPageID: Integer); var res : integer; begin if CurPageID=wpFinished then begin if ShotCheckBox.Checked then begin ShellExec('','shutdown','-s','{win}\System32\',SW_SHOW,ewNoWait,res); WizardForm.NextButton.OnClick(nil); end; end; end; |