|
|
第一次 用Inno Setup 不懂 希望 大大 没能 帮忙 新手有关 Inno Setup 打包后 如何在完成页面 在完成页面添加 设置 百度网址为主页和在完成页面 添加一些文字及网址连接 在第2个页面上 添加一些 选项 安装程序的一些选项 附送 原代码 这代码不是我写的 - [Setup]
- AppId={{FBDFDB8E-04D7-4CDB-8ADE-F002ECDEB6D7}
- AppName=0
- AppVersion=0.0.0.0
- AppVerName=0
- AppPublisher=0
- DefaultDirName={pf}\55555
- DefaultGroupName=333
- AllowNoIcons=yes
- OutputDir=D:\
- OutputBaseFilename=11111111111111
- SetupIconFile=D:\01.ico
- Compression=lzma/ultra64
- SolidCompression=yes
- VersionInfoVersion=0.0.0.0
- VersionInfoTextVersion=0.0.0.0
- VersionInfoCompany=2222222222
- VersionInfoDescription=111111111
- DisableReadyPage=yes
- DisableProgramGroupPage=yes
- InternalCompressLevel=ultra64
- DirExistsWarning=no
- [Messages]
- SetupAppTitle=鱼
- DiskSpaceMBLabel=所需空间: [mb] MB
- ButtonBack=上一步(&P)
- ButtonNext=下一步(&N)
- [CustomMessages]
- SetupWindowTitle=----By:3只鱼
- WelcomePage=....................
- SelectDirPage=......嘿嘿.....
- InstallingPage=正在安装
- FinishedPage=....................
- FinishedHeadingLabel=安装向导完成
- [Dirs]
- Name: {pf}\InnoSetup Installation Information; Attribs: hidden
- [Languages]
- Name: "chinesesimp"; MessagesFile: "compiler:Languages\ChineseSimp.isl"
- [Files]
- Source: ISSkin.dll; DestDir: {tmp}; Flags: dontcopy solidbreak;
- Source: BlackLite.cjstyles; DestDir: {tmp}; Flags: dontcopy solidbreak;
- Source: 欢迎.bmp; DestDir: {tmp}; Flags: dontcopy solidbreak;
- Source: 选项.bmp; DestDir: {tmp}; Flags: dontcopy solidbreak;
- Source: 安装.bmp; DestDir: {tmp}; Flags: dontcopy solidbreak;
- Source: 完成.bmp; DestDir: {tmp}; Flags: dontcopy solidbreak;
- Source: Close1.bmp; Flags: dontcopy solidbreak
- Source: Close2.bmp; Flags: dontcopy solidbreak
- Source: Close3.bmp; Flags: dontcopy solidbreak
- Source: license.txt; DestDir: {tmp}; Flags: dontcopy solidbreak;
- Source: "D:\music.mp3"; Flags: dontcopy
- Source: "D:\NSISADDIN\callnsis.dll"; DestDir: "{tmp}"; Flags: dontcopy
- Source: "D:\NSISADDIN\NewAdvSplash.dll"; DestDir: "{tmp}"; Flags: dontcopy
- Source: "D:\NSISADDIN\splash.gif"; DestDir: "{tmp}"; Flags: dontcopy
- [Files]
- Source: "D:\Users\Administrator\Desktop\03.exe"; DestDir: "{app}"; Flags: ignoreversion
- [code]
- Const
- //动画
- AW_Hor_Positive = $1;
- AW_Hor_Negative = $2;
- AW_Ver_Positive = $4;
- AW_Ver_Negative = $8;
- AW_Center = $10;
- AW_Hide = $10000;
- AW_Activate = $20000;
- AW_Slide = $40000;
- AW_Blend = $80000;
- //透明
- TransparentColor = clLime; //要去掉的图片底色
- TransparentPercent = 80;
- WS_EX_LAYERED = $80000;
- WS_EX_TRANSPARENT = $20;
- LWA_COLORKEY = 1;
- LWA_ALPHA = 2;
- GWL_EXSTYLE = (-20);
- WM_SYSCOMMAND = $0112;
- //动画
- function AnimateWindow(hWnd: HWND; dwTime: DWORD; dwFlags: DWORD): BOOL;
- external 'AnimateWindow@user32 stdcall';
- //透明
- function SetLayeredWindowAttributes(hwnd: HWND; crKey: TColor; bAlpha: BYTE; dwFlags: DWORD): Boolean; external 'SetLayeredWindowAttributes@user32.dll stdcall';
- function GetWindowLong(Wnd: HWnd; Index: Integer): Longint; external 'GetWindowLong{#A}@user32.dll stdcall';
- function SetWindowLong(Wnd: HWnd; Index: Integer; NewLong: Longint): Longint; external 'SetWindowLong{#A}@user32.dll stdcall';
- function ReleaseCapture(): Longint; external 'ReleaseCapture@user32.dll stdcall';
- //皮肤
- procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
- external 'LoadSkin@files:isskin.dll stdcall';
- procedure UnloadSkin();
- external 'UnloadSkin@files:isskin.dll stdcall';
- function ShowWindow(hWnd: Integer; uType: Integer): Integer;
- external 'ShowWindow@user32.dll stdcall';
- var
- SetupWindowlabel: Tlabel; //标题文字
- underlabel: Tlabel; //底部文字
- licenseCheckBox: TCheckBox; //协议选框
- TaskBox1,TaskBox2,TaskBox3,RunBox1,RunBox2,RunBox3,RunBox4: TCheckBox; //创建目录页面选框和新页面复选框
- TaskBox1Label,TaskBox2Label,TaskBox3Label,TaskBox4Label,TaskBox5Label,TaskBox6Label,NewLabel,NewStatusLabel,FinishedLabel3,FinishedLabel4,RunBox1Label,RunBox2Label,RunBox3Label,RunBox4Label: TLabel; //请选择安装目录
- //可用空间
- freespacelabel: TLabel;
- FreeMB, TotalMB: Cardinal;
- //所需空间
- NewDiskSpaceLabel: Tlabel;
- //欢迎协议
- licenseLabel1,licenseCheckBoxlabel: TLabel;
- Notice: TRichEditViewer;
- //关闭按钮
- CloseBtn: TBitmapImage;
- //安装百分比
- ProgressLabel: TLabel;
- //可用空间
- function ProperFormat(FreeMB: Cardinal): string;
- begin
- if FreeMB >= 1024 then
- Result:= Format('可用空间: %d.%d GB', [Trunc(FreeMB/1024), Round((FreeMB/1024-Trunc(FreeMB/1024))*10)])
- else
- Result:= '可用空间: ' + IntToStr(FreeMB) + ' MB';
- end;
- procedure UpdateFreeSpaceOnDisk(Sender: TObject);
- begin
- if GetSpaceOnDisk(ExtractFileDrive(WizardForm.DirEdit.Text), True, FreeMB, TotalMB) then
- freespacelabel.Caption:= ProperFormat(FreeMB)
- else
- freespacelabel.Caption:= '可用空间: 0 MB';
- end;
- //单击“取消”直接退出
- procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
- begin
- Confirm := False;
- end;
- //关闭按钮
- procedure CloseBtnOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X: Integer; Y: Integer);
- begin
- CloseBtn.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Close3.bmp'));
- end;
- procedure CloseBtnOnMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X: Integer; Y: Integer);
- begin
- CloseBtn.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Close2.bmp'));
- end;
- procedure CloseBtnOnMouseEnter(Sender: TObject);
- begin
- CloseBtn.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Close2.bmp'))
- end;
- procedure CloseBtnOnMouseLeave(Sender: TObject);
- begin
- CloseBtn.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Close1.bmp'));
- end;
- procedure CloseBtnOnClick(Sender: TObject);
- begin
- WizardForm.Close;
- end;
- //协议选框
- procedure licenseCheckBoxClick(Sender: TObject);
- begin
- WizardForm.NextButton.Enabled := licenseCheckBox.Checked;
- end;
- procedure licenseCheckBoxlabelOnClick(Sender: TObject);
- begin
- if licenseCheckBox.Checked = False then
- licenseCheckBox.Checked := True
- else
- licenseCheckBox.Checked := False;
- end;
- procedure WizardFormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
- begin
- ReleaseCapture
- SendMessage(WizardForm.Handle, WM_SYSCOMMAND, $F012, 0)
- end;
- var
- WizardFormImage: TBitmapImage;
- Type
- HSAMPLE = DWORD;
- HCHANNEL = DWORD;
- var
- MusicSwitchLabel0, MusicSwitchLabel1, MusicSwitchLabel2: TNewStaticText;
- sample: HSAMPLE;
- channel: HCHANNEL;
- // 以下是所调用的插件函数
- procedure callplug(parentwnd: Integer; pluginname,funcname,param1,param2,param3,param4,param5,param6,param7,param8,param9,param10: PChar);
- external 'callplug@files:callnsis.dll stdcall delayload';
- procedure URLLabelOnClick(Sender: TObject);
- var
- ErrorCode: Integer;
- begin
- ShellExec('open', 'http://www.baidu.com', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
- end;
- procedure AboutButtonOnClick(Sender: TObject);
- begin
- MsgBox(#13 '谢谢大家的支持哦' #13 #13'温馨提醒.有风险.请慎重!' #13#13 'By:3只鱼', mbInformation, MB_OK);
- end;
- var
- BGMusicFile, SplashFile: string;
- SplashForm: TForm;
- SplashFileName: String;
- I: Integer;
- AboutButton, CancelButton: TButton;
- URLLabel: TNewStaticText;
- Function mciSendString(lpszCommand: String; lpszReturnString: Integer; cchReturnLength: Integer; hwndCallback: Integer): Integer;
- external 'mciSendStringA@winmm.dll stdcall';
- procedure InitializeWizard();
- begin
- { Create the pages }
- WizardForm.PAGENAMELABEL.Font.Color:= clred;
- WizardForm.PAGEDESCRIPTIONLABEL.Font.Color:= clBlue;
- WizardForm.WELCOMELABEL1.Font.Color:= clGreen;
- WizardForm.WELCOMELABEL2.Font.Color:= clblack;
- CancelButton := WizardForm.CancelButton;
- AboutButton := TButton.Create(WizardForm);
- AboutButton.Left := 20;
- AboutButton.Top := 372;
- AboutButton.Width := ScaleX(55);
- AboutButton.Height := ScaleY(22);
- AboutButton.Caption := '&关于';
- AboutButton.OnClick := @AboutButtonOnClick;
- AboutButton.Parent := WizardForm;
- URLLabel := TNewStaticText.Create(WizardForm);
- URLLabel.Caption := '谢谢支持';
- URLLabel.Cursor := crHand;
- URLLabel.OnClick := @URLLabelOnClick;
- URLLabel.Parent := WizardForm;
- { Alter Font *after* setting Parent so the correct defaults are inherited first }
- URLLabel.Font.Style := URLLabel.Font.Style + [fsUnderline];
- URLLabel.Font.Color := clBlue;
- URLLabel.Top := AboutButton.Top + AboutButton.Height - URLLabel.Height - 2;
- URLLabel.Left := AboutButton.Left + AboutButton.Width + ScaleX(20);
- WizardForm.LICENSEACCEPTEDRADIO.Checked := true;
- // 释放临时文件
- ExtractTemporaryFile('CallNSIS.DLL');
- ExtractTemporaryFile('NewAdvSplash.DLL');
- ExtractTemporaryFile('splash.gif');
- BGMusicFile := ExpandConstant('{tmp}\mymusic.mp3');
- SplashFile := ExpandConstant('{tmp}\splash.gif');
- // 闪屏:显示时间 1600、淡入 800、淡出 500、透明颜色 -2 (表示 gif 图像本身透明)
- callplug(0,ExpandConstant('{tmp}\NewAdvSplash.dll'),'show','3000','800','500','-2',SplashFile,'','','','','');
- begin
- ExtractTemporaryFile(ExtractFileName(ExpandConstant('{tmp}\music.mp3')));
- SplashForm := TForm.create(nil);
- with SplashForm do
- begin
- mciSendString(ExpandConstant('play {tmp}\music.mp3'),0,0,0);
- Close;
- Free;
- end;
- end;
- WizardForm.BorderStyle:=bsNone; //去标题框
- WizardForm.ClientWidth:=540
- WizardForm.ClientHeight:=400
- ExtractTemporaryFile('欢迎.bmp');
- ExtractTemporaryFile('选项.bmp');
- ExtractTemporaryFile('安装.bmp');
- ExtractTemporaryFile('完成.bmp');
- ExtractTemporaryFile('Close1.bmp');
- ExtractTemporaryFile('Close2.bmp');
- ExtractTemporaryFile('Close3.bmp');
- WizardFormImage := TBitmapImage.Create(WizardForm);
- WizardFormImage.Parent := WizardForm;
- WizardFormImage.Align := alClient; //图片拉伸
- //WizardFormImage.SendToBack; //显示底部横线
- WizardFormImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\欢迎.bmp'))
- WizardFormImage.OnMouseDown:=@WizardFormMouseDown;
- SetWindowLong(WizardForm.Handle, GWL_EXSTYLE, GetWindowLong(WizardForm.Handle, GWL_EXSTYLE) or WS_EX_LAYERED)
- SetLayeredWindowAttributes(WizardForm.Handle, TransparentColor,(255 * TransparentPercent) / 100, LWA_COLORKEY)
- //标题文字
- SetupWindowlabel := TLabel.Create(WizardForm);
- SetupWindowlabel.Parent := WizardForm;
- SetupWindowlabel.Caption := ExpandConstant('{cm:SetupWindowTitle}'); //控件文字 '#13'
- SetupWindowlabel.Font.Name := '宋体';
- SetupWindowlabel.Font.Size := 9
- SetupWindowlabel.Font.Color := clblack;
- SetupWindowlabel.Font.Style := [fsBold]
- SetupWindowlabel.Transparent := True;
- SetupWindowlabel.AutoSize := False;
- SetupWindowlabel.WordWrap := True;
- SetupWindowlabel.Left := ScaleX(10);
- SetupWindowlabel.Top := ScaleY(10);
- SetupWindowlabel.Width := WizardForm.Width;
- SetupWindowlabel.Height := ScaleY(14);
- SetupWindowlabel.OnMouseDown:=@WizardFormMouseDown;
- //底部文字
- underlabel := TLabel.Create(WizardForm);
- underlabel.Parent := WizardForm;
- underlabel.Font.Name := '宋体';
- underlabel.Font.Size := 9
- underlabel.Font.Color := clblack;
- underlabel.Font.Style := []
- underlabel.Transparent := True;
- underlabel.AutoSize := False;
- underlabel.WordWrap := True;
- underlabel.Left := ScaleX(10);
- underlabel.Top := ScaleY(362);
- underlabel.Width := WizardForm.Width;
- underlabel.Height := ScaleY(14);
- underlabel.OnMouseDown:=@WizardFormMouseDown;
- //关闭按钮
- CloseBtn := TBitmapImage.Create(WizardForm);
- CloseBtn.ShowHint := True;
- CloseBtn.Cursor := crHand;
- CloseBtn.OnMouseDown := @CloseBtnOnMouseDown;
- CloseBtn.OnMouseUp := @CloseBtnOnMouseUp;
- CloseBtn.OnMouseEnter := @CloseBtnOnMouseEnter;
- CloseBtn.OnMouseLeave := @CloseBtnOnMouseLeave;
- CloseBtn.Parent := WizardForm;
- CloseBtn.Width := 39
- CloseBtn.Height := 20
- CloseBtn.Left := WizardForm.Width - CloseBtn.Width;
- CloseBtn.Top := 0
- CloseBtn.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Close1.bmp'));
- CloseBtn.OnClick:= @CloseBtnOnClick;
- //WizardForm
- WizardForm.OuterNotebook.Hide;
- WizardForm.BeveledLabel.Width := 0
- WizardForm.BeveledLabel.Height := 0
- //CancelButton
- WizardForm.CancelButton.Left:=464
- WizardForm.CancelButton.Top:=371
- WizardForm.CancelButton.Width:=70
- WizardForm.CancelButton.Height:=23
- //BackButton
- WizardForm.BackButton.Left:=317
- WizardForm.BackButton.Top:=WizardForm.CancelButton.Top
- WizardForm.BackButton.Width:=WizardForm.CancelButton.Width
- WizardForm.BackButton.Height:=WizardForm.CancelButton.Height
- //NextButton
- WizardForm.NextButton.Left:=WizardForm.BackButton.Left + WizardForm.BackButton.Width + 1
- WizardForm.NextButton.Top:=WizardForm.CancelButton.Top
- WizardForm.NextButton.Width:=WizardForm.CancelButton.Width
- WizardForm.NextButton.Height:=WizardForm.CancelButton.Height
- //欢迎协议
- licenseLabel1 := TLabel.Create(WizardForm);
- licenseLabel1.Parent := WizardForm; //位置
- licenseLabel1.Caption := '在安装软件前,请仔细阅读许可协议。';
- licenseLabel1.Font.Color := clBlack; //控件文字颜色
- licenseLabel1.Transparent := True; //控件透明显示
- licenseLabel1.Left := 15;
- licenseLabel1.Top := ScaleY(50);
- licenseLabel1.Width := WizardForm.Width - 30;
- //licenseLabel1.Height := ScaleY(13);
- //欢迎协议
- Notice:= TRichEditViewer.Create(WizardForm);
- Notice.Parent := WizardForm;
- Notice.Top:= licenseLabel1.Top + 23;
- Notice.Left:= licenseLabel1.Left;
- Notice.Width:= licenseLabel1.Width;
- Notice.Height:= ScaleY(198);
- Notice.ReadOnly:= true;
- Notice.SCROLLBARS:= ssVertical;
- Notice.Font.Size := 9
- ExtractTemporaryFile('license.txt');
- Notice.Lines.LoadFromFile(ExpandConstant('{tmp}\license.txt'));
- licenseCheckBox := TCheckBox.Create(WizardForm);
- licenseCheckBox.Parent := WizardForm;
- licenseCheckBox.Left := Notice.Left;
- licenseCheckBox.Top := ScaleY(281);
- licenseCheckBox.Width := ScaleX(13);
- licenseCheckBox.Height := ScaleY(13);
- licenseCheckBox.Checked := false
- licenseCheckBox.OnClick := @licenseCheckBoxClick;
- //欢迎协议
- licenseCheckBoxlabel := TLabel.Create(WizardForm);
- licenseCheckBoxlabel.Parent := WizardForm; //位置
- licenseCheckBoxlabel.Caption := '我已阅读并同意软件许可协议';
- licenseCheckBoxlabel.Font.Color := clBlack; //控件文字颜色
- licenseCheckBoxlabel.Transparent := True; //控件透明显示
- licenseCheckBoxlabel.Left := licenseCheckBox.Left + licenseCheckBox.Width + 2;
- licenseCheckBoxlabel.Top := licenseCheckBox.Top + 1;
- licenseCheckBoxlabel.Width := 300;
- licenseCheckBoxlabel.OnClick := @licenseCheckBoxlabelOnClick;
- //NewLabel
- NewLabel := TLabel.Create(WizardForm);
- NewLabel.Parent := WizardForm;
- NewLabel.Font.Name := '宋体';
- NewLabel.Font.Size := 9
- NewLabel.Font.Color := clblack;
- NewLabel.Font.Style := []
- NewLabel.Transparent := True;
- NewLabel.AutoSize := False;
- NewLabel.WordWrap := True;
- NewLabel.Left := ScaleX(20);
- NewLabel.Top := ScaleY(108);
- NewLabel.Width := WizardForm.Width - ScaleX(40);
- NewLabel.Height := ScaleY(14);
- WizardForm.DirEdit.Left:=NewLabel.Left + 55;
- WizardForm.DirEdit.Top:=75
- WizardForm.DirEdit.Width:=WizardForm.Width - 160
- WizardForm.DirEdit.Font.Size := ScaleY(9);
- WizardForm.DirEdit.Font.Name := 'MS Sans Serif';
- WizardForm.DirEdit.Height:=18
- //WizardForm.DirEdit.BringToFront
- WizardForm.DirEdit.Parent := WizardForm;
- //DirBrowseButton
- WizardForm.DirBrowseButton.Left:=WizardForm.DirEdit.Left + WizardForm.DirEdit.Width + 3
- WizardForm.DirBrowseButton.Top:=WizardForm.DirEdit.Top - 1
- WizardForm.DirBrowseButton.Width:=WizardForm.CancelButton.Width
- WizardForm.DirBrowseButton.Height:=WizardForm.CancelButton.Height
- WizardForm.DirBrowseButton.Parent := WizardForm;
- //DiskSpaceLabel
- WizardForm.DiskSpaceLabel.Left:=WizardForm.DirEdit.Left
- WizardForm.DiskSpaceLabel.Top:=WizardForm.DirEdit.Top + 30
- WizardForm.DiskSpaceLabel.Width:=100;
- WizardForm.DiskSpaceLabel.Height:=14
- WizardForm.DiskSpaceLabel.Color := $00F1E0C2; //控件文字颜色
- WizardForm.DiskSpaceLabel.Parent := WizardForm; //位置
- NewDiskSpaceLabel := TLabel.Create(WizardForm);
- NewDiskSpaceLabel.Parent := WizardForm;
- NewDiskSpaceLabel.Transparent := true;
- NewDiskSpaceLabel.Left := WizardForm.DirEdit.Left;
- NewDiskSpaceLabel.Top := WizardForm.DirEdit.Top + 30
- NewDiskSpaceLabel.Width := ScaleX(100);
- NewDiskSpaceLabel.Height := ScaleY(13);
- //DiskSpaceLabel
- WizardForm.DiskSpaceLabel.Left:=WizardForm.DirEdit.Left
- WizardForm.DiskSpaceLabel.Top:=WizardForm.DirEdit.Top + 30
- WizardForm.DiskSpaceLabel.Width:=100;
- WizardForm.DiskSpaceLabel.Height:=14
- WizardForm.DiskSpaceLabel.Color := $00F1E0C2; //控件文字颜色
- WizardForm.DiskSpaceLabel.Parent := WizardForm; //位置
- NewDiskSpaceLabel := TLabel.Create(WizardForm);
- NewDiskSpaceLabel.Parent := WizardForm;
- NewDiskSpaceLabel.Transparent := true;
- NewDiskSpaceLabel.Left := WizardForm.DirEdit.Left;
- NewDiskSpaceLabel.Top := WizardForm.DirEdit.Top + 30
- NewDiskSpaceLabel.Width := ScaleX(100);
- NewDiskSpaceLabel.Height := ScaleY(13);
- //可用空间
- freespacelabel:= TLabel.Create(WizardForm);
- freespacelabel.Parent:= WizardForm;
- freespacelabel.Left:= WizardForm.DiskSpaceLabel.Left + WizardForm.DiskSpaceLabel.Width + 20;
- freespacelabel.Top:= WizardForm.DiskSpaceLabel.Top;
- freespacelabel.Height:= WizardForm.DiskSpaceLabel.Height;
- freespacelabel.Width:= WizardForm.DiskSpaceLabel.Width;
- freespacelabel.Transparent := True; //控件透明显示
- if GetSpaceOnDisk(ExtractFileDrive(WizardDirValue), True, FreeMB, TotalMB) then
- freespacelabel.Caption:= ProperFormat(FreeMB);
- WizardForm.DirEdit.OnChange := @UpdateFreeSpaceOnDisk;
- //ProgressGauge
- WizardForm.ProgressGauge.Left:=0;
- WizardForm.ProgressGauge.Top:=310;
- WizardForm.ProgressGauge.Width:=WizardForm.Width;
- WizardForm.ProgressGauge.Height:=18
- WizardForm.ProgressGauge.Min:=0
- WizardForm.ProgressGauge.Max:=100
- WizardForm.ProgressGauge.Parent := WizardForm;
- //安装百分比
- ProgressLabel := TLabel.Create(WizardForm);
- ProgressLabel.Top := WizardForm.ProgressGauge.Top + 30;
- ProgressLabel.Left:= 80;
- ProgressLabel.AutoSize := True;
- ProgressLabel.Transparent := True;
- ProgressLabel.Parent := WizardForm;
- //皮肤
- ExtractTemporaryFile('BlackLite.cjstyles');
- LoadSkin(ExpandConstant('{tmp}\BlackLite.cjstyles'), 'NORMALBlackLite.INI');
- end;
- function StatusMsg(MyMsg: string): Boolean;
- begin
- Result:= True;
- NewStatusLabel.Caption:= MyMsg;
- end;
- procedure Progress();
- begin
- //安装百分比
- ProgressLabel.Caption:= IntToStr((WizardForm.ProgressGauge.Position-WizardForm.ProgressGauge.Min)/((WizardForm.ProgressGauge.Max - WizardForm.ProgressGauge.Min)/101)) + '%';
- end;
- procedure CurPageChanged(CurPageID: Integer);
- begin
- if CurPageID = wpWelcome then
- begin
- underlabel.Caption := ExpandConstant('{cm:WelcomePage}'); //控件文字 '#13'
- WizardFormImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\欢迎.bmp'))
- Wizardform.NextButton.Enabled:= licenseCheckBox.Checked;
- licenseCheckBox.show
- licenseLabel1.Show
- Notice.show
- licenseCheckBoxlabel.show
- NewLabel.hide
- WizardForm.DirEdit.hide
- WizardForm.DirBrowseButton.hide
- WizardForm.DiskSpaceLabel.hide
- NewDiskSpaceLabel.hide
- freespacelabel.hide
- WizardForm.ProgressGauge.hide
- end;
- if CurPageID = wpSelectDir then
- begin
- underlabel.Caption := ExpandConstant('{cm:SelectDirPage}'); //控件文字 '#13'
- WizardFormImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\选项.bmp'))
- licenseLabel1.hide
- Notice.hide
- licenseCheckBox.hide
- licenseCheckBoxlabel.hide
- NewLabel.hide
- WizardForm.DirEdit.show
- WizardForm.DirBrowseButton.show
- WizardForm.DiskSpaceLabel.hide
- NewDiskSpaceLabel.show
- NewDiskSpaceLabel.Caption := WizardForm.DiskSpaceLabel.Caption;
- freespacelabel.show
- WizardForm.ProgressGauge.hide
- WizardForm.NextButton.Caption := '安装(&I)'
- end;
- if CurPageID = wpSelectComponents then
- begin
- licenseCheckBox.hide
- licenseCheckBoxlabel.hide
- NewLabel.show
- WizardForm.DirEdit.hide
- WizardForm.DirBrowseButton.hide
- WizardForm.DiskSpaceLabel.hide
- NewDiskSpaceLabel.hide
- freespacelabel.hide
- WizardForm.ProgressGauge.hide
- end;
- if CurPageID = wpInstalling then
- begin
- underlabel.Caption := ExpandConstant('{cm:InstallingPage}'); //控件文字 '#13'
- WizardFormImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\安装.bmp'))
- licenseCheckBox.hide
- licenseCheckBoxlabel.hide
- NewLabel.hide
- WizardForm.DirEdit.hide
- WizardForm.DirBrowseButton.hide
- WizardForm.DiskSpaceLabel.hide
- NewDiskSpaceLabel.hide
- freespacelabel.hide
- WizardForm.ProgressGauge.show
- end;
- if CurPageID = wpFinished then
- begin
- underlabel.Caption := ExpandConstant('{cm:FinishedPage}'); //控件文字 '#13'
- WizardFormImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\完成.bmp'))
- licenseCheckBox.hide
- licenseCheckBoxlabel.hide
- NewLabel.hide
- WizardForm.DirEdit.hide
- WizardForm.DirBrowseButton.hide
- WizardForm.DiskSpaceLabel.hide
- NewDiskSpaceLabel.hide
- freespacelabel.hide
- ProgressLabel.hide
- WizardForm.ProgressGauge.hide
- WizardForm.NextButton.Left := WizardForm.CancelButton.Left
- end;
- end;
- procedure DeinitializeSetup();
- begin
- AnimateWindow(StrToInt(ExpandConstant('{wizardhwnd}')),500,AW_Center + AW_Hor_Positive + AW_Hide); //动画
- //皮肤
- ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
- UnloadSkin();
- end;
- [Run]
- Filename: "http://www.baidu.com"; Flags: shellexec
|