Pregunta

I created an window application for which I need to create setup.For creating setup i am using NSIS. I had written script to create setup file I need to link this setup file to Add/remove program. For add link to add/remove program I am using following code:

 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\appName" "DisplayName" "Name"
 WriteRegExpandStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\appName" "AppName" '"$INSTDIR\UninstallApp.exe"'

To delete the link from add/Remove program I am using following code :

 DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\appName"

But this is not working.

¿Fue útil?

Solución

Except for the fact that "AppName" is wrong and should be "UninstallString" it looks like the code should work.

You should inspect it with Process Monitor and see why the delete fails. My only guess at this point is that your real code has a typo...

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top