Old 4th January 2008, 08:25   #1
zgy88c
Junior Member
 
Join Date: Jan 2008
Posts: 5
Question NSIS can't remove NSIS created registry key

I have an NSIS installer that creates a registry key, such that when ActiveSync sees a device cradled, it automatically starts my application.

The creation of the key works fine (as does the ActiveSync function), but on Un-Install, the registry key is not removed.

All other registry entries created can be deleted without issue.

Any help much appreciated.



So from my "post" section:

Section "-post"
; Create the ActiveSync key so our app starts when the device is cradled
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows CE Services\AutoStartOnConnect" "${appname}" "$INSTDIR\${exe}"


And my Uninstall section:

Section "Uninstall"

; Delete the ActiveSync key so our app wont start when the device is cradled
DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows CE Services\AutoStartOnConnect\${appname}"
zgy88c is offline   Reply With Quote
Old 4th January 2008, 09:55   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
What happens if you try and delete it yourself through Regedit? What is ${appname} set to?

Stu
Afrow UK is offline   Reply With Quote
Old 4th January 2008, 10:19   #3
zgy88c
Junior Member
 
Join Date: Jan 2008
Posts: 5
Quote:
Originally posted by Afrow UK
What happens if you try and delete it yourself through Regedit?
What is ${appname} set to?
With regedit it just deletes, no permission problems.

${appname} = Device Integration Service

I just changed it to have no spaces, it made no difference.
zgy88c is offline   Reply With Quote
Old 4th January 2008, 10:28   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
What happens if you delete it from your install section after creating it?

Just to confirm, ${appname} is a constant and doesn't contain a variable with its value set to Device Integration Service.

Stu
Afrow UK is offline   Reply With Quote
Old 4th January 2008, 11:37   #5
zgy88c
Junior Member
 
Join Date: Jan 2008
Posts: 5
Quote:
Originally posted by Afrow UK
What happens if you delete it from your install section after creating it?

Just to confirm, ${appname} is a constant and doesn't contain a variable with its value set to Device Integration Service.

Stu
If I put the delete immeadiately after the create in the install section, the key is still not deleted.

${appname} is a constant -
!define appname "Device Integration Service"
zgy88c is offline   Reply With Quote
Old 4th January 2008, 11:44   #6
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Vista?

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 4th January 2008, 11:49   #7
zgy88c
Junior Member
 
Join Date: Jan 2008
Posts: 5
Quote:
Originally posted by kichik
Vista?
XP Professional + SP2
zgy88c is offline   Reply With Quote
Old 4th January 2008, 12:02   #8
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
You're trying to delete a registry value as a key. Use DeleteRegValue.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 4th January 2008, 12:12   #9
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Well spotted lol

Stu
Afrow UK is offline   Reply With Quote
Old 4th January 2008, 12:38   #10
zgy88c
Junior Member
 
Join Date: Jan 2008
Posts: 5
Talking

Quote:
Originally posted by kichik
You're trying to delete a registry value as a key. Use DeleteRegValue.
That was it! Many thanks.

FWIW: RegMon (http://www.microsoft.com/germany/tec...es/Regmon.mspx)
helped tracing the reads & writes.

I was just about to post a screen-shot of it creating the key,
then failing to find the key on the next command - the delete.

Thanks again!
zgy88c is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump