How do you execute command line tools without using batch file in Inno Setup

我的梦境 提交于 2019-11-27 03:20:30

问题


I now understand that "Inno Setup can execute command line tools for you without utilizing batch file." (Can Inno Setup install set up a Windows security group?) It makes sense that it would be able to do that. From my web searches into Inno Setup thus far, I can not find an starting place to understand how to do this. A complete answer may not be necessary, if I just had some further hint as to what to look for, that would probably be good enough.


回答1:


It was meant that you don't need to create and execute a batch script (with a single command), nor execute the tool through the command prompt (like shown below):

Exec('cmd.exe', '/c "net localgroup ..."', '', SW_SHOW, ewWaitUntilTerminated, Result);

But you directly execute the tool instead:

Exec('net.exe', 'localgroup ...', '', SW_SHOW, ewWaitUntilTerminated, Result);

The same applies to the [Run] section:

[Run]
Filename: "{cmd}"; Parameters: "/c ""net localgroup ..."""

Better would be this:

[Run]
Filename: "net.exe"; Parameters: "localgroup ..."


来源:https://stackoverflow.com/questions/28051357/how-do-you-execute-command-line-tools-without-using-batch-file-in-inno-setup

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