0
私はdotnet framework 3.5を前提条件としてインストールしています。以下は私のコードです。 このコードを実行すると、以下のエラーが発生します。 「tmp」フォルダがファイルを認識しない理由を教えていただけますか? EDIT このサンプルコードで説明したように、 "BeforeInstall"の代わりに "AfterInstall"を使用していて、うまくいきました。ファイルがinno setupの前提条件としてフレームワークをインストールするときにtmpフォルダに見つかりませんでした
私は、私は以下のようにパスを発見した定数を評価します。
[Files]
Source: "dotnetfx35setup.exe"; DestDir: {tmp}; Flags: deleteafterinstall; BeforeInstall: Install35Framework; Check: Framework35IsNotInstalled
[Code]
function Framework35IsNotInstalled: Boolean;
begin
if IsDotNetDetected('v3.5' , 1) then
begin
Result := False;
end else begin
Result := True;
end;
end;
procedure Install35Framework;
var
StatusText: string;
ResultCode: Integer;
begin
StatusText := WizardForm.StatusLabel.Caption;
WizardForm.StatusLabel.Caption := 'Installing .NET framework 3.5...';
WizardForm.ProgressGauge.Style := npbstMarquee;
try
if not Exec(ExpandConstant('{tmp}\dotnetfx35setup.exe'), '/q /norestart', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
begin
{ you can interact with the user that the installation failed }
MsgBox('.NET framework 3.5 installation failed with code: ' + SysErrorMessage(ResultCode) + '.',mbError, MB_OK);
end;
finally
WizardForm.StatusLabel.Caption := StatusText;
WizardForm.ProgressGauge.Style := npbstNormal;
end;
end;
私の答えはあなたを助けましたか? –