c/c++ 软件集成 安装和可卸载软件
作为一个工程师应具备的一些能力:
1. 首先具备这款软件:
>inno Setup 免费版还开源,良心货,妥妥的。
2. 这款软件上手也比较款,可自行参考使用文档
3.编译成功,生成代码之后,样子可能如下:
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! #define MyAppName "My Program"
#define MyAppVersion "beta 1.0"
#define MyAppPublisher "精灵球网络科技有限公司, Inc."
#define MyAppURL "http://www.cnblogs.com/gongxijun/"
#define MyAppExeName "startup.bat" [Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{FA1B17D2-4CC5-465E-9A5F-DCA022B6EA1A}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
OutputDir=D:\Users\gxj\Desktop\TFriend
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes [Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl"
Name: "catalan"; MessagesFile: "compiler:Languages\Catalan.isl"
Name: "corsican"; MessagesFile: "compiler:Languages\Corsican.isl"
Name: "czech"; MessagesFile: "compiler:Languages\Czech.isl"
Name: "danish"; MessagesFile: "compiler:Languages\Danish.isl"
Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl"
Name: "finnish"; MessagesFile: "compiler:Languages\Finnish.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
Name: "greek"; MessagesFile: "compiler:Languages\Greek.isl"
Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl"
Name: "hungarian"; MessagesFile: "compiler:Languages\Hungarian.isl"
Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"
Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl"
Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl"
Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
Name: "scottishgaelic"; MessagesFile: "compiler:Languages\ScottishGaelic.isl"
Name: "serbiancyrillic"; MessagesFile: "compiler:Languages\SerbianCyrillic.isl"
Name: "serbianlatin"; MessagesFile: "compiler:Languages\SerbianLatin.isl"
Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl"
Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl" [Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: ,6.1 [Files]
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\startup.bat"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\_x64.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\_x64.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\_IA64.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\_x64.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\_x64.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\_x64.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\cmd5.obj"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\explorer1.obj"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\GetSysInfo.obj"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\GoodInf.obj"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\jietu.obj"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\json_reader.asm"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\json_value.asm"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\json_writer.asm"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\Kehu.Build.CppClean.log"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\Kehu.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\Kehu.log"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\Kehu.obj"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\Kehu.res"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\KehuDlg.obj"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\libmysql.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\MainMenu.obj"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\MyTracker.obj"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\News.obj"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\ScreepJieTu.obj"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\startup.bat"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\stdafx.obj"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\vc120.pdb"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Data\TFriend\RT\Kehu\x64\Release\WMI_DeviceQuery.obj"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files [Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon [Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: shellexec postinstall skipifsilent
3. 在集成的时候,有时,如果有特殊的条件需要集成运行库,那就得写下如下的批处理文件,并将要集成的运行库下载放到打包文件中,然后参考如下文件:
@echo off
::::::查询微软软件当前的注册表
set "HKLMU=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
reg query %HKLMU%\{6E8E85E8-CE4B-4FF5-91F7-04999C9FAE6A}>nul >nul&&set VC2005=Microsoft Visual C++ Redistributable X64
reg query %HKLMU%\{071C9B48-7C32--A0AC-3F809523288F}>nul >nul&&set VC2005=Microsoft Visual C++ SP1 Redistributable X64
reg query %HKLMU%\{6CE5BAE9-D3CA-4B99-891A-1DC6C118A5FC}>nul >nul&&set VC2005=Microsoft Visual C++ SP1 Redistributable ATL Security Update X64
reg query %HKLMU%\{03ED71EA-F531--AABD-1C31BCE8E187}>nul >nul&&set VC2005=Microsoft Visual C++ Redistributable IA64
reg query %HKLMU%\{0F8FB34E-675E-42ED-850B-29D98C2ECE08}>nul >nul&&set VC2005=Microsoft Visual C++ SP1 Redistributable IA64
reg query %HKLMU%\{-A784-46D8-950D-05CB3CA43A13}>nul >nul&&set VC2005=Microsoft Visual C++ SP1 Redistributable ATL Security Update IA64 if defined VC2005 (echo %VC2005% 已安装!&ping -n 127.1>nul) else (goto VC2005) :VC2005Install
@echo on
@echo 安装运行中.....请耐心等待!
:::::将运行库放置打包到和需要支持的软件一起
@if exist 2005_x64.exe (echo 开始安装..... &start 2005_x64.exe &ping -n 127.1 >nul) else (echo 没有找到安装包!请自己下载VC2005并按照 &goto QVC2008) :QVC2008
set "HKLMU=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
reg query %HKLMU%\{350AA351-21FA--8B7A-835434E766AD}>nul >nul&&set VC2008=Microsoft Visual C++ Redistributable X64
reg query %HKLMU%\{8220EEFE-38CD-377E-8595-13398D740ACE}>nul >nul&&set VC2008=Microsoft Visual C++ SP1 Redistributable X64
reg query %HKLMU%\{4B6C7001-C7D6--913E-5BC23FCE91E6}>nul >nul&&set VC2008=Microsoft Visual C++ SP1 Redistributable ATL Security Update X64
reg query %HKLMU%\{2B547B43-DB50--9EBE-37D419E0F5FA}>nul >nul&&set VC2008=Microsoft Visual C++ Redistributable IA64
reg query %HKLMU%\{5827ECE1-AEB0-328E-B813-6FC68622C1F9}>nul >nul&&set VC2008=Microsoft Visual C++ SP1 Redistributable IA64
reg query %HKLMU%\{977AD349-C2A8-39DD--285C08987C7B}>nul >nul&&set VC2008=Microsoft Visual C++ SP1 Redistributable ATL Security Update IA64 if defined VC2008 (echo %VC2008% 已安装!&ping -n 127.1>nul) else (goto VC2008)
@if exist 2008_x64.exe (echo 开始安装..... &start 2008_x64.exe &ping -n 127.1 >nul) else (echo 没有找到安装包!请自己下载VC2005并按照 &goto QVC2010) :QVC2010
@if exist 2010_IA64 (start 2010_IA64.exe) else goto CC
@echo 开始安装.....
@ping -n 127.1 >nul
:CC
@if exist 2012_x64.exe (start 2012_x64.exe) else goto DD
@echo 开始安装.....
@ping -n 127.1 >nul
:DD
@if exist 2013_x64.exe (start 2013_x64.exe) else goto EE
@echo 开始安装.....
@ping -n 127.1 >nul :EE
@if exist 2014_x64.exe (start 2014_x64.exe) else goto FF
@echo 开始安装.....
@ping -n 127.1 >nul :FF
@if exist Kehu.exe (start Kehu.exe) else echo 安装失败,请重新安装
@echo 按任意键结束.........
pause
@echo off
这样之后,当你点击生成的软件之后,它就会像我们以前首先的软件一样,成为一款正规的软件,具备安转,卸载,注册,以及自动检测运行库是否安装,并自动安装的软件了!!!


c/c++ 软件集成 安装和可卸载软件的更多相关文章
- Linux安装/卸载软件教程
一.源码安装 ./configure #环境检查.生成makefile make #编译 make install #安装 这三条命令是最经典的Linux软件安装,适用于所有发行版 二.软件包管理工具 ...
- ubuntu的dpkg命令安装和卸载软件
实际使用中,可以先到网上下载deb文件,然后用dpkg命令来安装. sudo dpkg -l | grep 360 #查看包含360的软件sudo dpkg -i browser360-cn-stab ...
- Linux 学习记录 五(软件的安装升级).
一.gcc gcc是Linux上面最标准的C语言的编译程序,用来源代码的编译链接. gcc -c hello.c 编译产生目标文件hello.o gcc -O hello.c 编译产生目标文件,并进行 ...
- Oracle客户端、服务的安装及干净卸载Oracle
软件下载地址: 链接:https://pan.baidu.com/s/1Sluf890eNuaV8muL55eO2w 提取码:oez7 服务端因文件过大,所以分了两个文件压缩包,下载后将内容解压后放置 ...
- 如何在Mac上安全彻底的卸载软件?
文章来源:知乎 收录于:风云社区(SCOEE)[提供mac软件下载] 更多专题,可关注小编[磨人的小妖精],查看我的文章,也可上[风云社区 SCOEE],查找和下载相关软件资源. (一)综合类: 新买 ...
- 一、Vim编辑器 二、用户和组管理 三、软件的安装(jdk,mysql) 四、Shell编程
一.Vim编辑器的使用 1. vim编辑器的运行模式 编辑模式:等待用户编辑命令的输入 插入模式:编辑文本内容 命令模式:执行命令 2. 使用 :vim 文件名 3. 查看当前vim编辑器介绍:vim ...
- Linux 学习记录五(软件的安装升级).
一.gcc gcc是Linux上面最标准的C语言的编译程序,用来源代码的编译链接. gcc -c hello.c 编译产生目标文件hello.o gcc -O hello.c 编译产生目标文件,并进行 ...
- Linux(ubuntu)软件的安装
通过apt安装/卸载软件 apt是advanced packaging tool,是Linxu下的一款安装包管理程序 可以在终端中方便的安装/卸载/更新软件包 # 安装软件 sudo apt inst ...
- PyCharm编程软件详细安装教程
PyCharm编程软件安装教程&破解 一.官网下载软件 1. 网页搜索进入PyCharm官网下载页面(https://www.jetbrains.com/pycharm/download/ ) ...
随机推荐
- 使用CMD命令设置IP
使用CMD命令设置IP,将下面文本保存为bat文件后执行 netsh interface ip set address name="本地连接" source=static addr ...
- js 除法 取整
js 除法 取整 1.丢弃小数部分,保留整数部分 js:parseInt(7/2) 2.向上取整,有小数就整数部分加1 js: Math.ceil(7/2) 3,四舍五入. js: Math.roun ...
- FIO是测试IOPS
FIO是测试IOPS的非常好的工具,用来对硬件进行压力测试和验证,支持13种不同的I/O引擎,包括:sync,mmap, libaio, posixaio, SG v3, splice, null, ...
- tomcat access log 参数
%a - 客户端IP地址 %A - 本机IP地址 %b - 发送字节数,不含HTTP头 如果为空是 '-' %B - 同上 %h - 客户端机器名 (如果connector的enableLookup ...
- luaprofiler探索
什么是luaprofiler? http://luaprofiler.luaforge.net/manual.html LuaProfiler is a time profiler designed ...
- 成都PC网站建设需要考虑哪些费用呢
亿合科技PC建设小编分享下:成都PC网站建设需要考虑哪些费用呢?随互联网的发展,越来越多人想建设自己网站,站长最关心的问题之一就是网站建设需要多少钱.每个网站建设的费用都是不一样的,但是都需要涵盖几个 ...
- zjuoj 3607 Lazier Salesgirl
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3607 Lazier Salesgirl Time Limit: 2 Sec ...
- git的那点事---
HEAD指向的版本就是当前版本,因此,Git允许我们在版本的历史之间穿梭,使用命令git reset --hard commit_id. 穿梭前,用git log可以查看提交历史,以便确定要回退到哪个 ...
- 使用 gulp 搭建前端环境入门篇(转载)
本文转载自: 使用 gulp 搭建前端环境入门篇
- 更快的方式实现PHP数组去重
数组去重的几种快捷方式: 1.//创建一个包含重复值的,一共四个元素的数组 $array = array('green','blue','orange','blue'); // 翻转数组,你将会 ...