Hello everyone,
I am an NSIS newbie and I am quite puzzled with a question.
I have created several sections within my installer that represent optional installation components. I would like to execute an external program if the user has checked a particular section.
The section commands -as far as I know- do not include an execution command, but only extraction/copy commands etc. I have read the NSIS manual but haven't found anything about my problem. Can you please provide any help?
Thanks.
Help on running a file from a section!
4 posts
Did you try using the Exec, ExecWait, or ExecShell commands? Kinda like this:
Section "Launch External Program"
Exec '"Program" args'
SectionEnd
Refer to the manual for the differences between the different commands.
Section "Launch External Program"
Exec '"Program" args'
SectionEnd
Refer to the manual for the differences between the different commands.
Originally posted by Fightin_FooYes, I'm afraid I've tried that. It compiles with no problem but the generated installer doesn't really execute the desired file.
Did you try using the Exec, ExecWait, or ExecShell commands?
Section "Install Microsoft .NET Framework 2.0 Runtime" SEC05
ExecWait ‘"$EXEDIR\Prerequisites\dotnetfx.exe"’
SectionEnd
Is there something I'm doing wrong?
EDIT: Alright, solved it.. When you execute the application without any args, you should omit the single quotes in order for the whole thing to work. Thanks for helping out anyway.
PS. I gotta admit, I'm quite impressed by NSIS's potential and capabilities 👍
No it's because you're using the wrong quotes. Use ` " or ' not ‘ and ’. Interesting that makensis.exe doesn't throw an error but you will find using `"$SYSDIR\notepad.exe"` works and ‘"$SYSDIR\notepad.exe"’ does not.
Stu
Stu