Skip to content
⌘ NSIS Forum Archive

uninstall function

3 posts

aviadlich#

uninstall function

I have two functions that do the same one for the install and one for the uninstall
I want to unify them under the same function (save duplicate code)
how do i do it - the compiler tells me that any call to a function during the uninstall the function name must start with un. ?
demiller9#
I do this:
!macro DualUseFunctions_ un_

function ${un_}StartServices
# ...
functionEnd

function ${un_}SetPathVar
# ...
${${un_}WordFind} "$R0" "_" "E$0" $1
# ...
${${un_}WordAdd} "$R0" ";" "-$0" $R0
functionEnd

!macroend

!insertmacro DualUseFunctions_ ""
!insertmacro DualUseFunctions_ "un."