Executing Batch File in NSIS installer

前端 未结 2 1448
北荒
北荒 2020-12-15 21:30

I have a batch file that I need to run within my NSIS installer. It must run after all the files have been extracted, (I suppose this is obvious, otherwise the batch file wo

相关标签:
2条回答
  • 2020-12-15 21:51

    Exec[Wait] needs proper quoting:

    ExpandEnvStrings $0 %COMSPEC%
    ExecWait '"$0" /C "c:\path\to\batch.cmd" "quoted param" normalparam "c:\last param"'
    
    0 讨论(0)
  • 2020-12-15 22:14

    I have done this using an exec extension very successfully

    This is the syntax:

      SetOutPath $INSTDIR\${APPLICATION_DIR}
        ExpandEnvStrings $0 %COMSPEC%
        nsExec::ExecToStack '"C:\path-tobatch-file\commands.bat"'
    

    Here is a link to the NSIS Wiki http://nsis.sourceforge.net/Docs/nsExec/nsExec.txt

    0 讨论(0)
提交回复
热议问题