VendettaDeToli
Junior Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Код: [Code] var ResultCode:Integer; ResultReg:string; procedure CurPageChanged(CurPageID:Integer); begin if CurPageID=wpWelcome then begin if RegValueExists(HKEY_LOCAL_MACHINE, 'Software\RanetkiLive','InstallPath') then If WizardForm.FindComponent('NextButton') is TButton then TButton(WizardForm.FindComponent('NextButton')).Caption:='Играть'; end; end; function NextButtonClick(CurPageID: Integer): Boolean; begin if RegValueExists(HKEY_LOCAL_MACHINE, 'Software\RanetkiLive','InstallPath') then begin RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\RanetkiLive','InstallPath', ResultReg) Result:=False; Exec(ResultReg+'\Ranetki.exe', '', '', SW_SHOW,ewNoWait, ResultCode) WizardForm.Close; end else Result:=True; end; procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean); begin Cancel:=True; if CurPageID=wpWelcome then begin if RegValueExists(HKEY_LOCAL_MACHINE, 'Software\RanetkiLive','InstallPath') then Confirm:=False; end; end; //P.S. Только есть одна проблема - если пользователь удалит игру не через деинсталлятор, а вручную, то потом он её не сможет установить из-за ветки в реестре. | |