diff options
author | Nils Gladitz <nilsgladitz@gmail.com> | 2014-09-19 20:42:36 (GMT) |
---|---|---|
committer | Nils Gladitz <nilsgladitz@gmail.com> | 2014-09-19 20:42:36 (GMT) |
commit | e785fab54b17349f01bc791d808de3319a30d95a (patch) | |
tree | 83a53045605dedb0ca7664c86ab589920f19442c /Source/CPack | |
parent | 3689c43a8c62ca5883d776ee75a34f145d03ab7a (diff) | |
download | CMake-e785fab54b17349f01bc791d808de3319a30d95a.zip CMake-e785fab54b17349f01bc791d808de3319a30d95a.tar.gz CMake-e785fab54b17349f01bc791d808de3319a30d95a.tar.bz2 |
CPackWiX: Teach WiX installers to remember the install location for upgrades
Diffstat (limited to 'Source/CPack')
-rw-r--r-- | Source/CPack/WiX/cmCPackWIXGenerator.cxx | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index a2995d1..b221ab4 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -360,6 +360,29 @@ void cmCPackWIXGenerator::CreateWiXPropertiesIncludeFile() includeFile.EndElement("Property"); } } + + if(GetOption("CPACK_WIX_PROPERTY_ARPINSTALLLOCATION") == 0) + { + includeFile.BeginElement("Property"); + includeFile.AddAttribute("Id", "INSTALL_ROOT"); + includeFile.AddAttribute("Secure", "yes"); + + includeFile.BeginElement("RegistrySearch"); + includeFile.AddAttribute("Id", "FindInstallLocation"); + includeFile.AddAttribute("Root", "HKLM"); + includeFile.AddAttribute("Key", "Software\\Microsoft\\Windows\\" + "CurrentVersion\\Uninstall\\[WIX_UPGRADE_DETECTED]"); + includeFile.AddAttribute("Name", "InstallLocation"); + includeFile.AddAttribute("Type", "raw"); + includeFile.EndElement("RegistrySearch"); + includeFile.EndElement("Property"); + + includeFile.BeginElement("SetProperty"); + includeFile.AddAttribute("Id", "ARPINSTALLLOCATION"); + includeFile.AddAttribute("Value", "[INSTALL_ROOT]"); + includeFile.AddAttribute("After", "CostFinalize"); + includeFile.EndElement("SetProperty"); + } } void cmCPackWIXGenerator::CopyDefinition( |