Archive: How to create NSIS script for PHP application


How to create NSIS script for PHP application
Thanks for all for time to spend to me and sorry if my english it is not is good.
I hope to find someone to replay my question. Thanks for this.

I want to distributed and install my PHP application.
It work in Apache web server with PHP and XML structure (about PH and XML if there are someone to interesting how to use this tools I cam to send same prototype... write me).
It must be install into the Document_root of the web server like ..../htdocs/fedra.... (fedra it is the name of the sub-directory of the my application).
I do not have idea how to make scripts NSIS.
I try to use it with the help of the documentation but I do not have undestand well how to use it.
I believe that the installation program must make some things like as an example:
1. to verify the version
2. control the space of the hard disk
3. to find the document_root of the web server
4. and if the 3. point it is yes to execute unpack of the objects of the package .zip
I hope of to have write well my question.
Sorry if I have write to long.
Ciao Franco.


To know how NSIS scripts look like have a look at the examples. To generate a generic script go to the template generator.

Now for your other questions:
1) I don't know how you can tell the version of Apache, but if it is possible NSIS can do it. You can read from the registry, read from an INI file, and read from files. However Apache stores its version, you can read.
2) NSIS does that for you. It won't let the user install unless he has enough free space.
3) Just read the Apache configuration file using FileOpen, FileRead and FileClose. Have a look at this example.
4) Use the File command to extract files on the user machine (they will be compressed on your machine). If you want to extract only from a zip file use this extension DLL.


Thanks for the response kichik and sorry if I replay to late.
I have try NSIS script generated with template.
At this momement I want install my application with sub_direcory under the Document_Root of the web_server.
I attache the script that I have try.

I have comment the write register because it is not necessary for my application. It is correct?

Question it is:

how to do I have to make for to replicate the path structure of the my application because with this script the object fpo.htm are install under root of the my application (..../htdocs/fedra) and not on the the correct sub_directory (.../htdocs/fedra/sv/src/html/fpo.htm ).

Why?


You forgot to attach the script.
But I think I understand your meaning. You already have the apache documents root and you want to extract your file to a subdirectory of it. If this is the case just set the output path (using SetOutPath) to $INSTDIR\sv\src\html and use File as always.


Thanks for all kichik and sorry for my question very stupid.

Let me write again at the NG for my new problems.

Ciao e grazie.