uninstaller not deleting registry

那年仲夏 提交于 2019-12-06 03:35:36

If you are not installing a x64 application you should not use SetRegView/$PROGRAMFILES64 at all.

If you are installing a x64 application and you called SetRegView 64 during install you also have to call SetRegView 64 in the uninstaller.

Use Process Monitor to investigate other registry issues...

The NSIS tutorials I've found place the 64-bit installer logic in a function .onInit which is called automatically when the install starts.

Logically, one would try to call this manually in the uninstall section via Call .onInit, but NSIS compilation will fail because the function name doesn't start with un..

So, logically, if you create an un.onInit, it should "Just work". And it does.

Function un.onInit
${If} ${RunningX64}
    ; Comment out this next line in production environment
    MessageBox MB_OK "This is a 64-bit os, applying work-arounds"
    SetRegView 64
    StrCpy $INSTDIR "$PROGRAMFILES64\My FooBar Application"
${EndIf}
FunctionEnd

... and if you are wondering "Why create a duplicate function?", the proper answer to that question is here...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!