innosetup完整脚本
#define MyAppName "Somarto"
#define MyAppVersion "1.0.0"
#define MyAppPublisher "XXXXXX有限公司"
#define MyAppURL "http://www.XXX.cn/"
#define MyAppExeName "Somarto.exe"
#define MyAppRegUninstall "Software\Microsoft\Windows\CurrentVersion\Uninstall\"
[Setup]
AppId={{A08292BB-197A-4DAE-A8E9-7D27155AD8A9}
AppName={#MyAppName}{#MyAppVersion}
AppVerName={#MyAppName}{#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\Somarto
VersionInfoCopyright=Copyright @ 2011 -2018 XXX. All Rights Reserved
DefaultGroupName={#MyAppName}
OutputDir=D:\CKM\Somarto\setup
OutputBaseFilename=Somarto-64
SetupIconFile=D:\CKM\Somarto\style\dns32.ico
Compression=lzma
SolidCompression=yes
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
[Languages]
;Name: "chinesesimp"; MessagesFile: "compiler:Default.isl"
;Name: "english"; MessagesFile: "compiler:Languages\English.isl"
Name: "englishsimp"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkablealone;
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkablealone
[Files]
Source: "D:\CKM\Somarto\bin\Debug\Somarto.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\SomartoGame.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\Coding4Fun.Kinect.WinForm.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\Coding4Fun.Kinect.Wpf.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\Fleck.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\FluorineFx.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\Fx.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\Somarto.exe.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\Kinect.Services.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\Kinect.Toolbox.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\log4net.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\log4net.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\CKM\Somarto\bin\Debug\sys.ini"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\CKM\Somarto\style\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
;Source: "*.*"; DestDir: "{app}"; Flags: recursesubdirs createallsubdirs; BeforeInstall: ChangeDisplay
; 注意: 不要在任何共享系统文件上使用“Flags: ignoreversion”
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Registry]
Root: HKLM; Subkey: "software\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "Somarto"; ValueData: "{app}\Somarto.exe"; Flags: uninsdeletevalue
;Root: HKLM; Subkey: "software\Somarto"; ValueType: string; ValueName: "Install"; ValueData: "{app}"; Flags: uninsdeletevalue
Root: HKLM; Subkey: "Software\Microsoft\Windows\CurrentVersion\Uninstall\{#MyAppName}"; ValueType:string;ValueName:"UninstallString";ValueData:"{app}\unins000.exe" ; Flags:uninsdeletekey
[Code]
var
hasRun:HWND;
resultCode: Integer;
resultStr:String;
function InitializeSetup(): Boolean;
begin
Result := True;
begin
if RegKeyExists(HKLM, '{#MyAppRegUninstall}{A08292BB-197A-4DAE-A8E9-7D27155AD8A9}_is1') then
begin
if MsgBox('安装程序检测到【Somarto】的一个版本已安装。'#13#10'选择“是”将覆盖安装。'#13#10'选择“否”退出安装程序,放弃安装。', mbConfirmation, MB_YESNO) = IDYES then
begin
hasRun := FindWindowByWindowName('Somarto');
while (hasRun <> 0) do
begin
MsgBox('【Somarto】的一个版本正在运行,'#13#10'应用程序将自动退出。',mbConfirmation, MB_OK);
PostMessage(hasRun,18,0,0);
Sleep(3);
hasRun :=0;
end;
Result := True;
end else
begin
Result := False;
exit;
end;
end;
end;
begin
if RegQueryStringValue(HKLM, '{#MyAppRegUninstall}{A08292BB-197A-4DAE-A8E9-7D27155AD8A9}_is1', 'UninstallString', ResultStr) then
begin
ResultStr := RemoveQuotes(ResultStr);
Exec(resultStr, '/VERYSILENT', '', SW_HIDE, ewWaitUntilTerminated, resultCode);
end;
end;
end;
procedure InitializeWizard();
begin
begin
WizardForm.WizardSmallBitmapImage.Top := ScaleY(0);
WizardForm.WizardSmallBitmapImage.Left := ScaleX(0);
WizardForm.WizardSmallBitmapImage.Width := WizardForm.MainPanel.Width;
WizardForm.WizardSmallBitmapImage.Height := WizardForm.MainPanel.Height;
WizardForm.PageNameLabel.width:=40; //设置标题文字显示的大小
WizardForm.PageDescriptionLabel.width:= 230; //设置标题文字显示的大小
end;
end;
function InitializeUninstall(): Boolean;
begin
begin
hasRun := FindWindowByWindowName('Somarto');
if hasRun<>0 then
begin
MsgBox('【Somarto】应用程序正在运行。' #13#10 '请先退出您的应用程序,然后再进行卸载。', mbInformation, MB_OK);
Result := false;
exit;
end;
end;
begin
DelTree(ExpandConstant('{app}'), True, True, True);
RegDeleteKeyIncludingSubkeys(HKEY_CURRENT_USER, 'Software\icc');
end;
Result := true;
end;
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
innosetup完整脚本的更多相关文章
- 使用inno setup打包程序完整脚本(.net框架检测,重复安装检测)
; 脚本由 Inno Setup 脚本向导 生成!; 有关创建 Inno Setup 脚本文件的详细资料请查阅帮助文档! #define MyAppName "小小鸟软件"#def ...
- unity 调整摄像机视角完整脚本
脚本作为组件挂在摄像机上即可,调用接口开关IsControlMove,控制是否启用: using System.Collections; using System.Collections.Generi ...
- InnoSetup跨脚本传参数
需求:在a.iss脚本传递参数给b.iss 举例: a.iss:传程序安装路径给b.iss Parameters: /Path={app} b.iss:接收a.iss传过来的安装路径 DefaultD ...
- LoadRunner脚本编写(转)
性能测试工程师要懂代码么?答案是必须的.好多测试员认为在loadrunner中编写脚本很难很牛X ,主要是大多测试人员并未做过开发工作,大学的那点程序基础也忘记的差不多了.还有非计算机专业出身的测试员 ...
- 投票系统 & 简易js刷票脚本
早就听说有什么刷票脚本,微博投票等等相关的投票都有某些人去刷票. 试一下吧,兴许自己也会刷票呢?捣鼓了几个小时,终于有所眉目. (1)投票系统 要刷票,就得先有个投票界面. 当然,可以直接去各个投票网 ...
- 实用防火墙(Iptables)脚本分析
实用防火墙(Iptables)脚本分析 --Redhat,CentOS,Ubuntu等常见Linux发行版中都会预装Iptables防火墙,大多数初学者设置起来由于对这款软件比较陌生,设置起来比较困难 ...
- JAVA嵌入运行Groovy脚本
摘自: http://shift-alt-ctrl.iteye.com/blog/1938238 . 最近设计一个数据统计系统,系统中上百种数据统计维度,而且这些数据统计的指标可能随时会调整.如果基于 ...
- 如何编写自己的Linux安全检查脚本?
因为本人工作中要涉及到很多东西,审计(日志.数据神马的).源代码审计.渗透测试.开发一大堆东西,有些东西,越是深入去做,越会发现,没有工具或脚本,工作起来是有多么的坑. 工作的这段时间,自己写了几个工 ...
- Centos 6.4上面用Shell脚本一键安装vsftpd
Centos 6.4上面用Shell脚本一键安装vsftpd install.sh #!/bin/bash if [ `uname -m` == "x86_64" ];then m ...
随机推荐
- (转载):ASCII,Unicode和UTF-8 编码
UTF-8是Unicode的一种实现方式,也就是它的字节结构有特殊要求,所以我们说一个汉字的范围是0X4E00到0x9FA5,是指unicode值,至于放在utf-8的编码里去就是由三个字节来组织,所 ...
- Git每次进入都需要输入用户名和密码的问题解决
解决方法: 在项目目录下输入以下命令: git config --global credential.helper store 使用git pull 的时候回提示再输下用户名和密码就行了.
- LeakCanary 原理浅析
前言 提到Java语言的特点,无论是教科书还是程序员一般都会罗列出面向对象.可移植性及安全等特点.但如果你是一位刚从C/C++转到Java的程序员,对Java语言的特性除了面向对象之外,最外直接的应当 ...
- 指定nvm的默认版本号
nvm alias default 8.9.4
- Django的事务性
Django默认是自动提交的 使用TestCase的每个test用例都是事务性的.如果不想这样,可以使用TransactionTestCase 替代 Django自动保证delete()/update ...
- @几种OutOfMemory异常
Java虚拟机运行时数据区 在Java虚拟机规范的描述中,除了程序计数器之外,虚拟机内存的其他几个运行时区域都会发生OutOfMemory异常的可能. 我们可以在IDE(如IDEA)中设置虚拟机启动参 ...
- Sicily 1388. Quicksum
http://soj.me/1388 又一道字符串的水题.... #include <iostream> #include <cstring> using namespace ...
- Cantor展开式
X=an*(n-1)!+an-1*(n-2)!+...+ai*(i-1)!+...+a2*1!+a1*0! 其中,a为整数,并且0<=ai<i(1<=i<=n).这就是康托展开 ...
- Linux下的串口编程实例
//串口相关的头文件 #include<stdio.h> /*标准输入输出定义*/ #include<stdlib.h> /*标准函数库定义*/ #in ...
- tensorflow语义分割api使用(deeplab训练cityscapes)
安装教程:https://github.com/tensorflow/models/blob/master/research/deeplab/g3doc/installation.md citysca ...