Archive: If "X" string is already in Registry then abort


If "X" string is already in Registry then abort
Yep - another pesky newbie question

Can anyone please provide full script necessary to check if a pre-written Registry entry exists [ from Freeware Trial installtion ], which will then abort the installation, and offer user to purchase Full Version of my program. [ I wish to allow users to only install my Freeware Trial program Once ]

I believe this message box will work OK, but I don't know how to script to check if my pre-written Freeware RegStr already exists.
++++++++++++++++

Function .onInit

???

MessageBox MB_YESNO|MB_ICONQUESTION \
"Our records show you have already downloaded and tried our Freeware Version once. Would you like to purchase Full version now ?" \
IDNO NoReadme
ExecShell open 'http://myUrl/software/purchase.htm'
NoReadme:
hideWindow
abort
FunctionEnd

+++++++++++++++++

Many thanks [ to NSIS too ]
Mixo


Ok.
You just take one of the standard registry read functions and then check for the value to read it out from the registry. Like this:

ReadRegStr $R0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${PROGNAME}" "UninstallString"

If PROGNAME is !define'd as the name you write to the registry, that has the path to the uninstaller. That's basically right out of one of the sample scripts. If you write out a DWORD or Binary value, just change the keyword to the appropriate version.

However, is this really going to work? I don't think it would take too long to figure out that's all you have to do to continue using the Trial version, even if you are really good at obfuscating the key. You really need to apply a combination of registry key(s) and some installed file(s) to more effectively prevent people from continuing to use your trial version.


Re: Ok.
[QUOTE]Originally posted by Pomflain

Thanks for your prompt reply.

I agree using that using a well known {PROGNAME} "uninstallString"
would be fairly easy for a more advanced user to locate and delete.

Perhaps utilizing SetDateSave may be a viable alternative
to check on a prior installation of Trial Version, but being a nsi Newbie, have no idea how to code such a check.

Thanks again for your time and suggestion
Mixo
Down Under


Re: Re: Ok.
[QUOTE]Originally posted by mixo

Originally posted by Pomflain

Thanks for your prompt reply.

I agree using that using a well known {PROGNAME} "uninstallString"
would be fairly easy for a more advanced user to locate and delete.
No, I didn't mean to use that, just meant as an example of how to read from the registry.

Also, I think you are misunderstanding how SetDateSave works. SetDateSave preserves the date/timestamp on the compiling system when it is turned on. Otherwise (assuming here, I always leave it set to on) it would set the date to the time the installer was run and extracted the files on the installing system.

Unless you mean to check the date on the files to see if it matches what you are expecting with SetDateSave on, but even then all they would have to do is compress the files and not preserve the date and then extract them again. I think you'll need to do some kind of combination of the two.