2011-11-09 15 views
4

私はインストーラを作成する際に新しいです。Innoセットアップベースのインストーラで自分のフォームやページを作成するにはどうしたらいいですか?

  1. ドメイン
  2. ユーザー名
  3. ユーザーパスワード

し、レジストリに保存する:私は3つのテキストボックスにフォームを作成する必要があります。私はすでにデータをレジストリに保存する方法を知っていました。

答えて

7

Innoには、ウィザードフローでカスタムページを作成できる柔軟なダイアログ/ページエンジンがあります。これを行う方法の良い例については、Innoインストールに付属のCodeDlg.iss exampleを参照してください。

+0

ありがとうございました。 – andDaviD

3
[Code] 
var 
lblDomain: TLabel; 
lblUserName: TLabel; 
lblPassword: TLabel; 
txtDomain: TEdit; 
txtUserName: TEdit; 
txtUserPassword: TPasswordEdit; 

procedure frmDomainReg_Activate(Page: TWizardPage); 
begin 
end; 

function frmDomainReg_ShouldSkipPage(Page: TWizardPage): Boolean; 
begin 
Result := False; 
end; 

function frmDomainReg_BackButtonClick(Page: TWizardPage): Boolean; 
begin 
Result := True; 
end; 

function frmDomainReg_NextButtonClick(Page: TWizardPage): Boolean; 
begin 
Result := True; 
end; 

procedure frmDomainReg_CancelButtonClick(Page: TWizardPage; var Cancel, Confirm: Boolean); 
begin 
end; 

function frmDomainReg_CreatePage(PreviousPageId: Integer): Integer; 
var 
Page: TWizardPage; 
begin 
Page := CreateCustomPage(
PreviousPageId, 
'Domain Registration', 
'Enter Domain Registration Data' 
); 

{ lblDomain } 
lblDomain := TLabel.Create(Page); 
with lblDomain do 
begin 
Parent := Page.Surface; 
Left := ScaleX(24); 
Top := ScaleY(24); 
Width := ScaleX(35); 
Height := ScaleY(13); 
Caption := 'Domain'; 
end; 

{ lblUserName } 
lblUserName := TLabel.Create(Page); 
with lblUserName do 
begin 
Parent := Page.Surface; 
Left := ScaleX(24); 
Top := ScaleY(56); 
Width := ScaleX(52); 
Height := ScaleY(13); 
Caption := 'User Name'; 
end; 

{ lblPassword } 
lblPassword := TLabel.Create(Page); 
with lblPassword do 
begin 
Parent := Page.Surface; 
Left := ScaleX(24); 
Top := ScaleY(88); 
Width := ScaleX(46); 
Height := ScaleY(13); 
Caption := 'Password'; 
end; 

{ txtDomain } 
txtDomain := TEdit.Create(Page); 
with txtDomain do 
begin 
Parent := Page.Surface; 
Left := ScaleX(120); 
Top := ScaleY(16); 
Width := ScaleX(185); 
Height := ScaleY(21); 
TabOrder := 0; 
end; 

{ txtUserName } 
txtUserName := TEdit.Create(Page); 
with txtUserName do 
begin 
Parent := Page.Surface; 
Left := ScaleX(120); 
Top := ScaleY(48); 
Width := ScaleX(185); 
Height := ScaleY(21); 
TabOrder := 1; 
end; 

{ txtUserPassword } 
txtUserPassword := TPasswordEdit.Create(Page); 
with txtUserPassword do 
begin 
Parent := Page.Surface; 
Left := ScaleX(120); 
Top := ScaleY(80); 
Width := ScaleX(185); 
Height := ScaleY(21); 
TabOrder := 2; 
end; 


with Page do 
begin 
OnActivate := @frmDomainReg_Activate; 
OnShouldSkipPage := @frmDomainReg_ShouldSkipPage; 
OnBackButtonClick := @frmDomainReg_BackButtonClick; 
OnNextButtonClick := @frmDomainReg_NextButtonClick; 
OnCancelButtonClick := @frmDomainReg_CancelButtonClick; 
end; 

Result := Page.ID; 
end; 

procedure InitializeWizard(); 
begin 
{this page will come after welcome page} 
frmDomainReg_CreatePage(wpWelcome); 
end; 
+2

コードを完全にダンプするのではなく、少し記述してください。 – NREZ

関連する問題