running InstallUtil {app}/file.exe in inno setup

孤街醉人 提交于 2020-01-11 05:54:07

问题


I want to copy service files to {app} directory and then use this as a parameter in InstallUtil.exe.

Here's some part of my code :

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

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

This code doesn't work (but the files are copied into {app} directory correctly). However, if I use something like this :

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

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

it works correctly. Does anyone know what's going on? I have to use inno setup.


回答1:


In this case you could try to set WorkingDir parameter to {app} in the [Run] section. Like this:

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



回答2:


{app} may contain spaces, and so must be properly quoted when using it on command lines:

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

The outermost set of quotes is for Inno itself; each pair of doubled quotes within that will end up putting a single quote on the command line.



来源:https://stackoverflow.com/questions/18181855/running-installutil-app-file-exe-in-inno-setup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!