Execute Command-Line Command from NSIS

前端 未结 3 1219
梦如初夏
梦如初夏 2021-02-07 08:28

I\'m creating my first NSI script and I\'m just wondering if I can execute a command-line command from NSIS or should I just execute a batch file? I don\'t really know where to

3条回答
  •  北海茫月
    2021-02-07 09:04

    Try using exec command http://nsis.sourceforge.net/Docs/Chapter4.html:

    4.9.1.2 Exec

    command

    Execute the specified program and continue immediately. Note that the file specified must exist on the target system, not the compiling system. $OUTDIR is used for the working directory. The error flag is set if the process could not be launched. Note, if the command could have spaces, you should put it in quotes to delimit it from parameters. e.g.: Exec '"$INSTDIR\command.exe" parameters'. If you don't put it in quotes it will not work on Windows 9x with or without parameters.

    Exec '"$INSTDIR\someprogram.exe"'
    Exec '"$INSTDIR\someprogram.exe" some parameters'
    

提交回复
热议问题