I could use the DeleteRegKey, but just getting a handle on the output that is why I am using the deletekey... If someone else can try this and let me know if I am crazy or what...
Thanks,
Squirre1
Name "BackupExt"
OutFile "BackupExt.exe"
Caption "$(^Name)"
XPStyle on
RequestExecutionLevel admin
!include "Registry.nsh"
!include "Sections.nsh"
var REG_BACKUP
Section "Empty"
ReadRegStr $R9 HKCR ".pdf" ""
${If} $R9 != ""
!insertmacro logme $INSTLOG "Backing up .pdf file association" s
${registry::CopyKey} "HKEY_CLASSES_ROOT\.pdf" "HKEY_CLASSES_ROOT\.pdfbkup" $0
${If} $0 == "0"
StrCpy $0 "Successful"
${Else}
StrCpy $0 "Failed"
${EndIf}
!insertmacro logme $INSTLOG "- .pdf association backup result: $0" s
StrCpy $REG_BACKUP "1"
${EndIf}
MessageBox MB_OK|MB_ICONINFORMATION "Installation Here" /SD IDOK
${If} $REG_BACKUP == "1"
!insertmacro logme $INSTLOG "Restoring .pdf file association" s
${registry::CopyKey} "HKEY_CLASSES_ROOT\.pdfbkup" "HKEY_CLASSES_ROOT\.pdf" $0
${If} $0 == "0"
StrCpy $0 "Successful"
${registry::DeleteKey} "HKEY_CLASSES_ROOT\.pdfbkup" $1
${If} $1 == "0"
StrCpy $1 "Successful"
${Else}
StrCpy $1 "Failed"
${EndIf}
${Else}
StrCpy $0 "Failed"
${EndIf}
!insertmacro logme $INSTLOG "- .pdf association restore result: $0" s
!insertmacro logme $INSTLOG "- .pdfbkup cleanup result: $1" s
${EndIf}
SectionEnd