Archive: Search, Verify and Destroy


Search, Verify and Destroy
Hi im looking for a code for my installer section. Search, Verify and Destroy.

; Searches the location
ReadRegStr $0 HKLM "Software\Sebas\Sebas5" "Home"

[Here must be an code which aborts this process (beneath) if an specific Registry code is found.]

; Deletes some stuff
Delete "$0\*.*"

Can someone help me out?


To abort the installation, simply use the Abort instruction.


Thanks for your reply kichik, but i do not want to abort my installation! I only want to not execute the command:

 ; Deletes some stuff
Delete "$0\*.*"


So what to do?

(One little side-kick question where in my script with which code can i activate the following code? http://nsis.sourceforge.net/wiki/Clo..._User_Approval)

Just to remove the line containing the "Delete" instruction...


Please read the whole topic, its about this

; Searches the location
ReadRegStr $0 HKLM "Software\Sebas\Sebas5" "Home"

[Here must be an code which aborts the process beneath (only) IF ReadRegStr $1 HKLM "Software\Sebas\Sebas5\Nrm" "Del" is found.]

; Deletes some stuff
Delete "$0\*.*"

See?

(One little side-kick question where in my script with which code can i activate the following code? http://nsis.sourceforge.net/wiki/Cl...h_User_Approval)


1. Oh, use "StrCmp":

StrCmp $1 "" +2


2. (for the "side-kick" question)
Call CloseDelphiWithUserApproval

I now have this script:

; Search for Sebas 5 and destroy
ReadRegStr $0 HKLM "Software\Sebas\Sebas5" "Home"
StrCmp $1 "" +2
ReadRegStr $1 HKLM "Software\Sebas\Sebas5" "Sebaslight"
Delete "$0\Sebas.exe"

But it does not seem to work... has any one an idea whats wrong. To make it all clear:

When reg "HKLM "Software\Sebas\Sebas5" "Sebaslight"" is found "Delete "$0\Sebas.exe" must niet be executed


ReadRegStr $0 HKLM "Software\Sebas\Sebas5" "Home"
StrCmp $0 "" +4
ReadRegStr $1 HKLM "Software\Sebas\Sebas5" "Sebaslight"
StrCmp $1 "" 0 +2
Delete "$0\Sebas.exe"

You should read up on StrCmp in the documentation.

-Stu