现在打包主要是使用 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打包文件编写模板的更多相关文章

  1. InnoSetup 打包Winform程序

    在VS2012之前,我们做安装包一般都是使用VS自带的安装包制作工具来创建安装包的,VS2012.VS2013以后,微软把这个去掉,集成使用了InstallShield进行安装包的制作了,虽然思路差不 ...

  2. c++类模板分文件编写存在的问题

    c++分文件编写的编译机制: 各个文件独立编译,如果在某.cpp文件中出现了函数调用,但是在此.cpp文件并没有对应函数的实现.此时就会在函数调用出生成特定的符号,在之后的链接过程完成函数调用. C+ ...

  3. c++类模板之分文件编写问题及解决

    我们在实际项目中一般习惯头文件(.h)和源文件(.cpp)分开写,这样做的好处良多,但是如果遇到了类模板,这样可能会有一点儿问题. 我们通过一个例子来看: person.h: #pragma once ...

  4. Innosetup打包自动下载.net framework 动态库及替换卸载程序图标.

    在使用了一段时间微软自带的安装包打包工具后,总感觉不太顺利,于是便想着找一种更简单稳定的打包工具,这类工具其实还不少,最终经过各种考量,我们选择了 InnoSetup , 该工具是一个完全免费的Win ...

  5. Pdf File Writer 中文应用(PDF文件编写器C#类库)

    该文由小居工作室(QQ:2482052910)    翻译并提供解答支持,原文地址:Pdf File Writer 中文应用(PDF文件编写器C#类库):http://www.cnblogs.com/ ...

  6. Innosetup 设置文件的相对路径

    在使用innosetup自动化打包的过程中,如果打包配置文件要随代码一起提交,则需要将打包文件改为相对路径,以便在其它端也可以直接打包,而不需要再次修改文件路径参数. 添加自动化打包文件 1. 添加b ...

  7. InnoSetup打包时出现Interal error: CallSpawnServer: Unexpected response: $0.错误的解决办法

    如果在使用Innosetup打包软件时,如果出现Interal error: CallSpawnServer: Unexpected response: $0.错误, 如下图: 可以查看 Innose ...

  8. cmake使用总结(转)---工程主目录CMakeList文件编写

    在linux 下进行开发很多人选择编写makefile 文件进行项目环境搭建,而makefile 文件依赖关系复杂,工作量很大,搞的人头很大.采用自动化的项目构建工具cmake 可以将程序员从复杂的m ...

  9. vue中自定义html文件的模板

    如果默认生成的 HTML 文件不适合需求,可以创建/使用自定义模板. 一是通过 inject 选项,然后传递给定制的 HTML 文件.html-webpack-plugin 将会自动注入所有需要的 C ...

  10. 最简单的 K8S 部署文件编写姿势,没有之一!

    1. 头疼编写K8S部署文件? K8S yaml 参数很多,需要边写边查? 保留回滚版本数怎么设? 如何探测启动成功,如何探活? 如何分配和限制资源? 如何设置时区?否则打印日志是GMT标准时间 如何 ...

随机推荐

  1. matrox的RAP4G4C12 CXP采集卡软件安装

    Hello-FPGA info@hello-fpga.cOM matrox的RAP4G4C12 CXP采集卡软件安装 目录 matrox的RAP4G4C12 CXP采集卡软件安装 4 1 前言 4 2 ...

  2. PbRL | Preference Transformer:反正感觉 transformer 很强大

    论文题目:Preference Transformer: Modeling Human Preferences using Transformers for RL,ICLR 2023,5 6 6 8, ...

  3. 2、zookeeper的简单命令

    Zookeeper的常用命令本篇不包括权限acl相关以及集群相关,那些要另开篇章.使用的版本是Zookeeper3.4.14,不同版本会有一定的差异性. 节点的存储信息 新增命令 语法:create ...

  4. Vue.prototype.$app = this vscode ctrl 点击 不跳转

    Vue.prototype.$app = this vscode ctrl 点击 不跳转 解决思路 src/types/vue.d.ts 里面写,具体还没解决,找到一篇 在js里面的 我这种直接将当前 ...

  5. vscode 自动格式化md文件,搞得很是郁闷,加入 [markdown] 自定义配置 "editor.formatOnSave": false 搞定了。

    上下文: vscode做vue的项目开发,需要对代码进行格式化,用的vetur插件 正常来讲,代码保存的时候,需要进行格式化,所以配置文件会写成 "editor.formatOnSave&q ...

  6. 制作B站直播简介

    本文只用于个人总结备份,如果对你有帮助就更好了. 准备工作 准备好简介要用的的背景图.头像图,上传到图床生成图片链接. 简介的内容可分为主播简介.直播时间.直播内容.联系方式,内容根据实际需要修改,需 ...

  7. C#之winform捕获Console.WriteLine内容到日志文件

    问题描述 之前接手同事的项目,是一个类似于服务端后台的Winform程序,主界面隐藏起来,只再任务栏显示程序图标. 整个项目里面没有日志记录功能,全靠Console.WriteLine打印信息.自己调 ...

  8. Apollo3-Blue-MCU芯片典型硬件电路解析

    一 芯片简介 1.简介 Apollo3 Blue Wireless SoC是一款超低功耗无线mcu芯片,它的运行功耗降至6μA/ MHz以下.该器件采用ARM Cortex M4F内核,运行频率高达9 ...

  9. 一个简易的ORM框架的实现(一)

    一个简易的ORM框架的实现 ORM ORM---操作数据库---对象关系映射 ORM(Object Relational Mapping)框架采用元数据来描述对象与关系映射的细节.只要提供了持久化类与 ...

  10. day01-项目介绍与环境搭建

    项目介绍与环境搭建 1.项目学习前置知识 Java基础知识 javaweb MySQL SpringBoot SSM(Spring,SpringMVC,MyBatis) Maven 2.学习收获 了解 ...