Inno setup 常用修改技巧

使用node-webkit和innosetup打包将web程序打包为桌面客户端(安装包exe) 使用node-webkit将web程序打包成windows桌面应用安装程序,实现从桌面应用访问web应用程序或者自定义网页。 node-webkit的准备工作 下载和安装node-webkit 进入node-webkit官网,点击下载所需要的版本,我这里选择的是windows64位版本 将下载的压缩包解压 准备web应用的网址或者自定义网页 在制作桌面应用之前需要一个特别重要的文件package.json,具体内容如下: { "main": "main.html", ...... 阅读详情

 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.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);
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

更多可参见http://www.dreams8.com/thread-4559-1-1.html

自定义Inno Setup安装界面(仿QQ安装界面) 自定义Inno Setup安装界面(仿QQ安装界面) ,本脚本纯属学习使用,如发生问题,作者不负任何责任。有异议,请联系1218476693@qq.com 立即下载

相关推荐

innoset 打包模仿有道云,前人栽树后人乘凉,优化了他们的包,能够运行。

该脚本借鉴网友们的成果,做了部分优化,本脚本纯属学习使用,如发生问题,作者不负任何责任。有异议,请联系harouncloud@foxmail.com

使用inno setup生成桌面安装程序最新教程,常用功能及详解。

本文主要讲解inno setup如何生成一个安装包以及一些问题的解决方案,如安装时增加密码,修改默认安装路径,删除文件等。需要进行中英文配置

z37411的博客 1万+

树莓派3-改装wifi外置天线

声明:本文只是技术性探讨,改装引起的产品损坏等后果,由用户自负! 改装主要有两种方法 方法一:直接替换原来的天线 1、移除原有的小陶瓷天线,就在Made in PRC(或UK)那边的那个 清理一下阻焊剂方便天线接地(图中PRC左侧) 2、焊接天线 天线的屏蔽层焊接到清理完阻焊剂的地方,中间的信号线焊接到PRC右侧焊盘。 3、最终的样子

huayucong的博客 2万+

【Inno Setup】修改安装分割线前面的文字并自定义风格(颜色、字体大小等等)

[Messages] BeveledLabel=少莫千华 [Code] procedure InitializeWizard(); begin //改变欢迎页面文字的颜色(如图) WizardForm.LICENSEACCEPTEDRADIO.Checked:=true; WizardForm.BeveledLabel.Enabled:=true;//充许显示 WizardForm

少莫千华 2795

vue3 web项目引入高拍仪

高拍仪的引入步骤就两步,安装SDK,然后根据官网的api进行开发。根据自己需要的功能,请求对应的接口。

qq_42480170的博客 4134

IAP固件升级(附代码)-- Bootloader接收BIN文件(带Xmodem和CRC16/32校验)

祝各位在新的一年发大大大大大大大大大大大财、涨涨涨涨涨涨涨涨涨涨涨工资

m0_69014205的博客 5599
上一篇: Inno Setup 网页显示插件 webctrl (V2 版本)
下一篇: INNO SETUP数据库的连接与创建
ShenRui
博客等级 码龄20年 63粉丝 36原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址