Announcement

Collapse
No announcement yet.

How to delete credential manager by NSIS?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Anders
    replied
    PHP Code:
    !include LogicLib.nsh
    Section 
    System
    ::Call 'ADVAPI32::CredEnumerate(t "user*", i0, *i0r1, *p0r2)i.r0'
    ${If} $<> 0
        
    ${IfThen} $1 U${|} IntOp $$${|}
        ${ForEach} $
    3 0 $1
            IntOp 
    $$* ${NSIS_PTR_SIZE}
            
    System::Call '*$2(&i$4, p.r4)'
            
    System::Call '*$4(i, i.r5, p.r6)'
            
    System::Call 'ADVAPI32::CredDelete(t)(pr6, ir5, i0)'
        
    ${Next}
        
    System::Call 'ADVAPI32::CredFree(pr2)'
    ${EndIf}
    SectionEnd 

    Leave a comment:


  • jack.nguyen
    replied
    It's work perfectly thanks very much!

    But one more question could we remove all credentials with specific text

    Ex: I have user1, user2, user3... and I want to remove all credentials start with 'user'

    Leave a comment:


  • Anders
    replied
    The System plug-in is part of NSIS.

    Replace crednamehere with "service/account" and those are the two parameters you used with keytar.

    Leave a comment:


  • jack.nguyen
    replied
    Originally Posted by Anders View Post
    And which API did your application use to store the credential?


    This might work but without knowing how you saved it, I can't be sure.

    PHP Code:
    System::Call 'advapi32::CredDelete(t "crednamehere", i 1, i0)' 
    Hello Anders,

    Thanks for your help.

    I develop an application using electron and use this library to save the credential data https://github.com/atom/node-keytar

    Could I put your code in the NSI file? Is any plugin required here?

    Leave a comment:


  • Anders
    replied
    And which API did your application use to store the credential?


    This might work but without knowing how you saved it, I can't be sure.

    PHP Code:
    System::Call 'advapi32::CredDelete(t "crednamehere", i 1, i0)' 

    Leave a comment:


  • jack.nguyen
    replied
    Originally Posted by Anders View Post
    Maybe you could link to a page on MSDN so we can understand which credentials you are talking about...
    Hello Anders,



    I want to delete my credential data in Uninstall Section of NSIS script

    Leave a comment:


  • Anders
    replied
    Maybe you could link to a page on MSDN so we can understand which credentials you are talking about...

    Leave a comment:


  • jack.nguyen
    started a topic How to delete credential manager by NSIS?

    How to delete credential manager by NSIS?

    I want to know how to use NSIS script to remove credential manager data.

    Could somebody help me?
Working...
X