innoSetup打包文件编写模板
现在打包主要是使用 innosetup 这个软件来进行打包,支持录制脚本和手动编写脚本,比较好用。
此文章主要记录手写脚本,便于后期查询,借鉴。
; 自定义的宏,方便后期维护
#define MyAppName "良田讲课仪"
#define MyAppVersion "V1.0"
#define MyAppExeName "TMaker.exe"
#define MyAppPublisher "Eloam" [Setup]
AppId={{F382DAB1-E185-41EF-B6ED-32E86CC310B0}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion} ; 发布者 - 安装包文件版本 - 版权
AppPublisher={#MyAppPublisher}
VersionInfoVersion=1.0
VersionInfoCopyright={#MyAppPublisher} ; 默认安装文件夹路径 + 文件夹名称
DefaultDirName={pf}\{#MyAppName} ; 默认组名称,开始菜单中会用到这个名称
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes ; 打包后安装包的保存路径 - 打包后安装包的名称
OutputDir=output
OutputBaseFilename={#MyAppName} {#MyAppVersion} Compression=lzma
SolidCompression=yes ; 不允许重复安装
UsePreviousAppDir=no ; 安装包图标 & 卸载程序图标
SetupIconFile = bin\logo.ico
UninstallIconFile = bin\logo.ico ; 控制面板
UninstallDisplayIcon = {app}\logo.ico
Uninstallable=yes
UninstallDisplayName={#MyAppName} ; 签名
;SignTool=sha1
;SignTool=sha256 [Languages]
Name: "chinesesimp"; MessagesFile: "compiler:Languages\ChineseSimp.isl" [Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkablealone [Files]
; exe
Source: "bin\MJPGDriver.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "bin\TMaker.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "bin\amcap v3.0.9.exe"; DestDir: "{app}"; Flags: ignoreversion ; 多语言
Source: "bin\test3_zh.qm"; DestDir: "{app}"; Flags: ignoreversion
Source: "bin\test3_en.qm"; DestDir: "{app}"; Flags: ignoreversion
Source: "bin\test3_zh_fanti.qm"; DestDir: "{app}"; Flags: ignoreversion ; flt & ini
Source: "bin\video.flt"; DestDir: "{app}"; Flags: ignoreversion
Source: "bin\conf.ini"; DestDir: "{app}"; Flags: ignoreversion ; 图标
Source: ".\bin\logo.ico"; DestDir: "{app}"; Flags: ignoreversion
Source: ".\bin\logo.png"; DestDir: "{app}"; Flags: ignoreversion
Source: ".\bin\cursor.png"; DestDir: "{app}"; Flags: ignoreversion ; dll
Source: ".\bin\*.dll"; DestDir: "{app}"; Flags: ignoreversion ; 文件夹
Source: ".\bin\iconengines\*"; DestDir: "{app}\iconengines"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: ".\bin\imageformats\*"; DestDir: "{app}\imageformats"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: ".\bin\platforms\*"; DestDir: "{app}\platforms"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: ".\bin\styles\*"; DestDir: "{app}\styles"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: ".\bin\tessdata\*"; DestDir: "{app}\tessdata"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: ".\bin\TextHeadUp\*"; DestDir: "{app}\TextHeadUp"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: ".\bin\translations\*"; DestDir: "{app}\translations"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: ".\bin\worddirect\*"; DestDir: "{app}\worddirect"; Flags: ignoreversion recursesubdirs createallsubdirs [INI]
Filename: "{app}\conf.ini"; Section: "software"; Key: "isHW"; String: "1";
Filename: "{userappdata}\Eloam\Cfg\lib.ini"; Section: "EL";Key: "consoleLevel"; String: "0" ; [Registry]
Root: HKLM; Subkey: Software\VisualPresent; ValueType: string; ValueName: huyangTmaker; ValueData: '123456'; Flags: uninsdeletekey ; 解决重复安装
[code]
// 安装时,检查程序是否已经安装
function GetInstalledVersion(): String;
var
InstalledVersion: String;
begin
InstalledVersion :='';
RegQueryStringValue(HKLM, 'Software\VisualPresent', 'huyangTmaker', InstalledVersion);
Result := InstalledVersion;
end;
function InitializeSetup(): Boolean;
var
PrevVer: String;
ResultCode: Integer;
Ret: Boolean;
begin
PrevVer := GetInstalledVersion();
result := true;
if length(PrevVer) > 0
then
begin
//如果发现程序已经安装过了
MsgBox ('该软件已经安装过, 请先卸载后再进行安装.', mbError, MB_OK);
result := false;
end;
end; [Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\logo.ico"
Name: "{group}\{cm:UninstallProgram, {#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename:"{app}\logo.ico" [Run]
Filename: "{app}\MJPGDriver.exe"; Parameters: "/verysilent /norestart"; Description: "{cm:LaunchProgram, MJPGDriver}"; Flags:postinstall waituntilterminated skipifsilent
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
innoSetup打包文件编写模板的更多相关文章
- InnoSetup 打包Winform程序
在VS2012之前,我们做安装包一般都是使用VS自带的安装包制作工具来创建安装包的,VS2012.VS2013以后,微软把这个去掉,集成使用了InstallShield进行安装包的制作了,虽然思路差不 ...
- c++类模板分文件编写存在的问题
c++分文件编写的编译机制: 各个文件独立编译,如果在某.cpp文件中出现了函数调用,但是在此.cpp文件并没有对应函数的实现.此时就会在函数调用出生成特定的符号,在之后的链接过程完成函数调用. C+ ...
- c++类模板之分文件编写问题及解决
我们在实际项目中一般习惯头文件(.h)和源文件(.cpp)分开写,这样做的好处良多,但是如果遇到了类模板,这样可能会有一点儿问题. 我们通过一个例子来看: person.h: #pragma once ...
- Innosetup打包自动下载.net framework 动态库及替换卸载程序图标.
在使用了一段时间微软自带的安装包打包工具后,总感觉不太顺利,于是便想着找一种更简单稳定的打包工具,这类工具其实还不少,最终经过各种考量,我们选择了 InnoSetup , 该工具是一个完全免费的Win ...
- Pdf File Writer 中文应用(PDF文件编写器C#类库)
该文由小居工作室(QQ:2482052910) 翻译并提供解答支持,原文地址:Pdf File Writer 中文应用(PDF文件编写器C#类库):http://www.cnblogs.com/ ...
- Innosetup 设置文件的相对路径
在使用innosetup自动化打包的过程中,如果打包配置文件要随代码一起提交,则需要将打包文件改为相对路径,以便在其它端也可以直接打包,而不需要再次修改文件路径参数. 添加自动化打包文件 1. 添加b ...
- InnoSetup打包时出现Interal error: CallSpawnServer: Unexpected response: $0.错误的解决办法
如果在使用Innosetup打包软件时,如果出现Interal error: CallSpawnServer: Unexpected response: $0.错误, 如下图: 可以查看 Innose ...
- cmake使用总结(转)---工程主目录CMakeList文件编写
在linux 下进行开发很多人选择编写makefile 文件进行项目环境搭建,而makefile 文件依赖关系复杂,工作量很大,搞的人头很大.采用自动化的项目构建工具cmake 可以将程序员从复杂的m ...
- vue中自定义html文件的模板
如果默认生成的 HTML 文件不适合需求,可以创建/使用自定义模板. 一是通过 inject 选项,然后传递给定制的 HTML 文件.html-webpack-plugin 将会自动注入所有需要的 C ...
- 最简单的 K8S 部署文件编写姿势,没有之一!
1. 头疼编写K8S部署文件? K8S yaml 参数很多,需要边写边查? 保留回滚版本数怎么设? 如何探测启动成功,如何探活? 如何分配和限制资源? 如何设置时区?否则打印日志是GMT标准时间 如何 ...
随机推荐
- github.com/json-iterator/go 详细教程
最近接触到了 github.com/json-iterator/go , 是由滴滴开源的第三方json编码库,它同时提供Go和Java两个版本. 文中大量内容来自 github 上的 wiki 文档, ...
- 我的第一个项目(八):(解决问题)图片资源无法加载(Error: Cannot find module "../../xxx" )
好家伙,问题一堆 先开一个测试页模拟游戏模块的运行 原先的图片初始化方法失效了,(vue里面自然是用不了这种方法的) function createImage(src) { let img; if ...
- [golang] 变量声明和初始化 var, :=, new() 和 make()
[golang] 变量声明和初始化 var, :=, new() 和 make() 说明 go语言中,提供了多种变量声明和初始化的方法.这里着重一一说明.并提供一个简单的指南. 指南 使用make() ...
- Spring Cloud Zuul 获取当前请求的路由信息和路由后端的服务节点信息
基本思路 参考spring-cloud-zuul-ratelimit开源项目,在过滤器中根据当前的请求路径,判断当前的路由信息,当取得路由信息后,可以对服务的调用次数做统计等操作. 具体实现 创建一个 ...
- 【Azure Function App】如何修改Azure函数应用的默认页面呢?
问题描述 当在Azure中创建了一个函数应用(Function App)后,访问默认URL会得到一个默认的页面.是否有办法修改这个默认页面呢? 问题解答 在之前的博文中,介绍了修改App Servic ...
- PHP项目&变量覆盖&反序列化&未授权访问&身份验证
CNVD拿1day-验证&未授权-xhcms&Bosscms 此种漏洞由于没有什么关键函数,所以需要通过功能点去进行测试. Bosscms未授权访问 CNVD官网上搜索Bosscms未 ...
- STL-vector模拟实现
#pragma once #include<assert.h> #include<iostream> using std::cout; using std::endl; usi ...
- 从 HPC 到 AI:探索文件系统的发展及性能评估
随着 AI 技术的迅速发展,模型规模和复杂度以及待处理数据量都在急剧上升,这些趋势使得高性能计算(HPC)变得越来越必要.HPC 通过集成强大的计算资源,比如 GPU 和 CPU 集群,提供了处理和分 ...
- 单词本z ambition 雄心 amb = ab = about = around = 环绕
ambition 雄心 amb = ab = about = around = 环绕 it = go = 走 ion 名词 重点是 amb 环绕 这里是抽象含义 表示内心向外扩展 所以是雄心 ambu ...
- Navicat 通过 Http通道 连接远程 Mysql
https://jingyan.baidu.com/article/3d69c551aa54dff0cf02d7a0.html 注意本机ip填写 localhost