2013-01-09 191 views

回答

5

您只能使用[RUN]部分的parameters和標準或自定義Checks。 記住關於設置prograriate Flags - waituntilterminated使安裝程序腳本等待,直到一個啓動完成它的行動,然後啓動下一個。

例子:

[Files] 
Source: "C:\MyInstallers\*"; DestDir: "{tmp}"; 
Flags: createallsubdirs recursesubdirs deleteafterinstall ignoreversion uninsremovereadonly 

[Run] 
Filename: "{tmp}\dotnetfx35.exe"; Parameters: "/q"; 
Flags: waituntilterminated skipifdoesntexist; 
StatusMsg: "Instalacja bibliotek Microsoft .NET Framework 3.5 SP1..."; 
OnlyBelowVersion: 0,6.2.8400; Check: NET35 

Filename: "{tmp}\vcredist_x86.exe"; Parameters: "/Q"; 
Flags: waituntilterminated skipifdoesntexist; 
StatusMsg: "Instalacja bibliotek Microsoft Visual C++ 2008 (x86)..."; 
Check: not Is64BitInstallMode 

Filename: "{tmp}\vcredist_x64.exe"; Parameters: "/Q"; 
Flags: waituntilterminated skipifdoesntexist; 
StatusMsg: "Instalacja bibliotek Microsoft Visual C++ 2008 (x64)..."; 
Check: Is64BitInstallMode 

Filename: "{tmp}\directx\DXSETUP.exe"; Parameters: "/silent"; 
Flags: waituntilterminated skipifdoesntexist; 
StatusMsg: "Instalacja bibliotek Microsoft DirectX..." 

Filename: "{app}\{#MyAppExeName}"; WorkingDir: "{app}\"; 
Flags: nowait postinstall runascurrentuser skipifsilent; 
Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}" 
+0

謝謝您的回答。這個腳本似乎是Inno腳本。 你能告訴我如何添加EXE並將它們放入臨時目錄嗎?我從未與Inno合作過。 –

+0

我已經添加了'[Files]'部分。你只需要將文件複製到'{tmp}'。安裝過程完成後,放置在安裝程序「{tmp}」中的所有文件都將被刪除。在C:\ MyInstallers中,我想要在'[Run]'部分中調用所有其他安裝程序(在子文件夾中使用DirectX)。 – RobeN

2

NSIS:

Section 
InitPluginsDir ; $pluginsdir is a folder in %temp%, it is deleted for you when the installer ends 
SetOutPath $PluginsDir 

File "child1.exe" 
ExecWait '"$PluginsDir\child1.exe" /foo "/bar" /baz' 
Delete "$PluginsDir\child1.exe" ; Optional, might be a good idea if the file is large... 

File "child2.exe" 
ExecWait '"$PluginsDir\child2.exe"' 

SetOutPath $Temp ; Don't lock $PluginsDir 
SectionEnd 
+0

非常感謝您的幫助! –

0

在innosetup你也可以安裝其他與ShellExec-功能。有了它,你可以定義它是否應該在前面,並且主要安裝是否應該等到這個子安裝完成。

這裏很短的例子,在那裏我開始sqltools安裝在代碼段

if ShellExec('',INSTALL_FOLDER + '\FPS\contributed\sqlncli_x64.msi', '' ,'',SW_HIDE,ewWaitUntilTerminated,ResultCode) then 
    begin 
     Log('executed sql native client with result code ' + IntToStr(ResultCode) + ' this means ' + SysErrorMessage(ResultCode)); 
    end 
    else 
    begin 
     showError(CustomMessage('SQLNATIVE_CLIENT_ABORTED') + SysErrorMessage(ResultCode)); 
    end; 
相關問題