2013-08-12 40 views
4

我想將服務文件複製到{app}目錄,然後將其用作InstallUtil.exe中的參數。在inno setup中運行InstallUtil {app} /file.exe

下面是我的一些代碼部分:

[Files] 
Source: WCFService.exe; DestDir: {app} 
Source: WCFService.exe.config; DestDir: {app} 

[Run] 
Filename: {dotnet40}\InstallUtil.exe; Parameters: {app}\WCFService.exe 

此代碼不能正常工作(但文件複製到{}的應用程序目錄正確)。但是,如果我使用這樣的東西:

[Files] 
Source: WCFService.exe; DestDir: {src} 
Source: WCFService.exe.config; DestDir: {src} 

[Run] 
Filename: {dotnet40}\InstallUtil.exe; Parameters: WCFService.exe 

它工作正常。有誰知道發生了什麼事? 我必須使用inno設置。

+2

也許你應該把'{app} \ WCFService.exe'放在引號中''「''?或者,也許你應該將'WorkingDir'設置爲'{app}'? – RobeN

+0

我試了一下,它的工作! 代碼: [運行] 文件名:{dotnet40} \ InstallUtil.exe; WorkingDir:{app};參數:WCFService.exe 非常感謝,隊友:)! –

回答

4

在這種情況下,您可以嘗試在[Run]部分中將WorkingDir參數設置爲{app}。 像這樣:

[Run] 
Filename: "{dotnet40}\InstallUtil.exe"; WorkingDir: "{app}"; Parameters: "WCFService.exe" 
4

{app}可能會包含空格,因此必須使用在命令行,當它被正確引用:

[Run] 
Filename: {dotnet40}\InstallUtil.exe; Parameters: """{app}\WCFService.exe""" 

最外面的一組引號是英諾本身;每一對雙引號將在命令行中放置一個單引號。