开发者

Nsis - changing installation directory

Currently I am in my installing directory say c:\Program File\My installer.I have to execute a demo.bat file that is stored at some other location say c:\Program Files\Temp\example.bat,which I have to go at that location and execute coz my example.bat has some su开发者_运维知识库pport files that are only stored in Temp folder.

My question is how can I change my installing directory to some other directory, execute demo.bat file and come back to my original installing directory while writing an nsis script?


When talking about "installing directory", I assume you mean current/working directory in the context of a batch file.

push $outdir ;save original path
SetOutpath "$programfiles\temp" ;set currect directory
nsExec::Exec "example.bat"
pop $outdir
SetOutpath $outdir ;restore

There are several ways to execute a batch file (Expand %comspec% and pass it to Exec/ExecWait, or use one of the exec plugins (nsExec,ExecDos,ExecCmd))

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜