Archive: Newbie: How to Use NSExec


Newbie: How to Use NSExec
I would like to create an installer package that runs a DOS batch file. I have tried using NSExec, but I get an error message.

This is what the script looks like:

nsExec::Exec [/OEM] '"C:\CRXIWIN7.bat"'

Note: The batch file exists in this location.

When I compile the script, I get the message :

Processing script file: "C:\crystal.txt"
Error: Can't add entry, no section or function is open!
Error in script "C:\crystal.txt" on line 1 -- aborting creation process

Is my syntax correct?

If my syntax is correct, do I need to do something to make NSExec work?

I am working on a Windows 7 PC.

Thanks very much for your help.

Craig


You are apparently not yet versed in the basics of the NSIS scripting language. I would suggest you study NSIS\Examples\Example1.nsi and Example2.nsi for a starter's look at how NSIS works. When you fully understand what ever command in those files do exactly, you'll be ready to try building your own installer. Use the command reference to look up command functions:
http://nsis.sourceforge.net/Docs/Chapter4.html

Also: a parameter between brackets, such as [/OEM], means that it's optional. You can add the /OEM parameter, or you can leave it out, depending on what behaviour you want. But you shouldn't keep the [] brackets, in any case.