Archive: Useful feature


Useful feature
I'm trying to do the following : (sorry for my english)

The software download is passed thru an email validation so you can actually know who uses your work.(I'm writing interactive maps software, so it has to fetch data on server)

On install, the user has to enter his email into the install window.

Nsisdl then fetches a php file which writes to a server database: the email, and unique ID/Password, sends back a key file containing these datas and writes it to the install dir.

Everytime the user uses the software, he is identified and logged, so he is charged on 'per use' basis.


here's my code :
How can I do to get the user to enter his email and pass it to code.php?

and I can't get it to copy the key file into INSTALLDIR

Function Downloadkey

StrCpy $1 $TEMP\porearre1.dll
StrCpy $2 "$TEMP\code.htm"
File /oname=$1 nsisdl.dll
Push http://www.domain.com/code.php?email=
Push $2
CallInstDLL $1 download
Delete $1
StrCmp $0 success success
SetDetailsView show
DetailPrint "download failed: $0"
Abort
success:
;ExecWait '"$2" /S'
;Delete $2
Pop $0
;StrCmp $2 "" skip
StrCpy $INSTDIR $2
skip:
FunctionEnd



; The stuff to install
Section "Zipmapper"

; Set output path to the installation directory.
SetOutPath $INSTDIR

Call Downloadkey

File "C:\WINDOWS\Bureau\Nsis20\loupe.gif"


From the FAQ:

How can I get input from the user?
Use Install Options to create custom dialogs during the installation process. You can find Install Options (IO) in the Contrib directory.

And you can pass it to the PHP as part of the URL:
http://www.somewhere.com/test.php?na...@somewhere.com
Note that I'm not sure if you'll get the @ right.
In PHP, you can use something like $HTTP_GET_VARS['name'] to retrieve this value, but you'll have to look it up in the documentation.


allright
Thanks for your replies.

The install options look simple, I'm checking that out right now.

Mitia