论坛风格切换切换到宽版
  • 467阅读
  • 3回复

新手有关 Inno Setup 打包后 如何在完成页面 添加 设置某某网址为主页 [复制链接]

上一主题 下一主题
离线ppqq
 

发帖
1
金钱
10
威望
1
只看楼主 倒序阅读 0 发表于: 01-27

第一次 用Inno Setup 不懂 希望 大大 没能 帮忙

新手有关 Inno Setup 打包后 如何在完成页面

在完成页面添加 设置
  1. www.baidu.com

百度网址为主页和在完成页面 添加一些文字及网址连接


在第2个页面上 添加一些 选项 安装程序的一些选项

附送 原代码  这代码不是我写的


  1. [Setup]
  2. AppId={{FBDFDB8E-04D7-4CDB-8ADE-F002ECDEB6D7}
  3. AppName=0
  4. AppVersion=0.0.0.0
  5. AppVerName=0
  6. AppPublisher=0
  7. DefaultDirName={pf}\55555
  8. DefaultGroupName=333
  9. AllowNoIcons=yes
  10. OutputDir=D:\
  11. OutputBaseFilename=11111111111111
  12. SetupIconFile=D:\01.ico
  13. Compression=lzma/ultra64
  14. SolidCompression=yes
  15. VersionInfoVersion=0.0.0.0
  16. VersionInfoTextVersion=0.0.0.0
  17. VersionInfoCompany=2222222222
  18. VersionInfoDescription=111111111
  19. DisableReadyPage=yes
  20. DisableProgramGroupPage=yes
  21. InternalCompressLevel=ultra64
  22. DirExistsWarning=no
  23. [Messages]
  24. SetupAppTitle=鱼
  25. DiskSpaceMBLabel=所需空间: [mb] MB
  26. ButtonBack=上一步(&P)
  27. ButtonNext=下一步(&N)
  28. [CustomMessages]
  29. SetupWindowTitle=----By:3只鱼
  30. WelcomePage=....................
  31. SelectDirPage=......嘿嘿.....
  32. InstallingPage=正在安装
  33. FinishedPage=....................
  34. FinishedHeadingLabel=安装向导完成
  35. [Dirs]
  36. Name: {pf}\InnoSetup Installation Information; Attribs: hidden
  37. [Languages]
  38. Name: "chinesesimp"; MessagesFile: "compiler:Languages\ChineseSimp.isl"
  39. [Files]
  40. Source: ISSkin.dll; DestDir: {tmp}; Flags: dontcopy solidbreak;
  41. Source: BlackLite.cjstyles; DestDir: {tmp}; Flags: dontcopy solidbreak;
  42. Source: 欢迎.bmp; DestDir: {tmp}; Flags: dontcopy solidbreak;
  43. Source: 选项.bmp; DestDir: {tmp}; Flags: dontcopy solidbreak;
  44. Source: 安装.bmp; DestDir: {tmp}; Flags: dontcopy solidbreak;
  45. Source: 完成.bmp; DestDir: {tmp}; Flags: dontcopy solidbreak;
  46. Source: Close1.bmp; Flags: dontcopy solidbreak
  47. Source: Close2.bmp; Flags: dontcopy solidbreak
  48. Source: Close3.bmp; Flags: dontcopy solidbreak
  49. Source: license.txt; DestDir: {tmp}; Flags: dontcopy solidbreak;
  50. Source: "D:\music.mp3"; Flags: dontcopy
  51. Source: "D:\NSISADDIN\callnsis.dll"; DestDir: "{tmp}"; Flags: dontcopy
  52. Source: "D:\NSISADDIN\NewAdvSplash.dll"; DestDir: "{tmp}"; Flags: dontcopy
  53. Source: "D:\NSISADDIN\splash.gif"; DestDir: "{tmp}"; Flags: dontcopy
  54. [Files]
  55. Source: "D:\Users\Administrator\Desktop\03.exe"; DestDir: "{app}"; Flags: ignoreversion
  56. [code]
  57. Const
  58. //动画
  59.   AW_Hor_Positive = $1;
  60.   AW_Hor_Negative = $2;
  61.   AW_Ver_Positive = $4;
  62.   AW_Ver_Negative = $8;
  63.   AW_Center = $10;
  64.   AW_Hide = $10000;
  65.   AW_Activate = $20000;
  66.   AW_Slide = $40000;
  67.   AW_Blend = $80000;
  68. //透明
  69.   TransparentColor = clLime;  //要去掉的图片底色
  70.   TransparentPercent = 80;
  71.   WS_EX_LAYERED = $80000;
  72.   WS_EX_TRANSPARENT = $20;
  73.   LWA_COLORKEY = 1;
  74.   LWA_ALPHA = 2;
  75.   GWL_EXSTYLE = (-20);
  76.   WM_SYSCOMMAND = $0112;
  77. //动画
  78. function AnimateWindow(hWnd: HWND; dwTime: DWORD; dwFlags: DWORD): BOOL;
  79.   external 'AnimateWindow@user32 stdcall';
  80. //透明
  81. function SetLayeredWindowAttributes(hwnd: HWND; crKey: TColor; bAlpha: BYTE; dwFlags: DWORD): Boolean; external 'SetLayeredWindowAttributes@user32.dll stdcall';
  82. function GetWindowLong(Wnd: HWnd; Index: Integer): Longint; external 'GetWindowLong{#A}@user32.dll stdcall';
  83. function SetWindowLong(Wnd: HWnd; Index: Integer; NewLong: Longint): Longint; external 'SetWindowLong{#A}@user32.dll stdcall';
  84. function ReleaseCapture(): Longint; external 'ReleaseCapture@user32.dll stdcall';
  85. //皮肤
  86. procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
  87. external 'LoadSkin@files:isskin.dll stdcall';
  88. procedure UnloadSkin();
  89. external 'UnloadSkin@files:isskin.dll stdcall';
  90. function ShowWindow(hWnd: Integer; uType: Integer): Integer;
  91. external 'ShowWindow@user32.dll stdcall';
  92. var
  93. SetupWindowlabel: Tlabel; //标题文字
  94. underlabel: Tlabel; //底部文字
  95. licenseCheckBox: TCheckBox; //协议选框
  96. TaskBox1,TaskBox2,TaskBox3,RunBox1,RunBox2,RunBox3,RunBox4: TCheckBox;  //创建目录页面选框和新页面复选框
  97. TaskBox1Label,TaskBox2Label,TaskBox3Label,TaskBox4Label,TaskBox5Label,TaskBox6Label,NewLabel,NewStatusLabel,FinishedLabel3,FinishedLabel4,RunBox1Label,RunBox2Label,RunBox3Label,RunBox4Label: TLabel;  //请选择安装目录
  98. //可用空间
  99. freespacelabel: TLabel;
  100. FreeMB, TotalMB: Cardinal;
  101. //所需空间
  102. NewDiskSpaceLabel: Tlabel;
  103. //欢迎协议
  104. licenseLabel1,licenseCheckBoxlabel: TLabel;
  105. Notice: TRichEditViewer;
  106. //关闭按钮
  107. CloseBtn: TBitmapImage;
  108. //安装百分比
  109. ProgressLabel: TLabel;
  110. //可用空间
  111. function ProperFormat(FreeMB: Cardinal): string;
  112. begin
  113.   if FreeMB >= 1024 then
  114.     Result:= Format('可用空间: %d.%d GB', [Trunc(FreeMB/1024), Round((FreeMB/1024-Trunc(FreeMB/1024))*10)])
  115.   else
  116.     Result:= '可用空间: ' + IntToStr(FreeMB) + ' MB';
  117. end;
  118. procedure UpdateFreeSpaceOnDisk(Sender: TObject);
  119. begin
  120.   if GetSpaceOnDisk(ExtractFileDrive(WizardForm.DirEdit.Text), True, FreeMB, TotalMB) then
  121.     freespacelabel.Caption:= ProperFormat(FreeMB)
  122.   else
  123.     freespacelabel.Caption:= '可用空间: 0 MB';
  124. end;
  125. //单击“取消”直接退出
  126. procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
  127. begin
  128.   Confirm := False;
  129. end;
  130. //关闭按钮
  131. procedure CloseBtnOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X: Integer; Y: Integer);
  132. begin
  133.   CloseBtn.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Close3.bmp'));
  134. end;
  135. procedure CloseBtnOnMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X: Integer; Y: Integer);
  136. begin
  137.   CloseBtn.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Close2.bmp'));
  138. end;
  139. procedure CloseBtnOnMouseEnter(Sender: TObject);
  140. begin
  141.   CloseBtn.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Close2.bmp'))
  142. end;
  143. procedure CloseBtnOnMouseLeave(Sender: TObject);
  144. begin
  145.   CloseBtn.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Close1.bmp'));
  146. end;
  147. procedure CloseBtnOnClick(Sender: TObject);
  148. begin
  149. WizardForm.Close;
  150. end;
  151. //协议选框
  152. procedure licenseCheckBoxClick(Sender: TObject);
  153. begin
  154. WizardForm.NextButton.Enabled := licenseCheckBox.Checked;
  155. end;
  156. procedure licenseCheckBoxlabelOnClick(Sender: TObject);
  157. begin
  158. if licenseCheckBox.Checked = False then
  159.    licenseCheckBox.Checked := True
  160.    else
  161.    licenseCheckBox.Checked := False;
  162. end;
  163. procedure WizardFormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  164. begin
  165.   ReleaseCapture
  166.   SendMessage(WizardForm.Handle, WM_SYSCOMMAND, $F012, 0)
  167. end;
  168. var
  169. WizardFormImage: TBitmapImage;
  170. Type
  171.   HSAMPLE = DWORD;
  172.   HCHANNEL = DWORD;
  173. var
  174.   MusicSwitchLabel0, MusicSwitchLabel1, MusicSwitchLabel2: TNewStaticText;
  175.   sample: HSAMPLE;
  176.   channel: HCHANNEL;
  177. // 以下是所调用的插件函数
  178. procedure callplug(parentwnd: Integer; pluginname,funcname,param1,param2,param3,param4,param5,param6,param7,param8,param9,param10: PChar);
  179. external 'callplug@files:callnsis.dll stdcall delayload';
  180. procedure URLLabelOnClick(Sender: TObject);
  181. var
  182.   ErrorCode: Integer;
  183. begin
  184.   ShellExec('open', 'http://www.baidu.com', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
  185. end;
  186. procedure AboutButtonOnClick(Sender: TObject);
  187. begin
  188.   MsgBox(#13 '谢谢大家的支持哦' #13 #13'温馨提醒.有风险.请慎重!' #13#13 'By:3只鱼', mbInformation, MB_OK);
  189. end;
  190. var
  191. BGMusicFile, SplashFile: string;
  192. SplashForm: TForm;
  193. SplashFileName: String;
  194. I: Integer;
  195.     AboutButton, CancelButton: TButton;
  196.     URLLabel: TNewStaticText;
  197.     Function mciSendString(lpszCommand: String; lpszReturnString: Integer; cchReturnLength: Integer; hwndCallback: Integer): Integer;
  198. external 'mciSendStringA@winmm.dll stdcall';
  199. procedure InitializeWizard();
  200. begin
  201.   { Create the pages }
  202. WizardForm.PAGENAMELABEL.Font.Color:= clred;
  203. WizardForm.PAGEDESCRIPTIONLABEL.Font.Color:= clBlue;
  204. WizardForm.WELCOMELABEL1.Font.Color:= clGreen;
  205. WizardForm.WELCOMELABEL2.Font.Color:= clblack;
  206.    CancelButton := WizardForm.CancelButton;
  207.      AboutButton := TButton.Create(WizardForm);
  208.      AboutButton.Left := 20;
  209.      AboutButton.Top := 372;
  210.      AboutButton.Width :=  ScaleX(55);
  211.      AboutButton.Height := ScaleY(22);
  212.      AboutButton.Caption := '&关于';
  213.      AboutButton.OnClick := @AboutButtonOnClick;
  214.      AboutButton.Parent := WizardForm;
  215.   URLLabel := TNewStaticText.Create(WizardForm);
  216.     URLLabel.Caption := '谢谢支持';
  217.     URLLabel.Cursor := crHand;
  218.     URLLabel.OnClick := @URLLabelOnClick;
  219.     URLLabel.Parent := WizardForm;
  220.     { Alter Font *after* setting Parent so the correct defaults are inherited first }
  221.     URLLabel.Font.Style := URLLabel.Font.Style + [fsUnderline];
  222.     URLLabel.Font.Color := clBlue;
  223.     URLLabel.Top := AboutButton.Top + AboutButton.Height - URLLabel.Height - 2;
  224.     URLLabel.Left := AboutButton.Left + AboutButton.Width + ScaleX(20);
  225.     WizardForm.LICENSEACCEPTEDRADIO.Checked := true;
  226.    // 释放临时文件
  227.   ExtractTemporaryFile('CallNSIS.DLL');
  228.   ExtractTemporaryFile('NewAdvSplash.DLL');
  229.   ExtractTemporaryFile('splash.gif');
  230.   BGMusicFile := ExpandConstant('{tmp}\mymusic.mp3');
  231.   SplashFile := ExpandConstant('{tmp}\splash.gif');
  232.   // 闪屏:显示时间 1600、淡入 800、淡出 500、透明颜色 -2 (表示 gif 图像本身透明)
  233.   callplug(0,ExpandConstant('{tmp}\NewAdvSplash.dll'),'show','3000','800','500','-2',SplashFile,'','','','','');
  234. begin
  235. ExtractTemporaryFile(ExtractFileName(ExpandConstant('{tmp}\music.mp3')));
  236. SplashForm := TForm.create(nil);
  237. with SplashForm do
  238.    begin
  239. mciSendString(ExpandConstant('play {tmp}\music.mp3'),0,0,0);
  240. Close;
  241. Free;
  242.    end;
  243.     end;
  244. WizardForm.BorderStyle:=bsNone; //去标题框
  245. WizardForm.ClientWidth:=540
  246. WizardForm.ClientHeight:=400
  247. ExtractTemporaryFile('欢迎.bmp');
  248. ExtractTemporaryFile('选项.bmp');
  249. ExtractTemporaryFile('安装.bmp');
  250. ExtractTemporaryFile('完成.bmp');
  251. ExtractTemporaryFile('Close1.bmp');
  252. ExtractTemporaryFile('Close2.bmp');
  253. ExtractTemporaryFile('Close3.bmp');
  254. WizardFormImage := TBitmapImage.Create(WizardForm);
  255. WizardFormImage.Parent := WizardForm;
  256. WizardFormImage.Align := alClient;  //图片拉伸
  257. //WizardFormImage.SendToBack;  //显示底部横线
  258. WizardFormImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\欢迎.bmp'))
  259. WizardFormImage.OnMouseDown:=@WizardFormMouseDown;
  260. SetWindowLong(WizardForm.Handle, GWL_EXSTYLE, GetWindowLong(WizardForm.Handle, GWL_EXSTYLE) or WS_EX_LAYERED)
  261. SetLayeredWindowAttributes(WizardForm.Handle, TransparentColor,(255 * TransparentPercent) / 100, LWA_COLORKEY)
  262. //标题文字
  263. SetupWindowlabel := TLabel.Create(WizardForm);
  264. SetupWindowlabel.Parent := WizardForm;
  265. SetupWindowlabel.Caption := ExpandConstant('{cm:SetupWindowTitle}');  //控件文字  '#13'
  266. SetupWindowlabel.Font.Name := '宋体';
  267. SetupWindowlabel.Font.Size := 9
  268. SetupWindowlabel.Font.Color := clblack;
  269. SetupWindowlabel.Font.Style := [fsBold]
  270. SetupWindowlabel.Transparent := True;
  271. SetupWindowlabel.AutoSize := False;
  272. SetupWindowlabel.WordWrap := True;
  273. SetupWindowlabel.Left := ScaleX(10);
  274. SetupWindowlabel.Top := ScaleY(10);
  275. SetupWindowlabel.Width := WizardForm.Width;
  276. SetupWindowlabel.Height := ScaleY(14);
  277. SetupWindowlabel.OnMouseDown:=@WizardFormMouseDown;
  278. //底部文字
  279. underlabel := TLabel.Create(WizardForm);
  280. underlabel.Parent := WizardForm;
  281. underlabel.Font.Name := '宋体';
  282. underlabel.Font.Size := 9
  283. underlabel.Font.Color := clblack;
  284. underlabel.Font.Style := []
  285. underlabel.Transparent := True;
  286. underlabel.AutoSize := False;
  287. underlabel.WordWrap := True;
  288. underlabel.Left := ScaleX(10);
  289. underlabel.Top := ScaleY(362);
  290. underlabel.Width := WizardForm.Width;
  291. underlabel.Height := ScaleY(14);
  292. underlabel.OnMouseDown:=@WizardFormMouseDown;
  293. //关闭按钮
  294. CloseBtn := TBitmapImage.Create(WizardForm);
  295. CloseBtn.ShowHint := True;
  296. CloseBtn.Cursor := crHand;
  297. CloseBtn.OnMouseDown := @CloseBtnOnMouseDown;
  298. CloseBtn.OnMouseUp := @CloseBtnOnMouseUp;
  299. CloseBtn.OnMouseEnter := @CloseBtnOnMouseEnter;
  300. CloseBtn.OnMouseLeave := @CloseBtnOnMouseLeave;
  301. CloseBtn.Parent := WizardForm;
  302. CloseBtn.Width := 39
  303. CloseBtn.Height := 20
  304. CloseBtn.Left := WizardForm.Width - CloseBtn.Width;
  305. CloseBtn.Top := 0
  306. CloseBtn.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Close1.bmp'));
  307. CloseBtn.OnClick:= @CloseBtnOnClick;
  308. //WizardForm
  309. WizardForm.OuterNotebook.Hide;
  310. WizardForm.BeveledLabel.Width := 0
  311. WizardForm.BeveledLabel.Height := 0
  312. //CancelButton
  313. WizardForm.CancelButton.Left:=464
  314. WizardForm.CancelButton.Top:=371
  315. WizardForm.CancelButton.Width:=70
  316. WizardForm.CancelButton.Height:=23
  317. //BackButton
  318. WizardForm.BackButton.Left:=317
  319. WizardForm.BackButton.Top:=WizardForm.CancelButton.Top
  320. WizardForm.BackButton.Width:=WizardForm.CancelButton.Width
  321. WizardForm.BackButton.Height:=WizardForm.CancelButton.Height
  322. //NextButton
  323. WizardForm.NextButton.Left:=WizardForm.BackButton.Left + WizardForm.BackButton.Width + 1
  324. WizardForm.NextButton.Top:=WizardForm.CancelButton.Top
  325. WizardForm.NextButton.Width:=WizardForm.CancelButton.Width
  326. WizardForm.NextButton.Height:=WizardForm.CancelButton.Height
  327. //欢迎协议
  328. licenseLabel1 := TLabel.Create(WizardForm);
  329. licenseLabel1.Parent := WizardForm;  //位置
  330. licenseLabel1.Caption := '在安装软件前,请仔细阅读许可协议。';
  331. licenseLabel1.Font.Color := clBlack; //控件文字颜色
  332. licenseLabel1.Transparent := True; //控件透明显示
  333. licenseLabel1.Left := 15;
  334. licenseLabel1.Top := ScaleY(50);
  335. licenseLabel1.Width := WizardForm.Width - 30;
  336. //licenseLabel1.Height := ScaleY(13);
  337. //欢迎协议
  338. Notice:= TRichEditViewer.Create(WizardForm);
  339. Notice.Parent := WizardForm;
  340. Notice.Top:= licenseLabel1.Top + 23;
  341. Notice.Left:= licenseLabel1.Left;
  342. Notice.Width:= licenseLabel1.Width;
  343. Notice.Height:= ScaleY(198);
  344. Notice.ReadOnly:= true;
  345. Notice.SCROLLBARS:= ssVertical;
  346. Notice.Font.Size := 9
  347. ExtractTemporaryFile('license.txt');
  348. Notice.Lines.LoadFromFile(ExpandConstant('{tmp}\license.txt'));
  349. licenseCheckBox := TCheckBox.Create(WizardForm);
  350. licenseCheckBox.Parent := WizardForm;
  351. licenseCheckBox.Left := Notice.Left;
  352. licenseCheckBox.Top := ScaleY(281);
  353. licenseCheckBox.Width := ScaleX(13);
  354. licenseCheckBox.Height := ScaleY(13);
  355. licenseCheckBox.Checked := false
  356. licenseCheckBox.OnClick := @licenseCheckBoxClick;
  357. //欢迎协议
  358. licenseCheckBoxlabel := TLabel.Create(WizardForm);
  359. licenseCheckBoxlabel.Parent := WizardForm;  //位置
  360. licenseCheckBoxlabel.Caption := '我已阅读并同意软件许可协议';
  361. licenseCheckBoxlabel.Font.Color := clBlack; //控件文字颜色
  362. licenseCheckBoxlabel.Transparent := True; //控件透明显示
  363. licenseCheckBoxlabel.Left := licenseCheckBox.Left + licenseCheckBox.Width + 2;
  364. licenseCheckBoxlabel.Top := licenseCheckBox.Top + 1;
  365. licenseCheckBoxlabel.Width := 300;
  366. licenseCheckBoxlabel.OnClick := @licenseCheckBoxlabelOnClick;
  367. //NewLabel
  368. NewLabel := TLabel.Create(WizardForm);
  369. NewLabel.Parent := WizardForm;
  370. NewLabel.Font.Name := '宋体';
  371. NewLabel.Font.Size := 9  
  372. NewLabel.Font.Color := clblack;
  373. NewLabel.Font.Style := []
  374. NewLabel.Transparent := True;
  375. NewLabel.AutoSize := False;
  376. NewLabel.WordWrap := True;
  377. NewLabel.Left := ScaleX(20);
  378. NewLabel.Top := ScaleY(108);
  379. NewLabel.Width := WizardForm.Width - ScaleX(40);
  380. NewLabel.Height := ScaleY(14);
  381. WizardForm.DirEdit.Left:=NewLabel.Left + 55;
  382. WizardForm.DirEdit.Top:=75
  383. WizardForm.DirEdit.Width:=WizardForm.Width - 160
  384. WizardForm.DirEdit.Font.Size := ScaleY(9);
  385. WizardForm.DirEdit.Font.Name := 'MS Sans Serif';
  386. WizardForm.DirEdit.Height:=18
  387. //WizardForm.DirEdit.BringToFront
  388. WizardForm.DirEdit.Parent := WizardForm;
  389. //DirBrowseButton
  390. WizardForm.DirBrowseButton.Left:=WizardForm.DirEdit.Left + WizardForm.DirEdit.Width + 3
  391. WizardForm.DirBrowseButton.Top:=WizardForm.DirEdit.Top - 1
  392. WizardForm.DirBrowseButton.Width:=WizardForm.CancelButton.Width
  393. WizardForm.DirBrowseButton.Height:=WizardForm.CancelButton.Height
  394. WizardForm.DirBrowseButton.Parent := WizardForm;
  395. //DiskSpaceLabel
  396. WizardForm.DiskSpaceLabel.Left:=WizardForm.DirEdit.Left
  397. WizardForm.DiskSpaceLabel.Top:=WizardForm.DirEdit.Top + 30
  398. WizardForm.DiskSpaceLabel.Width:=100;
  399. WizardForm.DiskSpaceLabel.Height:=14
  400. WizardForm.DiskSpaceLabel.Color := $00F1E0C2; //控件文字颜色
  401. WizardForm.DiskSpaceLabel.Parent := WizardForm; //位置
  402. NewDiskSpaceLabel := TLabel.Create(WizardForm);
  403. NewDiskSpaceLabel.Parent := WizardForm;
  404. NewDiskSpaceLabel.Transparent := true;
  405. NewDiskSpaceLabel.Left := WizardForm.DirEdit.Left;
  406. NewDiskSpaceLabel.Top := WizardForm.DirEdit.Top + 30
  407. NewDiskSpaceLabel.Width := ScaleX(100);
  408. NewDiskSpaceLabel.Height := ScaleY(13);
  409. //DiskSpaceLabel
  410. WizardForm.DiskSpaceLabel.Left:=WizardForm.DirEdit.Left
  411. WizardForm.DiskSpaceLabel.Top:=WizardForm.DirEdit.Top + 30
  412. WizardForm.DiskSpaceLabel.Width:=100;
  413. WizardForm.DiskSpaceLabel.Height:=14
  414. WizardForm.DiskSpaceLabel.Color := $00F1E0C2; //控件文字颜色
  415. WizardForm.DiskSpaceLabel.Parent := WizardForm; //位置
  416. NewDiskSpaceLabel := TLabel.Create(WizardForm);
  417. NewDiskSpaceLabel.Parent := WizardForm;
  418. NewDiskSpaceLabel.Transparent := true;
  419. NewDiskSpaceLabel.Left := WizardForm.DirEdit.Left;
  420. NewDiskSpaceLabel.Top := WizardForm.DirEdit.Top + 30
  421. NewDiskSpaceLabel.Width := ScaleX(100);
  422. NewDiskSpaceLabel.Height := ScaleY(13);
  423. //可用空间
  424. freespacelabel:= TLabel.Create(WizardForm);
  425. freespacelabel.Parent:= WizardForm;
  426. freespacelabel.Left:= WizardForm.DiskSpaceLabel.Left + WizardForm.DiskSpaceLabel.Width + 20;
  427. freespacelabel.Top:= WizardForm.DiskSpaceLabel.Top;
  428. freespacelabel.Height:= WizardForm.DiskSpaceLabel.Height;
  429. freespacelabel.Width:= WizardForm.DiskSpaceLabel.Width;
  430. freespacelabel.Transparent := True; //控件透明显示
  431. if GetSpaceOnDisk(ExtractFileDrive(WizardDirValue), True, FreeMB, TotalMB) then
  432. freespacelabel.Caption:= ProperFormat(FreeMB);
  433. WizardForm.DirEdit.OnChange := @UpdateFreeSpaceOnDisk;
  434. //ProgressGauge
  435. WizardForm.ProgressGauge.Left:=0;
  436. WizardForm.ProgressGauge.Top:=310;
  437. WizardForm.ProgressGauge.Width:=WizardForm.Width;
  438. WizardForm.ProgressGauge.Height:=18
  439. WizardForm.ProgressGauge.Min:=0
  440. WizardForm.ProgressGauge.Max:=100
  441. WizardForm.ProgressGauge.Parent := WizardForm;
  442. //安装百分比
  443. ProgressLabel := TLabel.Create(WizardForm);
  444. ProgressLabel.Top := WizardForm.ProgressGauge.Top + 30;
  445. ProgressLabel.Left:= 80;
  446. ProgressLabel.AutoSize := True;
  447. ProgressLabel.Transparent := True;
  448. ProgressLabel.Parent := WizardForm;
  449. //皮肤
  450. ExtractTemporaryFile('BlackLite.cjstyles');
  451. LoadSkin(ExpandConstant('{tmp}\BlackLite.cjstyles'), 'NORMALBlackLite.INI');
  452. end;
  453. function StatusMsg(MyMsg: string): Boolean;
  454. begin
  455. Result:= True;
  456. NewStatusLabel.Caption:= MyMsg;
  457. end;
  458. procedure Progress();
  459. begin
  460. //安装百分比
  461. ProgressLabel.Caption:= IntToStr((WizardForm.ProgressGauge.Position-WizardForm.ProgressGauge.Min)/((WizardForm.ProgressGauge.Max - WizardForm.ProgressGauge.Min)/101)) + '%';
  462. end;
  463. procedure CurPageChanged(CurPageID: Integer);
  464. begin
  465.   if CurPageID = wpWelcome then
  466.     begin
  467.     underlabel.Caption := ExpandConstant('{cm:WelcomePage}');  //控件文字  '#13'
  468.     WizardFormImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\欢迎.bmp'))
  469.     Wizardform.NextButton.Enabled:= licenseCheckBox.Checked;
  470.     licenseCheckBox.show
  471.     licenseLabel1.Show
  472.     Notice.show
  473.     licenseCheckBoxlabel.show
  474.     NewLabel.hide
  475.     WizardForm.DirEdit.hide
  476.     WizardForm.DirBrowseButton.hide
  477.     WizardForm.DiskSpaceLabel.hide
  478.     NewDiskSpaceLabel.hide
  479.     freespacelabel.hide
  480.     WizardForm.ProgressGauge.hide
  481.     end;
  482.   if CurPageID = wpSelectDir then
  483.     begin
  484.     underlabel.Caption := ExpandConstant('{cm:SelectDirPage}');  //控件文字  '#13'
  485.     WizardFormImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\选项.bmp'))
  486.     licenseLabel1.hide
  487.     Notice.hide
  488.     licenseCheckBox.hide
  489.     licenseCheckBoxlabel.hide
  490.     NewLabel.hide
  491.     WizardForm.DirEdit.show
  492.     WizardForm.DirBrowseButton.show
  493.     WizardForm.DiskSpaceLabel.hide
  494.     NewDiskSpaceLabel.show
  495.     NewDiskSpaceLabel.Caption := WizardForm.DiskSpaceLabel.Caption;
  496.     freespacelabel.show
  497.     WizardForm.ProgressGauge.hide
  498.     WizardForm.NextButton.Caption := '安装(&I)'
  499.     end;
  500.   if CurPageID = wpSelectComponents then
  501.     begin
  502.     licenseCheckBox.hide
  503.     licenseCheckBoxlabel.hide
  504.     NewLabel.show
  505.     WizardForm.DirEdit.hide
  506.     WizardForm.DirBrowseButton.hide
  507.     WizardForm.DiskSpaceLabel.hide
  508.     NewDiskSpaceLabel.hide
  509.     freespacelabel.hide
  510.     WizardForm.ProgressGauge.hide
  511.     end;
  512.   if CurPageID = wpInstalling then
  513.     begin
  514.     underlabel.Caption := ExpandConstant('{cm:InstallingPage}');  //控件文字  '#13'
  515.     WizardFormImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\安装.bmp'))
  516.     licenseCheckBox.hide
  517.     licenseCheckBoxlabel.hide
  518.     NewLabel.hide
  519.     WizardForm.DirEdit.hide
  520.     WizardForm.DirBrowseButton.hide
  521.     WizardForm.DiskSpaceLabel.hide
  522.     NewDiskSpaceLabel.hide
  523.     freespacelabel.hide
  524.     WizardForm.ProgressGauge.show
  525.     end;
  526.     if CurPageID = wpFinished then
  527.     begin
  528.     underlabel.Caption := ExpandConstant('{cm:FinishedPage}');  //控件文字  '#13'
  529.     WizardFormImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\完成.bmp'))
  530.     licenseCheckBox.hide
  531.     licenseCheckBoxlabel.hide
  532.     NewLabel.hide
  533.     WizardForm.DirEdit.hide
  534.     WizardForm.DirBrowseButton.hide
  535.     WizardForm.DiskSpaceLabel.hide
  536.     NewDiskSpaceLabel.hide
  537.     freespacelabel.hide
  538.     ProgressLabel.hide
  539.     WizardForm.ProgressGauge.hide
  540.     WizardForm.NextButton.Left := WizardForm.CancelButton.Left
  541.     end;
  542. end;
  543. procedure DeinitializeSetup();
  544. begin
  545.   AnimateWindow(StrToInt(ExpandConstant('{wizardhwnd}')),500,AW_Center + AW_Hor_Positive + AW_Hide);  //动画
  546. //皮肤
  547. ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
  548. UnloadSkin();
  549. end;
  550. [Run]
  551. Filename: "http://www.baidu.com";  Flags: shellexec







离线qiuquan

发帖
120
金钱
1200
威望
120
只看该作者 1 发表于: 01-27
老是设别人主页也不是办法呀,别人安装的时候会很反感的。
离线xuchangqing

发帖
3
金钱
20
威望
2
只看该作者 2 发表于: 03-08
顶你一下,好贴要顶!
离线5412

发帖
6
金钱
60
威望
6
只看该作者 3 发表于: 03-10
前来学习中~~