Archive: Way to include path in clients while installing server.


Way to include path in clients while installing server.
I have a product that installs a server with some data that the clients access. The client files are installed at the same time the server is set up. The clients need to have an HTTP path embedded in them somehow so that when a user downloads the client it will point back to the server. I'll be asking the user for the URL during the server install but I don't want to have to ask the clients. So, are any of the ideas below possible? Also, if somebody has any other ideas of how to do this...

A. Have the client installs prebuilt and then append a URL to the end of the file during the serer install that NSIS would read whenever a client installs.

B. Have the client install script created during the server install and then also compile that script so that it will already have the URL in it when it's built. If yes, would it be legal to distribute parts of NSIS to do this and which files would I need?

C. Build the client install with a bogus URL that could be modified during the server install.

Thanks,


A is possible if you append data to the end so it won't make the installer verification fail (unless you have recompiled NSIS to make installer verification very strict). You can read the data using script code.

B is possible too and legal. You only need the makensis compiler and plug-in/header files you are using.

A is faster than B, B is useful if you want to change other things too.


Ok, I wrote a script to write the URL to the end of my client install. Something like:
FileOpen $0 C:\Temp\setup32.exe a
FileSeek $0 0 END
FileWrite $0 "$\r$\nhttp://www.something.com/data$\r$\n"
FileClose $0
Now, I'm trying to read it in but the only way I can get that to work is if I know exactly how long the URL is which I won't have any way of knowing:
FileOpen $0 C:\Temp\setup32.exe r
FileSeek $0 -42 END
FileRead $0 $1
FileClose $0
MessageBox MB_OK "$1"
How can I modify the code above to seek to the last line?

Thanks,


Reserve a certain space for the URL and fill the rest of it with null characters.