【发布时间】:2014-06-13 10:59:42
【问题描述】:
我正在为我的 nodewebkit 应用程序准备一个窗口安装程序。 这是一个使用 Three.js 的应用程序,因此需要 DirectX。
如何修改我的 installer.iss 以在我的应用程序之前(或之后,不重要)安装 DirectX?
我有:
[Code]
function installDirectX() : Boolean;
begin
....
end;
[Run]
Filename "{app}\{#MyAppName}"; Description: "...."; Flags: nowait postinstall skipfsilent
更多规格
基本上我想在安装程序中包含directx.exe,但我也想启动directx.exe(仅当尚未安装-但这是一个加号-)
更新
RobeN 建议我尝试:
[Files]
Source: "path\dxsetup.exe"; DestDir: "{app}"
[Run]
Filename: "dxsetup.exe"; WorkingDir: "{app}"; Parameters: "/silent"; Flags: waitilterminated skipifdoesntexist; StatusMsg: "Installing Microsoft DirectX..."
但还是不行..
解决方案 1:
此应用程序安装后(始终)启动 DirectX 安装程序。
[Files]
Source: "dxsetup.exe"; DestDir: "{app}"; AfterInstall: DirecXinstaller
[Code]
procedure DirecXinstaller;
var
ResultCode: Integer;
begin
if not Exec(ExpandConstant('{app}\dxsetup.exe'), '', '', SW_SHOWNORMAL,
ewWaitUntilTerminated, ResultCode)
then
MsgBox('Other installer failed to run!' + #13#10 +
SysErrorMessage(ResultCode), mbError, MB_OK);
end;
【问题讨论】:
-
no.. 我不明白我必须在哪里调用 installDirecX
-
是的。 Deanna 显示的代码是从
PrepareToInstall事件执行的,该事件在安装本身开始之前运行,因此在安装您的应用程序之前(当然,如果您遵循常见做法)。 -
@RobeN,这也是重复问题中的答案所说的。这个问题无非是重复的。在这种情况下,您应该投票关闭它,并有选择地改进那里的答案(如果您觉得它需要一个代码示例)。
-
@Velthune,但您链接的帖子中的代码会将安装程序复制到
{app}文件夹中。这是期望的行为吗?你真的应该更好地描述你的目标是什么,最好是一步一步来。如果您对现有脚本有疑问,请将其相关部分也包含在您的问题中。
标签: web-applications installation inno-setup node-webkit