Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Setup]
- AppName=My Program
- AppVersion=1.5
- DefaultDirName={pf}\My Program
- [Files]
- ; dontcopy flag tells the installer to not copy the file during installation
- Source: "D:\vcredist_x64.exe"; Flags: dontcopy
- [Tasks]
- Name: vcredist_x64; Description: Install Visual C++; Flags: unchecked
- [Code]
- function PrepareToInstall(var NeedsRestart: Boolean): string;
- var
- ResultCode: Integer;
- begin
- // if the task for this installer is checked, then...
- if IsTaskSelected('vcredist_x64') then
- begin
- // extract the file from the setup archive to the temporary folder
- ExtractTemporaryFile('vcredist_x64.exe');
- // execute the extracted file; if the execution failed, return an error message to stop the installation
- if not Exec(ExpandConstant('{tmp}\vcredist_x64.exe'), '', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
- begin
- Result := Format('Installing VC++ redist failed with code %d.', [ResultCode]);
- Exit;
- end;
- end;
- // you can repeat the similar code for other installers, or better make some common function for this code block
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement