首页 > 其他分享 >inno setup compiler 6.2.0

inno setup compiler 6.2.0

时间:2023-10-25 19:33:20浏览次数:28  
标签:begin end success setup version 6.2 install inno versionRelease

; -- Example1.iss --
; Demonstrates copying 3 files and creating an icon.

; SEE THE DOCUMENTATION FOR DETAILS ON CREATING .ISS SCRIPT FILES!

[Setup]
AppName=RouteEMT
AppVersion=v1.0.0
WizardStyle=modern
DefaultDirName={autopf}\RouteEMTV1.0.0
DefaultGroupName=RouteEMTV1.0.0
UninstallDisplayIcon={app}\uninstall_RouteEMTV1.0.0.exe
Compression=lzma2
SolidCompression=yes
OutputDir=userdocs:Inno Setup Examples Output
ShowLanguageDialog = yes
[Languages]
Name: "chinese"; MessagesFile: "compiler:Languages\Chinese.isl"

[Files]
Source: "RouteEmt.exe"; DestDir: "{app}"
Source: "路由器返修配置.xml"; DestDir: "{app}"
Source: "WinPcap_4_1_1.exe"; DestDir: "{app}"
[Run]
Filename: "{app}\WinPcap_4_1_1.exe"; Check: ShouldInstall
[Code]


function ShouldInstall: Boolean;
var
  Version: String;
  install: cardinal;
begin
  // 检查软件版本是否已安装
  if RegQueryDWordValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full', 'Install', install) then
  begin
      // 已经安装了最新版本,不需要再次安装
      MsgBox(Format('install is %d.', [install]), mbInformation, MB_OK);
      Result := (install =1);
      Exit;
  end;

  Result := True;
end;

procedure AfterMyProgInstall(S: String);
var
  FileName: String;
  ResultCode: Integer;
begin
  Log('AfterMyProgInstall(''' + S + ''') called');
  //MsgBox('AfterMyProgInstall:' #13#13 'Setup just installed ' + S + ' as ' + CurrentFileName + '.', mbInformation, MB_OK);
  //MsgBox('安装程序将要安装: ' + S  + ',如果已经安装,程序会给出提示', mbInformation, MB_OK);
  FileName := ExpandConstant('{app}')+'\'+S;
  if not Exec(FileName, '', '', SW_SHOWNORMAL, ewNoWait, ResultCode) 
  then  
    MsgBox('依赖安装失败:' +S,mbInformation,MB_OK);
end;


 function IsDotNetDetected(version: string; service: cardinal): boolean;
 
 var
     key, versionKey: string;
     install, release, serviceCount, versionRelease: cardinal;
     success: boolean;
 begin
     versionKey := version;
     versionRelease := 0;
 
     // .NET 1.1 and 2.0 embed release number in version key
     if version = 'v1.1' then begin
         versionKey := 'v1.1.4322';
     end else if version = 'v2.0' then begin
         versionKey := 'v2.0.50727';
     end
 
     // .NET 4.5 and newer install as update to .NET 4.0 Full
     else if Pos('v4.', version) = 1 then begin
         versionKey := 'v4\Full';
         case version of
           'v4.5':   versionRelease := 378389;
           'v4.5.1': versionRelease := 378675; // 378758 on Windows 8 and older
           'v4.5.2': versionRelease := 379893;
           'v4.6':   versionRelease := 393295; // 393297 on Windows 8.1 and older
           'v4.6.1': versionRelease := 394254; // 394271 on Windows 8.1 and older
           'v4.6.2': versionRelease := 394802; // 394806 on Windows 8.1 and older
         end;
     end;
 
     // installation key group for all .NET versions
     key := 'SOFTWARE\Microsoft\NET Framework Setup\NDP\' + versionKey;
 
     // .NET 3.0 uses value InstallSuccess in subkey Setup
     if Pos('v3.0', version) = 1 then begin
         success := RegQueryDWordValue(HKLM, key + '\Setup', 'InstallSuccess', install);
     end else begin
         success := RegQueryDWordValue(HKLM, key, 'Install', install);
     end;
 
     // .NET 4.0 and newer use value Servicing instead of SP
     if Pos('v4', version) = 1 then begin
         success := success and RegQueryDWordValue(HKLM, key, 'Servicing', serviceCount);
     end else begin
         success := success and RegQueryDWordValue(HKLM, key, 'SP', serviceCount);
     end;
 
     // .NET 4.5 and newer use additional value Release
     if versionRelease > 0 then begin
         success := success and RegQueryDWordValue(HKLM, key, 'Release', release);
         success := success and (release >= versionRelease);
     end;
 
     result := success and (install = 1) and (serviceCount >= service);
 end;
 
 
 function InitializeSetup(): Boolean;
 var Path:string;
 ResultCode: Integer;
 begin
     if not IsDotNetDetected('v4.5', 0) then begin
         ExtractTemporaryFile('NDP452-KB2901907-x86-x64-AllOS-ENU.exe');
         Exec(ExpandConstant('{tmp}\NDP452-KB2901907-x86-x64-AllOS-ENU.exe'), '', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
         result := true;
     end else
         result := true;
 end;

[Icons]
Name: "{group}\RouteEMTV1.0.0"; Filename: "{app}\RouteEmt.exe"

 

标签:begin,end,success,setup,version,6.2,install,inno,versionRelease
From: https://www.cnblogs.com/cnchengv/p/17787965.html

相关文章

  • 《打包篇》Setup Factory打包去掉协议
    参考链接:https://blog.csdn.net/Pei_hua100/article/details/121605056其他内容可以去参考链接看,非常有用!......
  • 《打包篇》Setup Factory使用
    打包参考链接:https://blog.csdn.net/yujing1314/article/details/858404981.打开软件之后直接点OK创建新项目(也可以使用之前自己保留的项目)2.直接点下一步3.点下一步(选择系统,安装软件的电脑是64位的需要选一下64-bit)4.选择需要打包的程序的路径,选择UI-bin-Debug路径(下面的......
  • InnoDB 存储引擎之 Buffer Pool
    Mysql5.7InnoDB存储引擎整体逻辑架构图一、BufferPool概述InnoDB作为一个存储引擎,为了降低磁盘IO,提升读写性能,必然有相应的缓冲池机制,这个缓冲池就是BufferPool为了方便理解,对于磁盘上的数据所在的页,叫做数据页,当数据页加载进BufferPool之后,叫做缓存页,......
  • 504-602 API资源对象PV和PVC (Pod亲和性 反亲和性 污点与容忍度 API资源对象PV和PVC)5
    一、Pod亲和性1.1 针对对象为Pod,目的是实现,新建Pod和目标Pod调度到一起,在同一个Node。podAffinity示例apiVersion:v1kind:Podmetadata:name:testpod01namespace:prodlabels:app:myapp01env:test1spec:containers:-name:testpod01i......
  • centos 6.10 安装 readline 6.2.0
    centos6.10安装readline6.2.0下载地址解压文件cdreadline-6.2./configure-prefix/usr/local/readline-6.2make&&makeinstall安装完成......
  • The innodb_system data file 'ibdata1' must be writable
    安装mysql-5.7.32数据库时,MySQL无法启动Active:deactivating(stop-sigterm)(Result:exit-code)查看配置文件中的日志存储位置:view/etc/my.cnf查看日志存储文件位置:/var/log/mysqld.log文件错误提示:Theinnodb_systemdatafile'ibdata1'mustbew......
  • 16.2 ARP 主机探测技术
    ARP(AddressResolutionProtocol,地址解析协议),是一种用于将IP地址转换为物理地址(MAC地址)的协议。它在TCP/IP协议栈中处于链路层,为了在局域网中能够正确传输数据包而设计,由协议数据单元和对应的操作命令组成。ARP既可以由操作系统处理,也可以由网卡处理。该协议的作用是通过一......
  • Vue3 typescript script setup获取范型组件的ref
    原博客地址:https://juejin.cn/post/7247433208437850169?from=search-suggest在typescript下,如果想获取带类型的组件模板引用,官方文档中说明了方式:https://cn.vuejs.org/guide/typescript/composition-api.html#typing-component-template-refsconstmodal=ref<InstanceTy......
  • Vue3.2中setup语法糖的使用教程分享
    这篇文章主要为大家详细介绍了Vue3.2中setup语法糖的具体使用方法,文中的示例代码讲解详细,对我们深入了解Vue有一定的帮助,需要的可以参考一下目录2、data数据的使用3、method方法的使用4、watchEffect的使用5、watch的使用6、computed计算属性的使用7、props父子传值的使用8、emit......
  • MySQL的InnoDB引擎的事务
    康师傅YYDSMySQL中只有InnoDB支持事务1SHOWENGINES;事务基础知识事务的ACID特性原子性(atomicity):原子性是指事务是一个不可分割的工作单位,要么全部提交,要么全部失败回滚。一致性(consistency):根据定义,一致性是指事务执行前后,数据从一个合法性状态变换到另外一个合法性......