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 环境,并删除安装文件

  • 相关阅读:
    效果1时间展示隐藏
    css书写轮播图样式
    jquery案例1导航栏事件
    jquery案例三导航展示
    go并发
    效果2滑动滑入效果
    php解决导出大数据execl问题
    jquery案例3模仿京东轮播图
    jquery案例2手风琴案例
    latex自适应resize超长表格
  • 原文地址:https://www.cnblogs.com/china-guoch/p/8000686.html
Copyright © 2011-2022 走看看