سؤال

I'm using the CPack NSIS generator to create an installer. However, each time I release a new version, our users are running the new installer without uninstalling the old version (which is understandable).

Is it possible to make the installer overwrite all existing files? Failing that, is there a way to block the installation if it's already installed?

Also, our CPack call is wrapped in another script, as a last resort, is it possible for me to hack/reconfigure the project.nsi file so that it does one of the above?

هل كانت مفيدة؟

المحلول 2

My solution was to maintain the NSIS file separately, turns out to be not much extra effort.

نصائح أخرى

you have to edit the NSIS template that CPack uses. You can find it in your cmake installation folder/Modules/NSIS.template.in.

There, somewhere, maybe in the begining of the General section, you can put: SetOverwrite on

This should do the trick, although I didn't have the chance to try it out.

For more details about the arguments of SetOverwrite read the NSIS scripting manual

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top