Skip to content
⌘ NSIS Forum Archive

Delete $R0 not work

6 posts

shaojwa#

Delete $R0 not work

hello everyone:

I got a question which puzzled me a long time:

I use
Delete $R0
to delete the uninstall.exe file, in which R0 = "C:\Program Files\DPtech\TAC\uninstall.exe"
but to my surprise, it cannot work.

but when i change the code to
 Delete "C:\Program Files\DPtech\TAC\uninstall.exe"
It works


can somebody tell me why the usage like Delete $R0 can not work ?
I read the doc, and thought about it for a really long time.
and i urge to know why. thx a lot
Anders#
The path is probably wrong. You could verify this with Process Monitor.

StrCpy $0 "c:\foo"
Delete $0
should be the same as
Delete "c:\foo"
shaojwa#
I got the $R0 form Registry:

ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TAC" "UninstallString"

and R0 = "C:\Program Files\DPtech\TAC\uninstall.exe"
I show it in a MessageBox and checked it.

but when i test the existence by IfFileExists, not-exists returns while the file is there actually.
shaojwa#
the content of R0 contians quotes (R0 = "C:\Program Files\DPtech\TAC\uninstall.exe")
do you means when using
Delete $R0
equals the usage of
Delete ""C:\Program Files\DPtech\TAC\uninstall.exe""
?

so i should remove the quote before using R0 ?