![]() |
Deleting Dynamic Registry key
I am trying to delete a registry key. The problem is the name of the key is dependent on how many apps you have installed on your palm pilot. Here is the key :
[HKEY_CURRENT_USER\Software\U.S. Robotics\Pilot Desktop\Application6] "Creator"=dword:53704e6f "Conduit"="TFCnd.dll" "Name"="MyApp" "Priority"=dword:00000002 "Directory"="MyApp" "Integrate"=dword:00000001 "Module"="C:\\Program Files\\MyApp.exe" the Application6 could be any number. Here is the NSIS code I use to try and delete it : loop: EnumRegKey $1 HKCU "\Software\U.S. Robotics\Pilot Desktop" $0 StrCmp $1 "" done IntOp $0 $0 + 1 ReadRegStr $1 HKCU "\Software\U.S. Robotics\Pilot Desktop\Application$1" "Name" StrCmp $1 "MyApp" removeKey loop removeKey: DeleteRegKey HKCU "\Software\U.S. Robotics\Pilot Desktop\Application$1" done: SetAutoClose true The code doesn't work, any ideas how to remove this key ? |
code: |
well, a couple issues:[list=1][*]First, ReadRegStr does not need the leading backslash.
Example: ReadRegStr $1 HKCU "Software\U.S. Robotics\Pilot Desktop\Application$0" "Name" [*]Second, in this line: code: You are reading a completely bogus key becuase of what $1 is set to at that part of the code.[/list=1] I assume that the "application#" part of the example would be where "#" is a number counted up, starting at one, and continuing for however many application are installed. If so, then something like this might work better. (I'm using LogicLib here just to make it easier to code. And this is un-tested, so you may have to tweak it a bit, but shoudl at least get you started: code: edit: I just hit submit as RedWine posted his... I guess now you have 2 options! :D |
| All times are GMT. The time now is 04:18. |
Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.