inno setup打包.netframework

[Files]
.........
Source: "F:/路径/dotnetfx20.exe"; DestDir: "{tmp}"; Flags: ignoreversion
; 友情提示:dotnetfx20.exe并不会拷贝到安装后的目录中,而是在临时目录中,这样重启机器之后就会被删除掉

[code]
function CheckDotNet2_0():boolean;
begin
Result:=not RegKeyExists(HKLM, 'SOFTWARE/Microsoft/.NETFramework/policy/v2.0');
end;

function InitializeSetup(): Boolean;
var Path:string;
    ResultCode: Integer;
begin
  if CheckDotNet2_0() then
  begin
    ExtractTemporaryFile('dotnetfx20.exe');
    Exec(ExpandConstant('{tmp}/dotnetfx20.exe'), '', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
  end;
  Result:=true;
end;

原文地址:https://www.cnblogs.com/hyruur/p/2696386.html