[CMake] using cmake to install dlls into windows/system32

James Zipperer james.zipperer at modsystems.com
Thu Dec 17 17:44:07 EST 2009


This seems to work, although I don't think it's the ideal solution:

CMakeLists.txt
    install (FILES drivers/driver.dll
             DESTINATION sysdir/)

    set (CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
        CopyFiles \\\"$INSTDIR\\\\sysdir\\\\driver.dll\\\" \\\"$SYSDIR\\\"
    ")

This gets the dll into the windows system directory, but there are still some issues I'm sorting through:
Versioning of the dll: what if the file was already there and there is already a newer version?
                How to uninstall only if nothing else is using the dll.

It appears that nsis has some helper functions: UpgradeDLL, AddSharedDLL, but I'm not sure yet how to include/call them through CMakeLists.txt.  Does anyone have any insight?  Thanks!

-James


From: cmake-bounces at cmake.org [mailto:cmake-bounces at cmake.org] On Behalf Of James Zipperer
Sent: Wednesday, December 16, 2009 4:44 PM
To: David Cole; CMake mailing list
Subject: Re: [CMake] using cmake to install dlls into windows/system32

They're device driver dlls for use system-wide.

-James


From: David Cole [mailto:david.cole at kitware.com]
Sent: Wednesday, December 16, 2009 4:34 PM
To: James Zipperer
Cc: CMake mailing list
Subject: Re: [CMake] using cmake to install dlls into windows/system32

What's the reason they need to be there?

On Wed, Dec 16, 2009 at 7:18 PM, James Zipperer <james.zipperer at modsystems.com<mailto:james.zipperer at modsystems.com>> wrote:
Yes, unfortunately they need to be there.

-James


From: David Cole [mailto:david.cole at kitware.com<mailto:david.cole at kitware.com>]
Sent: Wednesday, December 16, 2009 4:15 PM
To: James Zipperer
Cc: CMake mailing list
Subject: Re: [CMake] using cmake to install dlls into windows/system32

You should avoid this if at all possible.
Install dlls next to your program, not in the system32 directory.

Do you have a reason you need to install a dll there?


On Wed, Dec 16, 2009 at 6:42 PM, James Zipperer <james.zipperer at modsystems.com<mailto:james.zipperer at modsystems.com>> wrote:
Does anyone have an example of how to install dlls into %WINDIR%/system32 using cmake/ cpack/nsis?  Thanks!

-James


________________________________
This message contains information which is confidential and privileged. Unless you are the addressee (or authorized to receive for the addressee), you may not use, copy or disclose to anyone the message or any information contained in the message. If you have received the message in error, please advise the sender by reply e-mail and delete the message.

_______________________________________________
Powered by www.kitware.com<http://www.kitware.com>

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


________________________________
This message contains information which is confidential and privileged. Unless you are the addressee (or authorized to receive for the addressee), you may not use, copy or disclose to anyone the message or any information contained in the message. If you have received the message in error, please advise the sender by reply e-mail and delete the message.


________________________________
This message contains information which is confidential and privileged. Unless you are the addressee (or authorized to receive for the addressee), you may not use, copy or disclose to anyone the message or any information contained in the message. If you have received the message in error, please advise the sender by reply e-mail and delete the message.

________________________________
This message contains information which is confidential and privileged. Unless you are the addressee (or authorized to receive for the addressee), you may not use, copy or disclose to anyone the message or any information contained in the message. If you have received the message in error, please advise the sender by reply e-mail and delete the message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20091217/2e484d2b/attachment-0001.htm>


More information about the CMake mailing list