CPackWiX: Teach WiX installers to remember the install location for upgrades

This commit is contained in:
Nils Gladitz 2014-09-19 22:42:36 +02:00
parent 3689c43a8c
commit e785fab54b
1 changed files with 23 additions and 0 deletions

View File

@ -360,6 +360,29 @@ void cmCPackWIXGenerator::CreateWiXPropertiesIncludeFile()
includeFile.EndElement("Property"); 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( void cmCPackWIXGenerator::CopyDefinition(