CPackWIX: Add new CPACK_STARTUP_SHORTCUTS property.
This commit is contained in:
parent
279605f560
commit
e6731f486e
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
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;
|
||||
|
|
Loading…
Reference in New Issue