2013-01-11 12 views

回答

1

我发现简单和工作的解决方案。而不是添加额外的按钮来避免验证空路径。我刚刚添加了默认的dir创建。在[Dirs]部分。

[Dirs] 
Name: {code:WrkGetWorkingDir}; Flags: uninsneveruninstall 

我的应用程序可以接受工作目录cmdline arg或创建默认的一个,如果它没有指定。所以。我只是总是指定该cmdline参数并在安装脚本中创建该默认目录(如果用户没有更改该路径)。

1

你是否检查了INNO帮助,在这里你看到的TInputDirWizardPage

TInputDirWizardPage = class(TWizardPage) 
    function Add(const APrompt: String): Integer; 
    property Buttons[Index: Integer]: TNewButton; read; 
    property Edits[Index: Integer]: TEdit; read; 
    property PromptLabels[Index: Integer]: TNewStaticText; read; 
    property SubCaptionLabel: TNewStaticText; read; 
    property Values[Index: Integer]: String; read write; 
end; 

可用的功能我用这样的方式只有当我需要在页面上的文本输入。我建议你创建一个完整的自定义WizardPage,并且你更加灵活。为了创建页面,您可以使用设计器,我使用InnoSetup Form Designer创建了所有自定义页面。在这里你可以看到它在行动http://www.cenadep.org/2012/02/09/innosetup-form-designer/

0

希望这将有助于

procedure OnClickMyButton(Sender: TObject); 
begin 
MsgBox('OnClickMyButton', mbInformation, MB_OK); 
end; 
procedure CurPageChanged(CurPageID: Integer); 
begin 

     if CurPageID = YourPageID.ID then 
     begin 
      MyButton := TButton.Create(YourPageID); 
      MyButton.Parent := YourPageID.Buttons[0].Parent; 
      MyButton.Top := YourPageID.Edits[0].Top + YourPageID.Edits[0].Height + 10; 
      MyButton.Left := YourPageID.Edits[0].Left; 
      MyButton.Width := 100; 
      MyButton.Caption := 'My Custom Button'; 
      MyButton.OnClick := @OnClickMyButton;   
     end; 
end; 
相关问题