Commit e6731f48 authored by Nils Gladitz's avatar Nils Gladitz

CPackWIX: Add new CPACK_STARTUP_SHORTCUTS property.

parent 279605f5
......@@ -324,6 +324,7 @@ Properties on Installed Files
/prop_inst/CPACK_NEVER_OVERWRITE.rst
/prop_inst/CPACK_PERMANENT.rst
/prop_inst/CPACK_START_MENU_SHORTCUTS.rst
/prop_inst/CPACK_STARTUP_SHORTCUTS.rst
/prop_inst/CPACK_WIX_ACL.rst
......
CPACK_STARTUP_SHORTCUTS
-----------------------
Species a list of shortcut names that should be created in the Startup folder
for this file.
The property is currently only supported by the WIX generator.
......@@ -557,6 +557,12 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
directoryDefinitions.EmitDesktopFolder();
}
if(emittedShortcutTypes.find(cmWIXShortcuts::STARTUP) !=
emittedShortcutTypes.end())
{
directoryDefinitions.EmitStartupFolder();
}
directoryDefinitions.EndElement("Directory");
directoryDefinitions.EndElement("Fragment");
......@@ -714,6 +720,17 @@ bool cmCPackWIXGenerator::CreateShortcuts(
}
}
if(!shortcuts.empty(cmWIXShortcuts::STARTUP))
{
if(!this->CreateShortcutsOfSpecificType(cmWIXShortcuts::STARTUP,
cpackComponentName, featureId, "STARTUP",
shortcuts, false,
fileDefinitions, featureDefinitions))
{
return false;
}
}
return true;
}
......@@ -736,6 +753,9 @@ bool cmCPackWIXGenerator::CreateShortcutsOfSpecificType(
case cmWIXShortcuts::DESKTOP:
directoryId = "DesktopFolder";
break;
case cmWIXShortcuts::STARTUP:
directoryId = "StartupFolder";
break;
default:
return false;
}
......
......@@ -41,6 +41,14 @@ void cmWIXDirectoriesSourceWriter::EmitDesktopFolder()
EndElement("Directory");
}
void cmWIXDirectoriesSourceWriter::EmitStartupFolder()
{
BeginElement("Directory");
AddAttribute("Id", "StartupFolder");
AddAttribute("Name", "Startup");
EndElement("Directory");
}
size_t cmWIXDirectoriesSourceWriter::BeginInstallationPrefixDirectory(
std::string const& programFilesFolderId,
std::string const& installRootString)
......
......@@ -32,6 +32,8 @@ public:
void EmitDesktopFolder();
void EmitStartupFolder();
size_t BeginInstallationPrefixDirectory(
std::string const& programFilesFolderId,
std::string const& installRootString);
......
......@@ -52,6 +52,10 @@ bool cmWIXShortcuts::EmitShortcuts(
shortcutPrefix = "CM_DS";
registrySuffix = "_desktop";
break;
case STARTUP:
shortcutPrefix = "CM_SS";
registrySuffix = "_startup";
break;
default:
return false;
}
......@@ -96,6 +100,9 @@ void cmWIXShortcuts::CreateFromProperties(
CreateFromProperty("CPACK_DESKTOP_SHORTCUTS",
DESKTOP, id, directoryId, installedFile);
CreateFromProperty("CPACK_STARTUP_SHORTCUTS",
STARTUP, id, directoryId, installedFile);
}
void cmWIXShortcuts::CreateFromProperty(
......
......@@ -34,7 +34,8 @@ public:
enum Type
{
START_MENU,
DESKTOP
DESKTOP,
STARTUP
};
typedef std::vector<cmWIXShortcut> shortcut_list_t;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment