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标准时间 如何 ...
随机推荐
- kafka消费者的三种模式
几种不同的注册方式 subscribe方式:当主题分区数量变化或者consumer数量变化时,会进行rebalance:注册rebalance监听器,可以手动管理offset不注册监听器,kafka自 ...
- 【Azure 应用服务】如何为Web Jobs 安装Python包呢?
问题描述 WebJobs 怎么安装Python包? 问题解答 第一步:登录到App Service的高级管理工具(Kudu:https://<webappname>.scm.chinacl ...
- STM32标准库时钟树设置
STM32的系统时钟大致可以分为以下流程 1.外部晶振提供HSE高速外部时钟信号 2.HSE经过PLL锁相环,倍频后得到PLL_CLK高速内部时钟信号 3.PLL_CLK经过分频后得到系统时钟SYSC ...
- 如何当个优秀的文档工程师?从 TC China 看技术文档工程师的自我修养
本文系 NebulaGraph Community Academic 技术文档工程师 Abby 的参会观感,讲述了她在中国技术传播大会分享的收获以及感悟. 据说,技术内容领域.传播领域的专家和决策者们 ...
- redis 安装的参考文章
redis 安装 : https://www.runoob.com/redis/redis-install.html
- [程序] C++实现 http和https的反向代理程序
目录 前言 代理原理 http代理 https代理 实现 客户端 服务端 遇到的所有问题记录 Python对于回复不响应 接受的数据只有4字节 最终数据已经发给Python了 但是Python还是阻塞 ...
- [Python] 超简单的 超星学习通自动签到
目录 概述 代码 其他的 文件编码问题 windows 和 linux下换行符不同的问题 概述 今天两节课的签到都错过了 /(ㄒoㄒ)/~~ 所以决定花点时间做一个自动签到的工具 经过观察发现超星的结 ...
- 使用 Java 在Excel中创建下拉列表
下拉列表(下拉框)可以确保用户仅从预先给定的选项中进行选择,这样不仅能减少数据输入错误,还能节省时间提高效率.在MS Excel中,我们可以通过 "数据验证" 提供的选项来创建下拉 ...
- 孔夫子旧书网书籍信息得爬取并保存为json,csv,excel多种文件格式
python版本:3.7 需要得引入得包: from selenium import webdriver from selenium.common.exceptions import TimeoutE ...
- 【开源库推荐】#5 Android高亮引导库
原文:[开源库推荐]#5 Android高亮引导库 - Stars-One的杂货小窝 本文介绍2个高亮引导库HighLightPro和Curtain hyy920109/HighLightPro: A ...