当前位置: 首页 > 工具软件 > Inno Extract > 使用案例 >

inno setup InitializeWizard初始化向导学习(三)

孔茂
2023-12-01

释放图片到临时目录:

[Files]
Source: "tmp\*"; DestDir: {tmp}; Flags: dontcopy solidbreak;

//释放需要的临时资源文件
PROCEDURE extract_temp_files();
BEGIN
  ExtractTemporaryFile('button_customize_setup.png');
  ExtractTemporaryFile('button_uncustomize_setup.png');
  ExtractTemporaryFile('button_finish.png');
  ExtractTemporaryFile('button_setup_or_next.png');
  ExtractTemporaryFile('background_welcome.png');
  ExtractTemporaryFile('background_welcome_more.png');
  ExtractTemporaryFile('button_browse.png');
  ExtractTemporaryFile('progressbar_background.png');
  ExtractTemporaryFile('progressbar_foreground.png');
  ExtractTemporaryFile('button_license.png');
  ExtractTemporaryFile('checkbox_license.png');
  ExtractTemporaryFile('checkbox_setdefault.png');
  ExtractTemporaryFile('background_installing.png');
  ExtractTemporaryFile('background_finish.png');
  ExtractTemporaryFile('button_close.png');
  ExtractTemporaryFile('button_minimize.png');
  ExtractTemporaryFile('background_messagebox.png');
  ExtractTemporaryFile('button_cancel.png');
  ExtractTemporaryFile('button_ok.png');
END;

//主界面关闭按钮按下时执行的脚本
PROCEDURE button_close_on_click(hBtn : HWND);
BEGIN
  WizardForm.CancelButton.OnClick(WizardForm);
END;


procedure InitializeWizard();//初始化安装向导界面
begin
  //释放临时资源文件
  extract_temp_files();

  WizardForm.InnerNotebook.Hide();
  WizardForm.OuterNotebook.Hide();
  WizardForm.Bevel.Hide();
  //初始界面为空白
  WITH WizardForm DO
  BEGIN
    BorderStyle := bsNone;
    Position := poDesktopCenter;
    Width := WIZARDFORM_WIDTH_NORMAL;
    Height := WIZARDFORM_HEIGHT_MORE;
    Color := clWhite;
    NextButton.Height := 0;
    CancelButton.Height := 0;
    BackButton.Visible := FALSE;
  END;

  ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\background_welcome.png'),0,0,650,450,false,true);
  button_close := BtnCreate(WizardForm.Handle, 570, 0, 30, 30, ExpandConstant('{tmp}\button_close.png'), 0, FALSE);
  BtnSetEvent(button_close, ID_BUTTON_ON_CLICK_EVENT, WrapBtnCallback(@button_close_on_click, 1));


  ImgApplyChanges(WizardForm.Handle);
end;

//安装程序销毁时会调用这个函数
PROCEDURE DeinitializeSetup();
BEGIN
  gdipShutdown();
  WizardForm.Release();
END;

 类似资料: