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/ ) ...
随机推荐
- 使用Java字节流拷贝文件
本文给出使用Java字节流实现文件拷贝的例子 package LearnJava; import java.io.*; public class FileTest { public static vo ...
- JQuery html API支持解析执行Javascript脚本功能实现-代码分析
JQuery html用法(功能类似innerHTML) 开发中需要使用Ajax技术来更新页面局部区域, 使用的方法是ajax获取html代码段(字符串),然后将这个html代码段作为参数,传入目标D ...
- Bootstrap modal被sliverlight掩盖。
Bootstrap中的modal被silverlight遮挡了,解决方案: <object id='xx'....> ... <param name="windowless ...
- 什么是JSP?它有哪些特点?
什么是JSP? 它有哪些特点? JSP是服务器端的一种基于java语言的网页技术,它是由一些JSP标记,java程序段以及HTML文件组成的结合体,以java语言作为其内置的脚本语言. 实质上是通 ...
- jQuery文字特效制作文字鼠标滑过多彩色变色显示
<!DOCTYPE html><head> <meta http-equiv="Content-Type" content="text/ht ...
- HttpClient_001_初步实现项目01的servlet,与项目02的servlet,之间数据访问
HttpClient_001_初步实现项目01的servlet,与项目02的servlet,之间数据访问 代码下载地址: http://download.csdn.net/detail/poiuy19 ...
- 《zw版·Halcon-delphi系列原创教程》 Halcon分类函数008,matrix,矩阵函数
** 3dFromFundamentalMatrix( Rows1, Cols1, Rows2, Cols2, CovRR1, CovRC1, CovCC1, CovRR2, CovRC2, CovC ...
- 【转】ecshop后台语言项执行漏洞详解
该漏洞需要能登录ecshop后台权限,简单修改下语言项目,即可在网站植入木马后门. 以下是详细分析 1.登陆到ecshop台后,选择模板管理,语言项编辑,搜索用户信息 为什么要搜索用户 该漏洞需要能登 ...
- 一个解决chrome浏览器下input标签当autocomplete的时候背景变黄色同时input背景图片消失方案
最近在改一个bug即如标题所讲的一样,chrome浏览器下当input标签开启autocomplete的时候input的背景颜色变黄同时在input的背景图片也被覆盖了.为此百度了好久发现网上说的使用 ...
- Ajax中dataType数据类型
今天项目中使用Ajax向后台保存数据,其中dataType为'json';当请求成功后,没有走success回调,反而走了error:数据库已经成功保存数据了. 后来搞半天才知道原来dataType指 ...