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