Archive: Calling same function during install and uninstall


Calling same function during install and uninstall
Hello,

I know about the "un." limitation for uninstall function calls, but I wonder if there's some way to call the very same function during install and uninstall.

In particular, my function checks for the existence of a service; if exists, it stops it and removes it, so that:

- When installing, the updated service can be installed
- When uninstalling, the service can be removed

I'd like to reuse the same code portion and avoid macros (it's about thirty lines code using labels).

Is there some way to do this?

Thanks,
Mario


First link on Google search if you search for your topic subject + NSIS:
http://nsis.sourceforge.net/Sharing_...nd_Uninstaller

Please do a search in future.

Stu


Thank you, I already found it; but with this technique, the code is actually doubled in the installer - so double room taken.

I was looking for a smarter solution... :)

- Mario


You can't call a function in the installer from the uninstaller and vice versa, they are separate files.

So you have to use that macro technique to make it easier to maintain one piece of code for both or copy and paste the function adding "un." in front of the function name for the uninstaller.


Aaahhh now I get it, thanks!

I used the "double macro" approach, works great.

This forum rocks ;)

- Mario