使用WizardForm.CancelButton.Visible:= false让某些向导页的“取消”按钮不可见,但是窗口上的X关闭按钮也失效了,请教各位大神这是怎么回事呢?
怎样才能让“取消”按钮不可见,但是窗口上的关闭按钮仍然起作用?
代码
#define MyAppName "test"
#define MyAppVersion "1.5"
#define MyAppPublisher "我的公司"
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "MyProg.exe"
[Setup]
; 注意: AppId 的值是唯一识别这个程序的标志。
; 不要在其他程序中使用相同的 AppId 值。
; (在编译器中点击菜单“工具 -> 产生 GUID”可以产生一个新的 GUID)
AppId={{E3AA4F91-0B15-4164-980C-ED02B88B81AE}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\我的程序
DefaultGroupName=我的程序
DisableProgramGroupPage=yes
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "D:\Program Files (x86)\Inno Setup 5\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion
; 注意: 不要在任何共享的系统文件使用 "Flags: ignoreversion"
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
[Code]
procedure CurPageChanged(CurPageID: Integer);
begin
Case CurPageID of
wpWelcome :
begin
WizardForm.NextButton.Caption:= '继 续';
WizardForm.CancelButton.Visible:= false;
end;
wpSelectDir: // 选择目录页面
begin
WizardForm.BackButton.Visible:= false;
WizardForm.NextButton.Caption:= '安 装';
WizardForm.CancelButton.Visible:= false;
end;
end;
end;