我正在准备一个 inno 设置来同时安装一个 windows 窗体应用程序和一个 office 插件。我在安装期间部署了所有 Windows 窗体文件(exe 和 dll)和 office 插件部署文件,一切正常。但最后,当office插件“setup.exe”仍在运行时,我得到了“安装完成”屏幕。我不关心在后台看到其他安装的运行或弹出窗口,但我不喜欢在其他应用程序运行时 inno 设置说“完成”。
这是我的代码:
[Run]
Filename: "{app}\AddIn\Deploy\setup.exe"; Flags: waituntilterminated runminimized
Filename: "{app}\MyApp.exe"; Description: {cm:LaunchProgram,{cm:MyAppName}}; Flags: nowait postinstall
所以,它不服从“runminimized”,无论如何我都很好......但它也不服从“waituntilterminated”,我很在意。
请注意,“AddIn\Deploy\setup.exe”是 Visual Studio 通过 office 插件的“发布”向导生成的文件。
如果我只能运行此代码,我会很高兴:
[code]
function PrepareToInstall(var NeedsRestart: Boolean): String;
var
ResultCode : Integer;
begin
if Exec(ExpandConstant('{app}\AddIn\Deploy\setup.exe'), '', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
begin
Result := 'AddIn Installed';
end
else
Result := 'AddIn NOT Installed';
NeedsRestart := false;
end;
但是,我必须在主 inno 安装程序将文件复制到“AddIn\Deploy”目录之后立即运行......所以,我可能只需要正确的事件来覆盖。