搜尋
首頁資料庫mysql教程Inno setup 常用修改技巧

http://www.cnblogs.com/awei0611/archive/2010/06/09.html 1 、如何让协议许可页面默认选中我同意按钮 [delphi] view plaincopyprint? [code] procedure InitializeWizard(); begin WizardForm . LICENSEACCEPTEDRADIO . Checked := true ; end ; [code]pro

http://www.cnblogs.com/awei0611/archive/2010/06/09.html



1 、如何让协议许可页面默认选中我同意按钮

[delphi] view plaincopyprint?

  1. [code]
  2. procedure InitializeWizard();
  3. begin
  4. WizardForm.LICENSEACCEPTEDRADIO.Checked := true;
  5. end;
[code]
procedure InitializeWizard();
begin
WizardForm.LICENSEACCEPTEDRADIO.Checked := true;
end;


2、自定义安装程序右上角图片大小

[delphi] view plaincopyprint?

  1. [code]
  2. procedure InitializeWizard();
  3. begin
  4. WizardForm.WizardSmallBitmapImage.width:=150; //设置页眉图片的大小
  5. WizardForm.WizardSmallBitmapImage.left:=WizardForm.width-150; //设置左边页眉留出的空隙
  6. WizardForm.PAGENAMELABEL.width:=0; //设置标题文字显示的大小
  7. WizardForm.PAGEDESCRIPTIONLABEL.width:=0; //设置标题文字显示的大小
  8. end;
[code]
procedure InitializeWizard();
begin
WizardForm.WizardSmallBitmapImage.width:=150; //设置页眉图片的大小
WizardForm.WizardSmallBitmapImage.left:=WizardForm.width-150; //设置左边页眉留出的空隙
WizardForm.PAGENAMELABEL.width:=0; //设置标题文字显示的大小
WizardForm.PAGEDESCRIPTIONLABEL.width:=0; //设置标题文字显示的大小
end;


或者
//自定义安装向导小图片

[delphi] view plaincopyprint?

  1. [code]
  2. procedure InitializeWizard();
  3. begin
  4. Wizardform.WizardSmallBitmapImage.left:= WizardForm.width-164; //自定义安装向导小图片显示位置
  5. WizardForm.WizardSmallBitmapImage.width:=164; //自定义安装向导小图片宽度
  6. Wizardform.PageNameLabel.width:= 495 - 164 -36; //这儿必须定义,数值根据图片宽度更改,显示软件名称的位置
  7. Wizardform.PageDescriptionLabel.width:= 495 - 164 -42; //显示页面信息的位置
  8. end;
[code]
procedure InitializeWizard();
begin
Wizardform.WizardSmallBitmapImage.left:= WizardForm.width-164; //自定义安装向导小图片显示位置
WizardForm.WizardSmallBitmapImage.width:=164; //自定义安装向导小图片宽度
Wizardform.PageNameLabel.width:= 495 - 164 -36; //这儿必须定义,数值根据图片宽度更改,显示软件名称的位置
Wizardform.PageDescriptionLabel.width:= 495 - 164 -42; //显示页面信息的位置
end;


3、自定义BeveledLabel显示代码

[delphi] view plaincopyprint?

  1. [code]
  2. procedure InitializeWizard();
  3. begin
  4. WizardForm.BeveledLabel.Enabled:=true; //允许显示
  5. WizardForm.BeveledLabel.Font.Color:=$00058451;; //显示颜色
  6. WizardForm.BeveledLabel.Font.Style := WizardForm.BeveledLabel.Font.Style + [fsBold]; //显示字体
  7. WizardForm.BeveledLabel.Left:=5; //显示位置
  8. end;
[code]
procedure InitializeWizard();
begin
WizardForm.BeveledLabel.Enabled:=true; //允许显示
WizardForm.BeveledLabel.Font.Color:=$00058451;; //显示颜色
WizardForm.BeveledLabel.Font.Style := WizardForm.BeveledLabel.Font.Style + [fsBold]; //显示字体
WizardForm.BeveledLabel.Left:=5; //显示位置
end;


4、自定义安装向导图片

[delphi] view plaincopyprint?

  1. [code]
  2. procedure InitializeWizard();
  3. begin
  4. Wizardform.WELCOMELABEL1.left:= 18; //自定义欢迎页面标题1显示位置
  5. Wizardform.WELCOMELABEL2.left:= 18; //自定义欢迎页面标题2显示位置
  6. Wizardform.WizardBitmapImage.left:= WizardForm.width-164//自定义安装向导图片显示位置(显示大小,此处为居右显示)
  7. end;
[code]
procedure InitializeWizard();
begin
Wizardform.WELCOMELABEL1.left:= 18; //自定义欢迎页面标题1显示位置
Wizardform.WELCOMELABEL2.left:= 18; //自定义欢迎页面标题2显示位置
Wizardform.WizardBitmapImage.left:= WizardForm.width-164 //自定义安装向导图片显示位置(显示大小,此处为居右显示)
end;


5、显示出组件选择框 [Types]

[delphi] view plaincopyprint?

  1. Name: full; Description: 推荐
  2. Name: default; Description: 典型
  3. Name: custom; Description: 自定义; Flags: iscustom
  4. ;告诉安装程序这个类型是自定义类型。必须定义iscustom这个参数,才能显示出组件选择框
Name: full; Description: 推荐
Name: default; Description: 典型
Name: custom; Description: 自定义; Flags: iscustom
;告诉安装程序这个类型是自定义类型。必须定义iscustom这个参数,才能显示出组件选择框


6、定义[Messages]的颜色

[delphi] view plaincopyprint?

  1. [code]
  2. procedure InitializeWizard();
  3. begin
  4. WizardForm.BeveledLabel.Enabled:= True;
  5. WizardForm.BeveledLabel.Font.Color:= clblue;
  6. end;
[code]
procedure InitializeWizard();
begin
WizardForm.BeveledLabel.Enabled:= True;
WizardForm.BeveledLabel.Font.Color:= clblue;
end;


7、不显示一些特定的安装界面

[delphi] view plaincopyprint?

  1. [code]
  2. function ShouldSkipPage(PageID: Integer): Boolean;
  3. begin
  4. if PageID=wpReady then
  5. result := true;
  6. end;
  7. (*
  8. wpReady 是准备安装界面
  9. PageID查询 INNO帮助中的 Pascal 脚本: 事件函数常量
  10. 预定义向导页 CurPageID 值
  11. wpWelcome, wpLicense, wpPassword, wpInfoBefore, wpUserInfo, wpSelectDir, wpSelectComponents, wpSelectProgramGroup, wpSelectTasks, wpReady, wpPreparing, wpInstalling, wpInfoAfter, wpFinished
[code]
function ShouldSkipPage(PageID: Integer): Boolean; 
begin 
if PageID=wpReady then 
result := true; 
end;
(*
wpReady  是准备安装界面
PageID查询 INNO帮助中的 Pascal 脚本: 事件函数常量
预定义向导页 CurPageID 值
wpWelcome, wpLicense, wpPassword, wpInfoBefore, wpUserInfo, wpSelectDir, wpSelectComponents, wpSelectProgramGroup, wpSelectTasks, wpReady, wpPreparing, wpInstalling, wpInfoAfter, wpFinished

8、换行符号
在 [Messages] 换行符号为%n
在 MsgBox 中换行符号为 #13#10 //#13 为回车字符
9、颜色代码
(1)一个值形如 $bbggrr, 这里的 rr, gg 和 bb 指定了两位的亮度值(以十六进制表示)分别为红色,绿色和蓝色。
(2)预定义的颜色名称:
clBlack(黑色),clMaroon(暗红),clGreen(绿色),clOlive(橄榄绿),
clNavy(深蓝),clPurple(紫色),clTeal(深青),clGray(灰色),
clSilver(浅灰),clRed(红色),clLime(浅绿),clYellow(黄色),
clBlue(蓝色),clFuchsia(紫红),clAqua(青绿),clWhite(白色)。
10、inno代码注释符号
; 实例 —— ; 分号
// 实例 —— // 双斜杠 多用在code段
{ } 实例 —— {大括号 多用在code段}
注释符号均在英文输入法状态下输入
11、在运行卸载程序前显示弹出式消息

[delphi] view plaincopyprint?

  1. [code]
  2. function InitializeUninstall(): Boolean;
  3. begin
  4. if MsgBox('', mbConfirmation, MB_YESNO) = IDYES then
  5. result:=true
  6. else
  7. result:=false;
  8. end;
[code]
function InitializeUninstall(): Boolean;
begin
if MsgBox('', mbConfirmation, MB_YESNO) = IDYES then
result:=true
else
result:=false;
end;


12、安装、卸载时判断是否程序正在运行,卸载完成时自动打开网页

[delphi] view plaincopyprint?

  1. [code]
  2. var
  3. ErrorCode: Integer;
  4. IsRunning: Integer;
  5. // 安装时判断客户端是否正在运行
  6. function InitializeSetup(): Boolean;
  7. begin
  8. Result :=true; //安装程序继续
  9. IsRunning:=FindWindowByWindowName('东方宽频网络电视');
  10. while IsRunning0do
  11. begin
  12. if Msgbox('安装程序检测到客户端正在运行。' #13#13'您必须先关闭它然后单击“是”继续安装,或按“否”退出!', mbConfirmation, MB_YESNO) = idNO then
  13. begin
  14. Result :=false; //安装程序退出
  15. IsRunning :=0;
  16. endelsebegin
  17. Result :=true; //安装程序继续
  18. IsRunning:=FindWindowByWindowName('东方宽频网络电视');
  19. end;
  20. end;
  21. end;
  22. // 卸载时判断客户端是否正在运行
  23. function InitializeUninstall(): Boolean;
  24. begin
  25. Result :=true; //安装程序继续
  26. IsRunning:=FindWindowByWindowName('东方宽频网络电视');
  27. while IsRunning0do
  28. begin
  29. if Msgbox('安装程序检测到客户端正在运行。' #13#13'您必须先关闭它然后单击“是”继续安装,或按“否”退出!', mbConfirmation, MB_YESNO) = idNO then
  30. begin
  31. Result :=false; //安装程序退出
  32. IsRunning :=0;
  33. endelsebegin
  34. Result :=true; //安装程序继续
  35. IsRunning:=FindWindowByWindowName('东方宽频网络电视');
  36. end;
  37. end;
  38. end;
  39. procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
  40. begin
  41. case CurUninstallStep of
  42. usUninstall:
  43. begin// 开始卸载
  44. end;
  45. usPostUninstall:
  46. begin// 卸载完成
  47. // MsgBox('CurUninstallStepChanged:' #13#13 'Uninstall just finished.', mbInformation, MB_OK);
  48. // ...insert code to perform post-uninstall tasks here...
  49. ShellExec('open', 'http://www.dreams8.com', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
  50. end;
  51. end;
  52. end;
[code]
var
ErrorCode: Integer;
IsRunning: Integer;
// 安装时判断客户端是否正在运行   
function InitializeSetup(): Boolean;   
begin   
Result :=true;  //安装程序继续   
IsRunning:=FindWindowByWindowName('东方宽频网络电视');   
while IsRunning0 do  
begin   
if Msgbox('安装程序检测到客户端正在运行。'  #13#13 '您必须先关闭它然后单击“是”继续安装,或按“否”退出!', mbConfirmation, MB_YESNO) = idNO then   
begin   
Result :=false; //安装程序退出   
IsRunning :=0;   
end else begin   
Result :=true;  //安装程序继续   
IsRunning:=FindWindowByWindowName('东方宽频网络电视');   
end;   
end;   
end;   
// 卸载时判断客户端是否正在运行   
function InitializeUninstall(): Boolean;   
begin   
Result :=true;  //安装程序继续   
IsRunning:=FindWindowByWindowName('东方宽频网络电视');   
while IsRunning0 do  
begin   

if Msgbox('安装程序检测到客户端正在运行。'  #13#13 '您必须先关闭它然后单击“是”继续安装,或按“否”退出!', mbConfirmation, MB_YESNO) = idNO then   
begin   
Result :=false; //安装程序退出   
IsRunning :=0;   
end else begin   
Result :=true;  //安装程序继续   
IsRunning:=FindWindowByWindowName('东方宽频网络电视');     
end;   
end;   
end;   
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);   
begin   
case CurUninstallStep of   
usUninstall:     
begin // 开始卸载   
end;   
usPostUninstall:   
begin      // 卸载完成   
// MsgBox('CurUninstallStepChanged:' #13#13 'Uninstall just finished.', mbInformation, MB_OK);   
// ...insert code to perform post-uninstall tasks here...   
ShellExec('open', 'http://www.dreams8.com', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);   
end;   
end;   
end;   


13、 删除文件和删除文件夹

[delphi] view plaincopyprint?

  1. //删除文件 用 DeleteFile 只能删除一个文件,不能使用通配符来删除多个文件
  2. DeleteFile(ExpandConstant('{app}\abc.exe'));
  3. //删除所有文件及文件夹
  4. DelTree(ExpandConstant('{app}'), True, True, False);
//删除文件    用 DeleteFile 只能删除一个文件,不能使用通配符来删除多个文件
DeleteFile(ExpandConstant('{app}\abc.exe'));
//删除所有文件及文件夹
DelTree(ExpandConstant('{app}'), True, True, False);


14、BorderStyle
TFormBorderStyle = (bsNone, bsSingle, bsSizeable, bsDialog, bsToolWindow, bsSizeToolWin);
无边界式(bsNone) ,单边固定式(bsSingle),双边可变式(bsSizeable),对话框式(bsDialog)
15、if else

[delphi] view plaincopyprint?

  1. function NextButtonClick(CurPageID: Integer): Boolean;
  2. var
  3. ResultCode: Integer;
  4. begin
  5. Result := True;
  6. if (CurPageID = wpSelectDir) then
  7. begin
  8. MsgBox('AAAA', mbInformation, MB_OK);
  9. end
  10. else
  11. begin
  12. MsgBox('BBBB', mbInformation, MB_OK);
  13. end;
  14. end;
function NextButtonClick(CurPageID: Integer): Boolean; 
var 
ResultCode: Integer; 
begin 
Result := True; 
if (CurPageID = wpSelectDir) then 
begin 
MsgBox('AAAA', mbInformation, MB_OK); 
end 
else 
begin 
MsgBox('BBBB', mbInformation, MB_OK); 
end; 
end;


16、安装结束界面增加“设为首页”选项

[delphi] view plaincopyprint?

  1. [Tasks]
  2. Name: changestartpage; Description: "设置vistaqq为默认主页"
  3. [Registry]
  4. Root: HKCU; Subkey: "Software\Microsoft\Internet Explorer\Main"; ValueType: string; ValueName: "Start Page"; ValueData: "http://www.vistaqq.com"; tasks: changestartpage
[Tasks]
Name: changestartpage; Description: "设置vistaqq为默认主页"
[Registry]
Root: HKCU; Subkey: "Software\Microsoft\Internet Explorer\Main"; ValueType: string; ValueName: "Start Page"; ValueData: "http://www.vistaqq.com"; tasks: changestartpage


17、添加“关于”和网站链接按钮

[delphi] view plaincopyprint?

  1. [Code]
  2. procedure URLLabelOnClick(Sender: TObject);
  3. var
  4. ErrorCode: Integer;
  5. begin
  6. ShellExec('open', 'http://www.vistaqq.com', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
  7. end;
  8. procedure AboutButtonOnClick(Sender: TObject);
  9. begin
  10. MsgBox(#13'Vista 状态条风格盘符' #13 #13'本软件由jinn制作,希望各位登陆中天VIP工作室!' #13#13, mbInformation, MB_OK);
  11. end;
  12. var
  13. AboutButton, CancelButton: TButton;
  14. URLLabel: TNewStaticText;
  15. procedure InitializeWizard();
  16. begin
  17. { Create the pages }
  18. WizardForm.PAGENAMELABEL.Font.Color:= clred;
  19. WizardForm.PAGEDESCRIPTIONLABEL.Font.Color:= clBlue;
  20. WizardForm.WELCOMELABEL1.Font.Color:= clGreen;
  21. WizardForm.WELCOMELABEL2.Font.Color:= clblack;
  22. CancelButton := WizardForm.CancelButton;
  23. AboutButton := TButton.Create(WizardForm);
  24. AboutButton.Left := WizardForm.ClientWidth - CancelButton.Left - CancelButton.Width;
  25. AboutButton.Top := CancelButton.Top;
  26. AboutButton.Width := CancelButton.Width;
  27. AboutButton.Height := CancelButton.Height;
  28. AboutButton.Caption := '&About';
  29. AboutButton.OnClick := @AboutButtonOnClick;
  30. AboutButton.Parent := WizardForm;
  31. URLLabel := TNewStaticText.Create(WizardForm);
  32. URLLabel.Caption := '中天VIP工作室';
  33. URLLabel.Cursor := crHand;
  34. URLLabel.OnClick := @URLLabelOnClick;
  35. URLLabel.Parent := WizardForm;
  36. { Alter Font *after* setting Parent so the correct defaults are inherited first }
  37. URLLabel.Font.Style := URLLabel.Font.Style + [fsUnderline];
  38. URLLabel.Font.Color := clBlue;
  39. URLLabel.Top := AboutButton.Top + AboutButton.Height - URLLabel.Height - 2;
  40. URLLabel.Left := AboutButton.Left + AboutButton.Width + ScaleX(20);
  41. end;



18、去掉安装程序左上角“关于安装程序”的代码

[delphi] view plaincopyprint?

  1. procedure InitializeWizard();
  2. begin
  3. WizardForm.BorderIcons:= [biMinimize];
  4. end;
  5. procedure CurPageChanged(CurPage: Integer);
  6. begin
  7. if CurPage=wpWelcome then
  8. WizardForm.BorderIcons:= [biSystemMenu, biMinimize];
  9. end;
  10. 或者
  11. procedure InitializeWizard();
  12. begin
  13. WizardForm.BORDERICONS := [biHelp, biSystemMenu, biMinimize];
  14. end;
procedure InitializeWizard();
begin
WizardForm.BorderIcons:= [biMinimize];
end;
procedure CurPageChanged(CurPage: Integer);
begin
if CurPage=wpWelcome then
WizardForm.BorderIcons:= [biSystemMenu, biMinimize];
end;
或者
procedure InitializeWizard();
begin
WizardForm.BORDERICONS := [biHelp, biSystemMenu, biMinimize];
end;


19、自定义BeveledLabel文字
[Messages]
BeveledLabel=中天VIP工作室
20、自定义安装程序界面左上角“安装”文字
[message]
SetupAppTitle=需要的字
SetupWindowTitle=需要的字
21、自定义安装程序版本号
VersionInfoVersion=1.1
VersionInfoTextVersion=1.1
陳述
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
mysql:blob和其他無-SQL存儲,有什麼區別?mysql:blob和其他無-SQL存儲,有什麼區別?May 13, 2025 am 12:14 AM

mysql'sblobissuitableForStoringBinaryDataWithInareLationalDatabase,而ilenosqloptionslikemongodb,redis和calablesolutionsolutionsolutionsoluntionsoluntionsolundortionsolunsonstructureddata.blobobobissimplobisslowdeperformberbutslowderformandperformancewithlararengedata;

mySQL添加用戶:語法,選項和安全性最佳實踐mySQL添加用戶:語法,選項和安全性最佳實踐May 13, 2025 am 12:12 AM

toaddauserinmysql,使用:createUser'username'@'host'Indessify'password'; there'showtodoitsecurely:1)choosethehostcarecarefullytocon trolaccess.2)setResourcelimitswithoptionslikemax_queries_per_hour.3)usestrong,iniquepasswords.4)Enforcessl/tlsconnectionswith

MySQL:如何避免字符串數據類型常見錯誤?MySQL:如何避免字符串數據類型常見錯誤?May 13, 2025 am 12:09 AM

toAvoidCommonMistakeswithStringDatatatPesInMysQl,CloseStringTypenuances,chosethirtightType,andManageEngencodingAndCollat​​ionsEttingSefectery.1)usecharforfixed lengengtrings,varchar forvariable-varchar forbariaible length,andtext/blobforlargerdataa.2 seterters seterters seterters

mySQL:字符串數據類型和枚舉?mySQL:字符串數據類型和枚舉?May 13, 2025 am 12:05 AM

mysqloffersechar,varchar,text,and denumforstringdata.usecharforfixed Lengttrings,varcharerforvariable長度,文本forlarger文本,andenumforenforcingDataAntegrityWithaEtofValues。

mysql blob:如何優化斑點請求mysql blob:如何優化斑點請求May 13, 2025 am 12:03 AM

優化MySQLBLOB請求可以通過以下策略:1.減少BLOB查詢頻率,使用獨立請求或延遲加載;2.選擇合適的BLOB類型(如TINYBLOB);3.將BLOB數據分離到單獨表中;4.在應用層壓縮BLOB數據;5.對BLOB元數據建立索引。這些方法結合實際應用中的監控、緩存和數據分片,可以有效提升性能。

將用戶添加到MySQL:完整的教程將用戶添加到MySQL:完整的教程May 12, 2025 am 12:14 AM

掌握添加MySQL用戶的方法對於數據庫管理員和開發者至關重要,因為它確保數據庫的安全性和訪問控制。 1)使用CREATEUSER命令創建新用戶,2)通過GRANT命令分配權限,3)使用FLUSHPRIVILEGES確保權限生效,4)定期審計和清理用戶賬戶以維護性能和安全。

掌握mySQL字符串數據類型:varchar vs.文本與char掌握mySQL字符串數據類型:varchar vs.文本與charMay 12, 2025 am 12:12 AM

chosecharforfixed-lengthdata,varcharforvariable-lengthdata,andtextforlargetextfield.1)chariseffity forconsistent-lengthdatalikecodes.2)varcharsuitsvariable-lengthdatalikenames,ballancingflexibilitibility andperformance.3)

MySQL:字符串數據類型和索引:最佳實踐MySQL:字符串數據類型和索引:最佳實踐May 12, 2025 am 12:11 AM

在MySQL中處理字符串數據類型和索引的最佳實踐包括:1)選擇合適的字符串類型,如CHAR用於固定長度,VARCHAR用於可變長度,TEXT用於大文本;2)謹慎索引,避免過度索引,針對常用查詢創建索引;3)使用前綴索引和全文索引優化長字符串搜索;4)定期監控和優化索引,保持索引小巧高效。通過這些方法,可以在讀取和寫入性能之間取得平衡,提升數據庫效率。

See all articles

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

PhpStorm Mac 版本

PhpStorm Mac 版本

最新(2018.2.1 )專業的PHP整合開發工具

DVWA

DVWA

Damn Vulnerable Web App (DVWA) 是一個PHP/MySQL的Web應用程序,非常容易受到攻擊。它的主要目標是成為安全專業人員在合法環境中測試自己的技能和工具的輔助工具,幫助Web開發人員更好地理解保護網路應用程式的過程,並幫助教師/學生在課堂環境中教授/學習Web應用程式安全性。 DVWA的目標是透過簡單直接的介面練習一些最常見的Web漏洞,難度各不相同。請注意,該軟體中

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

SecLists

SecLists

SecLists是最終安全測試人員的伙伴。它是一個包含各種類型清單的集合,這些清單在安全評估過程中經常使用,而且都在一個地方。 SecLists透過方便地提供安全測試人員可能需要的所有列表,幫助提高安全測試的效率和生產力。清單類型包括使用者名稱、密碼、URL、模糊測試有效載荷、敏感資料模式、Web shell等等。測試人員只需將此儲存庫拉到新的測試機上,他就可以存取所需的每種類型的清單。

Dreamweaver Mac版

Dreamweaver Mac版

視覺化網頁開發工具