I?n?n?o? ?s?e?t?u?p? ?常?用?修?改?技?巧

Inno setup 常用修改技巧
1 、如何让协议许可页面默认选中我同意按钮
[code]
procedure
InitializeWizard();
begin
WizardForm.LICENSEACCEPTEDRADIO.Checked :=
true;
end;
2、自定义安装程序右上角图片大小
[code]
procedure
InitializeWizard();
begin
WizardForm.WizardSmallBitmapImage.width:=150;
//设置页眉图片的大小
WizardForm.WizardSmallBitmapImage.left:=WizardForm.width-150;
//设置左边页眉留出的空隙
WizardForm.PAGENAMELABEL.width:=0;
//设置标题文字显示的大小
WizardForm.PAGEDESCRIPTIONLABEL.width:=0;
//设置标题文字显示的大小
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显示代码
[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、自定义安装向导图片
[code]
procedure
InitializeWizard();
begin
Wizardform.WELCOMELABEL1.left:= 18;
//自定义欢迎页面标题1显示位置
Wizardform.WELCOMELABEL2.left:= 18;
//自定义欢迎页面标题2显示位置
Wizardform.WizardBitmapImage.left:= WizardForm.width-164
//自定义安装向导图片显示位置(显示大小,此处为居右显示)
end;
5、显示出组件选择框
[Types]
Name: full;
Description: 推荐
Name: default; Description: 典型
Name: custom; Description:
自定义; Flags:
iscustom
;告诉安装程序这个类型是自定义类型。必须定义iscustom这个参数,才能显示出组件选择框
6、定义[Messages]的颜色

[code]
procedure
InitializeWizard();
begin
WizardForm.BeveledLabel.Enabled:=
True;
WizardForm.BeveledLabel.Font.Color:= clblue;
end;
7、不显示一些特定的安装界面

[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、在运行卸载程序前显示弹出式消息
[code]
function
InitializeUninstall(): Boolean;
begin
if MsgBox(‘‘, mbConfirmation,
MB_YESNO) = IDYES
then
result:=true
else
result:=false;
end;
12、安装、卸载时判断是否程序正在运行,卸载完成时自动打开网页

[code]
var
ErrorCode: Integer;
IsRunning: Integer;
//
安装时判断客户端是否正在运行  
function InitializeSetup(): Boolean;  

begin  
Result :=true; //安装程序继续  

IsRunning:=FindWindowByWindowName(‘东方宽频网络电视‘);  
while
IsRunning<>0 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
IsRunning<>0 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、 删除文件和删除文件夹

//删除文件    用 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
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、安装结束界面增加“设为首页”选项

[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、添加“关于”和网站链接按钮
[Code]
procedure
URLLabelOnClick(Sender: TObject);
var
ErrorCode:
Integer;
begin
ShellExec(‘open‘, ‘http://www.vistaqq.com‘, ‘‘, ‘‘,
SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;
procedure
AboutButtonOnClick(Sender: TObject);
begin
MsgBox(#13 ‘Vista 状态条风格盘符‘ #13
#13‘本软件由jinn制作,希望各位登陆中天VIP工作室!‘ #13#13 ‘版权所有 (C) 中天VIP工作室‘, mbInformation,
MB_OK);
end;
var
    AboutButton, CancelButton:
TButton;
    URLLabel: TNewStaticText;
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 :=
WizardForm.ClientWidth - CancelButton.Left -
CancelButton.Width;
     AboutButton.Top :=
CancelButton.Top;
     AboutButton.Width :=
CancelButton.Width;
     AboutButton.Height :=
CancelButton.Height;
     AboutButton.Caption :=
‘&About‘;
     AboutButton.OnClick :=
@AboutButtonOnClick;

  AboutButton.Parent := WizardForm;
  URLLabel :=
TNewStaticText.Create(WizardForm);
     URLLabel.Caption :=
‘中天VIP工作室‘;

  URLLabel.OnClick :=
@URLLabelOnClick;
    URLLabel.Cursor := crHand;

  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);
end;
18、去掉安装程序左上角“关于安装程序”的代码
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
22、安装完成后显示新特性
[Run]
Filename:
"{app}\WhatsNew.Txt"; Description: "安装完成后显示新特性"; Flags: postinstall shellexec
skipifsilent

时间: 2024-07-28 12:38:43

I?n?n?o? ?s?e?t?u?p? ?常?用?修?改?技?巧的相关文章

win10周年版eNSP中启动AR提示错误代码40问题

win 10操作系统中安装eNSP 1.2.00.380,一直运行正常,但在2016年11月升级win 周年版之后,启动AR时启动失败,提示错误代码40. 卸载eNSP及VirtualBox之后重装问题依旧.按照论坛和网上各种说法更新virtualbox修改虚拟网卡设置,或者重新注册都无法解决,最终多方查找终于找到解决方案. 环境:win10 周年版,eNSP 1.2.00.380,VirtualBox 4.2.8 eNSP注册后virtualbox管理器中会出现AR_Base,WLAN_AC_

聚焦新相亲时代:女孩在京有五六套房哭着想嫁富2代

2017-09-20 07:31:00 来源: 中国青年报(北京)        举报 6984 分享到: 易信 微信 QQ空间 微博 更多 用微信扫码二维码 分享至好友和朋友圈 T + - (原标题:中青报聚焦新相亲时代:2亿人及其背后家庭组成的"擂台") 石家庄某相亲角.视觉中国 资料 平均算下来,每一分钟里,国内有22对新人拿着户口本走向民政局,进入婚姻生活:同时,8对夫妻在另外一个窗口签下离婚协议. 根据民政部公布的数字,中国的结婚率和离婚率曲线渐渐逼近一个闭合的大于号.婚姻的

linux下Nginx配置文件(nginx.conf)配置设置详解(windows用phpstudy集成)

linux备份nginx.conf文件举例: cp /usr/local/nginx/nginx.conf /usr/local/nginx/nginx.conf-20171111(日期) 在进程列表里 面找master进程,它的编号就是主进程号. ps -ef | grep nginx 查看进程 cat /usr/local/nginx/nginx.pid 每次修改完nginx文件都要重新加载配置文件linux命令: /usr/local/nginx -t //验证配置文件是否合法 若ngin

Day5 - 常用模块学习

本节大纲: 模块介绍(模块导入方法) time &datetime模块 random os sys shutil json & picle shelve xml处理 yaml处理 configparser hashlib subprocess logging模块 re正则表达式 模块,用一堆代码实现了某个功能的代码集合. 类似于函数式编程和面向过程编程,函数式编程则完成一个功能,其他代码用来调用即可,提供了代码的重用性和代码间的耦合.而对于一个复杂的功能来,可能需要多个函数才能完成(函数又

js跨域

第一次写博客,好紧张,不知道能写成啥样,哈哈哈. 自己的一知片解,有错请多多指教,嘻嘻嘻. 一.何为跨域? 只要协议.域名.端口后任何一个不同,就是跨域. 举个例子: http://www.example.com 协议不同 https://www.example.com http://www.example.com 域名不同 http://www.test.com http://www.example.com 端口不同 http://www.example.com:81 注意:ip相同,域名不同

H5移动端知识点总结

移动开发基本知识点 一. 使用rem作为单位html { font-size: 100px; }@media(min-width: 320px) { html { font-size: 100px; } }@media(min-width: 360px) { html { font-size: 112.5px; } }@media(min-width: 400px) { html { font-size: 125px; } }@media(min-width: 640px) { html { f

Vue.js学习笔记:属性绑定 v-bind

v-bind  主要用于属性绑定,Vue官方提供了一个简写方式 :bind,例如: <!-- 完整语法 --> <a v-bind:href="url"></a> <!-- 缩写 --> <a :href="url"></a> 绑定HTML Class 一.对象语法: 我们可以给v-bind:class 一个对象,以动态地切换class.注意:v-bind:class指令可以与普通的class特

http请求与响应全过程

HTTP 无状态性 HTTP 协议是无状态的(stateless).也就是说,同一个客户端第二次访问同一个服务器上的页面时,服务器无法知道这个客户端曾经访问过,服务器也无法分辨不同的客户端.HTTP 的无状态特性简化了服务器的设计,使服务器更容易支持大量并发的HTTP 请求. HTTP 持久连接       HTTP1.0 使用的是非持久连接,主要缺点是客户端必须为每一个待请求的对象建立并维护一个新的连接,即每请求一个文档就要有两倍RTT 的开销.因为同一个页面可能存在多个对象,所以非持久连接可

css中的px、em、rem 详解

概念介绍: 1.px (pixel,像素):是一个虚拟长度单位,是计算机系统的数字化图像长度单位,如果px要换算成物理长度,需要指定精度DPI(Dots Per Inch,每英寸像素数),在扫描打印时一般都有DPI可选.Windows系统默认是96dpi,Apple系统默认是72dpi. 2.em(相对长度单位,相对于当前对象内文本的字体尺寸):是一个相对长度单位,最初是指字母M的宽度,故名em.现指的是字符宽度的倍数,用法类似百分比,如:0.8em, 1.2em,2em等.通常1em=16px

使用 IDEA 创建 Maven Web 项目 (异常)- Disconnected from the target VM, address: &#39;127.0.0.1:59770&#39;, transport: &#39;socket&#39;

运行环境: JDK 版本:1.8 Maven 版本:apache-maven-3.3.3 IDEA 版本:14 maven-jetty-plugin 配置: <plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <configuration> <webAppSourceDirectory>${pro