Archive: Installing Third-party Software with NSIS


Installing Third-party Software with NSIS
I recently discovered NSIS and I think it's fantastic!

I have already written 3 installation packages with it.

I'm currently upgrading a very old Microsoft installation package (1997) to NSIS and it involves shelling out Microsoft Access Runtime.

My question is I'm want to distribute this as an all-inclusive setup.exe so what's the best approach for this.

The setup function for handling MSAccess Runtime's setup needs to include:
1. Extracting it to a temporary folder.
2. Shelling out the installation.
3. Checking the error code.
4. Cleaning up the temporary directory.

Does NSIS have support for automating/shortcutting these steps or am I going to have to do each one.

If I do have to perform each step - is my approach correct or is there a better way.

Any recommendations, including what command I should use, would be greatly appreciated.

Sincerest Thanks. :)

jc3


You probably could have found this by searching the forum, but anyway:

4 steps = 3 simple lines of code.

(in a section)

File /oname=$PLUGINSDIR\AccessSetup.exe AccessSetup.exe
ExecWait $PLUGINSDIR\AcessSetup.exe $0
StrCmp $0 "0" it_worked it_didnt_work

$PLUGINSDIR is automatically deleted when the installer exits, but you could manually delete the setup program if you want.

Thanx!

BTW, I did spend a great deal of time searching the forum. Probably more that my employer would have liked me spending. :D

Thanks again.

jc3


I had to put this one down for a while so I didn't get a chance to test it.

the "/oname=$PLUGINSDIR\" parameter will only allows one file to be copied at a time, so I don't think I can use this because the Access Runtime installer has great number of files and directories.

So, to re-state my original question:
Is there a better or recommended way of doing this?

If not, I'll just copy the directory structure manaually - a pain, but what can you do...

Thanks again.

jc3


have a look at the docs.
search them for the "File" command.
it has more switches than just the "/oname=" ...


You want to do something like:

SetOutPath "$PLUGINSDIR"
File "local_file.ext"
File ...

-Stu