inno setup 脚本常用修改 转
http://blog.sina.com.cn/s/blog_72c2eb350100y2sa.html
有人提及想更换安装界面的图片,其实方法很简单,只需要修改inno setup安装目录下的WizModernImage.bmp和WizModernSmallImage.bmp两张图片就可以了。
只需在代码页,添加如下代码,即可实现页面的优化。
#define MyAppName "服务端"
#define MyAppVersion "1.3.2"
#define MyAppPublisher "ga526"
[Setup]
AppId={{59FB74DA-DBE1-41EF-B69A-31BE8324D98B}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
DefaultDirName=c:\ga526\ga526\服务端
DisableDirPage=yes
DefaultGroupName=ga526服务端
DisableProgramGroupPage=yes
OutputDir=C:\Documents and Settings\Administrator\
OutputBaseFilename=server
SetupIconFile=D:\桌面\图标\ga526.ico
Compression=lzma
SolidCompression=yes
[Files]
//flags 不能少BeforeInstall: ChangeDisplay,这里是调用changedisplay
Source: "C:\Documents and Settings\Administrator\desktop\ga5262011121\*"; DestDir: "{app}"; Flags: recursesubdirs createallsubdirs; BeforeInstall: ChangeDisplay
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\服务端.exe"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}" //在“开始”--“程序”里,添加一个卸载的快捷方式Name: "C:\Documents and Settings\Administrator\「开始」菜单\程序\启动\程序"; Filename: "c:\我的程序.exe" //这里为添加开机启动项,当然也可以通过修改注册表达到这个目的
Name: "C:\Documents and Settings\Administrator\桌面\服务端"; Filename: "{app}\服务端.exe"; //这里是添加桌面快捷方式
[run]
Filename: "{app}\服务端.exe"; flags:"nowait" //安装完成后,立即运行“服务端.exe”
[Code]
var
DetailList: TNewListBox;
newFileNameLabel: TNewStaticText;
LastDir: string;
procedure InitializeWizard();
begin
//界面修改
WizardForm.WizardSmallBitmapImage.left:=426;
WizardForm.taskslist.color:=clWindow;
WizardForm.innerpage.color:=clWindow;
WizardForm.readymemo.color:=clWindow;
WizardForm.PAGENAMELABEL.Font.Color:= clGreen;
WizardForm.PAGEDESCRIPTIONLABEL.Font.Color:= clGreen;
WizardForm.WelcomeLabel2.Caption := '安装向导将在你的电脑上安装 {#MyAppName} ' + #13#10 +
+ #13#10 +
'建议你在继续之前关闭所有其它应用程序。' + #13#10 +
'' + #13#10 +
'单击“下一步”继续,或单击“取消”退';
WizardForm.WELCOMELABEL1.Font.Color:= clGreen;
WizardForm.WELCOMELABEL1.top:= 31;
//WizardForm.WELCOMELABEL2.caption:=' 请确认你所使用的为我司产品,否则,因软件与硬件'
//+ #13#10 + + #13#10 + '不兼容造成任何问题,本公司不负任何法律责任。'
//+ #13#10 + + #13#10 + ' 建议你在继续安装之前,关闭杀毒软件,并把软件安'
//+ #13#10 + + #13#10 + '装在C盘下'+' 单击“下一步”继续安装本程序,单击“取'
//+ #13#10 + + #13#10 + '消”退出安装。' ;
WizardForm.WELCOMELABEL2.top:= 91;
WizardForm.Color:= clwindow;
WizardForm.Bevel1.Left:=0;
WizardForm.Bevel1.top:=0;
WizardForm.Bevel1.width:=0;
WizardForm.Bevel.Left:=0;
WizardForm.Bevel.top:=0;
WizardForm.selectdirbitmapimage.visible:=false;
WizardForm.selectgroupbitmapimage.visible:=false;
WizardForm.selectdirlabel.left:=0;
WizardForm.selectstartmenufolderlabel.left:=0;
WizardForm.Bevel.width:=0;
WizardForm.PageDescriptionLabel.Top:=40;
//页面修改完毕
//显示细节
DetailList:= TNewListBox.Create(WizardForm);
DetailList.Parent := WizardForm.InstallingPage;
DetailList.Left := ScaleX(0);
DetailList.Top := ScaleY(70);
DetailList.Width := ScaleX(417);
DetailList.Height := ScaleY(153);
newFileNameLabel:= TNewStaticText.Create(WizardForm) // 创建 FileNameLabel 的替代
newFileNameLabel.Parent := WizardForm.InstallingPage;
newFileNameLabel.Top := WizardForm.FileNameLabel.Top;
newFileNameLabel.Left := WizardForm.FileNameLabel.Left;
newFileNameLabel.Width := WizardForm.FileNameLabel.Width;
WizardForm.FileNameLabel.Visible := false; // 隐藏本来的 FileNameLabel
LastDir:= '';
end;
procedure ChangeDisplay;
var
dn, fn: string;
pct: Extended;
begin
pct := (WizardForm.ProgressGauge.Position-WizardForm.ProgressGauge.Min)/(WizardForm.ProgressGauge.Max-WizardForm.ProgressGauge.Min)*100;
dn:= ExpandConstant(ExtractFileDir(CurrentFileName));
fn:= ExtractFileName(CurrentFileName);
WizardForm.StatusLabel.Caption:= '输出目录: ' + dn;
newFileNameLabel.Caption:= '抽取: ' + fn + ' (' + IntToStr(Round(pct)) + '% 已完成)';
if dn <> LastDir then
begin
DetailList.Items.Append('输出目录: ' + dn);
LastDir:= dn;
end;
DetailList.Items.Append('抽取: ' + fn + ' (' + IntToStr(Round(pct)) + '% 已完成)');
DetailList.ItemIndex := DetailList.Items.Count - 1;
end;
//显示细节完毕
////修改卸载文件
procedure CurStepChanged(CurStep: TSetupStep);
var
uninspath, uninsname, NewUninsName, MyAppName: string;
begin
if CurStep=ssDone then
begin
// 指定新的卸载文件名(不包含扩展名),请相应修改!
NewUninsName := '卸载服务端';
// 应用程序名称,与 [SEUTP] 段的 AppName 必须一致,请相应修改!
MyAppName := '服务端';
// 以下重命名卸载文件
uninspath:= ExtractFilePath(ExpandConstant('{uninstallexe}'));
uninsname:= Copy(ExtractFileName(ExpandConstant('{uninstallexe}')),1,8);
RenameFile(uninspath + uninsname + '.exe', uninspath + NewUninsName + '.exe');
RenameFile(uninspath + uninsname + '.dat', uninspath + NewUninsName + '.dat');
// 以下修改相应的注册表内容
if RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + MyAppName + '_is1') then
begin
RegWriteStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + MyAppName + '_is1', 'UninstallString', '"' + uninspath + NewUninsName + '.exe"');
RegWriteStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + MyAppName + '_is1', 'QuietUninstallString', '"' + uninspath + NewUninsName + '.exe" /SILENT');
end;
end;
end;
inno setup 脚本常用修改 转的更多相关文章
- Inno Setup的常用脚本
Inno Setup的常用脚本 分类: VC++神奇理论 2012-12-06 10:07 3234人阅读 评论(2) 收藏 举报 安装不同的目录: [Files] Source: "我的程 ...
- Inno Setup脚本语法大全
Inno Setup脚本语法大全 ResourceShare Bruce 11个月前 (10-28) 6136浏览 0评论 Inno Setup 是什么?Inno Setup 是一个免费的 Win ...
- INNO SETUP脚本向导创建的基本脚本
脚本范例分析:先来看看一段用INNO SETUP脚本向导创建的基本脚本的[Setup]段: [Setup] AppName=Premiere 6.5 汉化补丁-----------------(程 ...
- 以前编写的inno setup脚本,涵盖了自定义安装界面,调用dll等等应用 (转)
以前编写的inno setup脚本,涵盖了自定义安装界面,调用dll等等应用 (转) ; Script generated by the Inno Setup 脚本向导. ; SEE THE DOCU ...
- inno setup脚本,涵盖了自定义安装界面,调用dll等等应用
; Script generated by the Inno Setup 脚本向导. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETU ...
- Inno Setup 脚本
给你个我用的例子: Delphi/Pascal code ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 ...
- Inno Setup脚本
某天夜晚一场狂风暴雨,由于办公室座位旁的窗户没关,笔记本电脑泡了一夜水,无法开机,无奈送修,里面的大量资料也不知道会不会丢失. is的脚本只有重新写了,重新研究了一下检测程序是否正在运行的判断方法,另 ...
- 使用Inno SetUp脚本打包Winform程序
在开发桌面程序时,往往需要用到打包工具将程序打包为exe可执行文件. 之前在项目中用了下 InstallShield Limited Edition for Visual Studio 2015,它 ...
- 使用inno setup打包程序完整脚本(.net框架检测,重复安装检测)
; 脚本由 Inno Setup 脚本向导 生成!; 有关创建 Inno Setup 脚本文件的详细资料请查阅帮助文档! #define MyAppName "小小鸟软件"#def ...
随机推荐
- 在Github里集成Readthedocs服务
Readthedocs支持Markdown格式和sphinx格式的文档排版,是部署项目文档的绝佳平台.利用Github的托管服务,我们可以方便地将文档托管于Github,并利用Readthedocs查 ...
- C++智能指针: auto_ptr, shared_ptr, unique_ptr, weak_ptr
本文参考C++智能指针简单剖析 内存泄露 我们知道一个对象(变量)的生命周期结束的时候, 会自动释放掉其占用的内存(例如局部变量在包含它的第一个括号结束的时候自动释放掉内存) int main () ...
- StringBuilder类的作用,以及与String类的相互转换
# 转载请留言联系 先看一段String类的字符串拼接的代码. String s = "hello" 会在常量池开辟一个内存空间来存储”hello". s += &quo ...
- Java Socket编程基础篇
原文地址:Java Socket编程----通信是这样炼成的 Java最初是作为网络编程语言出现的,其对网络提供了高度的支持,使得客户端和服务器的沟通变成了现实,而在网络编程中,使用最多的就是Sock ...
- 论文笔记 《Maxout Networks》 && 《Network In Network》
论文笔记 <Maxout Networks> && <Network In Network> 发表于 2014-09-22 | 1条评论 出处 maxo ...
- QT中ui更改后不能更新的解决方法
ui源文件到界面显示的原理可以网上搜索,这里不再描述.简单讲就是先要从*.ui生成ui_*.h然后再编译,所以界面未更新实际上是因为ui_*.h这个文件没有更新导致的. 出现此问题后我尝试了以下几个方 ...
- office2007/2010/2013输入公式的正确方式
博客中的文章均为 meelo 原创,请务必以链接形式注明本文地址 理工科的学生,写报告.写论文那面需要输入公式,过去大家常用的公式编辑器是mathtype,虽然功能强大,但输入极为不方便,输入个指数. ...
- 关于Logstash中grok插件的正则表达式例子
一.前言 近期需要对Nginx产生的日志进行采集,问了下度娘,业内最著名的解决方案非ELK(Elasticsearch, Logstash, Kibana)莫属. Logstash负责采集日志,Ela ...
- CSS Modules入门及React中实践(内附webpack4配置)
本篇文章以整理为主,自己进行了部分修改,如有侵权,请告知 CSS Modules介绍 CSS Modules是什么东西呢?首先,让我们从官方文档入手:GitHub – css-modules/css- ...
- 三十八 ThreadLocal
在多线程环境下,每个线程都有自己的数据.一个线程使用自己的局部变量比使用全局变量好,因为局部变量只有线程自己能看见,不会影响其他线程,而全局变量的修改必须加锁. 但是局部变量也有问题,就是在函数调用的 ...