Installation 在inno安装程序中运行InstallUtil{app}/file.exe

Installation 在inno安装程序中运行InstallUtil{app}/file.exe,installation,inno-setup,Installation,Inno Setup,我想将服务文件复制到{app}目录,然后将其用作InstallUtil.exe中的参数 以下是我的部分代码: [Files] Source: WCFService.exe; DestDir: {app} Source: WCFService.exe.config; DestDir: {app} [Run] Filename: {dotnet40}\InstallUtil.exe; Parameters: {app}\WCFService.exe 此代码不起作用(但文件已正确复制到{app}目

我想将服务文件复制到{app}目录,然后将其用作InstallUtil.exe中的参数

以下是我的部分代码:

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

[Run]
Filename: {dotnet40}\InstallUtil.exe; Parameters: {app}\WCFService.exe
此代码不起作用(但文件已正确复制到{app}目录中)。但是,如果我使用这样的东西:

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

[Run]
Filename: {dotnet40}\InstallUtil.exe; Parameters: WCFService.exe
它工作正常。有人知道发生了什么事吗?
我必须使用inno设置。

在这种情况下,您可以尝试在
[Run]
部分将
WorkingDir
参数设置为
{app}
。 像这样:

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

{app}
可能包含空格,因此在命令行上使用时必须正确引用:

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

最外层的一组引号是针对Inno本身的;其中的每对双引号将在命令行上放置一个引号。

也许您应该将
{app}\WCFService.exe
放在引号中
?或者你应该把
WorkingDir
设置为
{app}
?我试过了,它成功了!代码:[运行]文件名:{dotnet40}\InstallUtil.exe;工作目录:{app};参数:WCFService.exe非常感谢,伙计:)!