[英]Inno-Setup: Post Install open link: antivirus alert while opening a link
[英]How to install DirectX redistributable from Inno-setup?
在Inno-Setup網站上找不到關於DirectX安裝的任何提示。 那么,有任何示例安裝腳本嗎? 我知道我必須在[Run]部分添加如下內容:
Filename: "{src}\DirectX\DXSETUP.exe"; WorkingDir: "{src}\DirectX"; Parameters: "/silent"; Check: DirectX; Flags: waituntilterminated; BeforeInstall: DirectXProgress;
但是如何將其包含在安裝文件(臨時文件夾?)中,如何將其提取等?
要將其包括在設置中,您可以將其安裝到{tmp}
,然后從那里[Run]
。
安裝這種要求的正確方法是提取代碼並在PrepareToInstall()
事件函數中對其調用Exec()
:
function PrepareToInstall(var NeedsRestart: Boolean): String;
var
InstallerResult: integer;
begin
//Check if .Net is available already
if NeedsDirectX() then begin
ExtractTemporaryFile('DXSETUP.exe');
if Exec(ExpandConstant('{tmp}\DXSETUP.exe'), '', '', SW_SHOW, ewWaitUntilTerminated, InstallerResult) then begin
case InstallerResult of
0: begin
//It installed successfully (Or already was), we can continue
end;
else begin
//Some other error
result := 'DirectX installation failed. Exit code ' + IntToStr(InstallerResult);
end;
end;
end else begin
result := 'DirectX installation failed. ' + SysErrorMessage(InstallerResult);
end;
end;
end;
ISXKB上有一篇有關如何檢測已安裝版本的文章 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.