zoukankan      html  css  js  c++  java
  • Inno setup 简单打包,安装脚本,检查NET Framework 环境,删除环境安装文件

    ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING .ISS SCRIPT FILES!
    
    #define MyAppName "我的软件名GCH"
    #define MyAppVersion "1.0"
    #define MyAppPublisher "软件作者GCH"
    #define MyAppURL "作者网址GCH"
    #define MyAppExeName "MyGCH测试.exe"
    
    [Setup]
    AppName=XX科技
    AppVersion=2.5.0.0
    DefaultDirName=E:Dll	t
    
    OutputDir="E:Dll"
    
    [Types]
    Name: "full"; Description: "Full installation"
    Name: "compact"; Description: "Compact installation"
    Name: "custom"; Description: "Custom installation"; Flags: iscustom
    
    [Files]
    Source: "E:xxin*"; DestDir: "{app}";Excludes: "*.pdb" ;Flags: ignoreversion recursesubdirs createallsubdirs
    
    
    [code]
    function Framework45IsNotInstalled(): Boolean;
    var
      bSuccess: Boolean;
      regVersion: Cardinal;
    begin
      Result := True;
      bSuccess := RegQueryDWordValue(HKLM,'SOFTWAREMicrosoftNET Framework SetupNDPv4Full','Release',regVersion);
      if (True = bSuccess) and (regVersion >= 378389) then begin
        Result := False;
      end;
    end;
    
    procedure InstallFramework;
    var
      ResultCode: Integer;
      spath:string;
    begin
      spath:='{app}NDP461-KB3102436-x86-x64-AllOS-ENU.exe';
      if(FileOrDirExists(ExpandConstant(spath))) then 
        begin 
          Exec(ExpandConstant(spath), '', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
        end;
    end;
    
    procedure CurStepChanged(CurStep: TSetupStep);
    var   
     spath:string;
    begin
      case CurStep of
        ssPostInstall:
          begin
              if Framework45IsNotInstalled() then
              begin
                InstallFramework();
              end;
            spath:='{app}NDP461-KB3102436-x86-x64-AllOS-ENU.exe';
            DeleteFile(ExpandConstant(spath));
          end;
      end;
    end;

    Inno setup 安装脚本,检查NET Framework 环境,并删除安装文件

  • 相关阅读:
    ajaxUtil
    AJAX学习-----与 XML 文件进行交互式通信
    AJAX-----数据库实例
    AJAX学习-----服务器响应
    AJAX学习-----ASP/PHP 请求实例
    scrapy 反扒措施
    scrapy 中文官网学习
    scrapy 破解图片网站防盗链下载
    scrapy 随机中间件配置
    flask 邮件发送
  • 原文地址:https://www.cnblogs.com/china-guoch/p/8000686.html
Copyright © 2011-2022 走看看