@@ -224,7 +224,9 @@ export default class MsiTarget extends Target {
224
224
result += `>\n`
225
225
const shortcutName = commonOptions . shortcutName
226
226
if ( isCreateDesktopShortcut ) {
227
- result += `${ fileSpace } <Shortcut Id="desktopShortcut" Directory="DesktopFolder" Name="${ xmlAttr ( shortcutName ) } " WorkingDirectory="APPLICATIONFOLDER" Advertise="yes" Icon="${ this . iconId } "/>\n`
227
+ result += `${ fileSpace } <Shortcut Id="desktopShortcut" Directory="DesktopFolder" Name="${ xmlAttr (
228
+ shortcutName
229
+ ) } " WorkingDirectory="APPLICATIONFOLDER" Advertise="yes" Icon="${ this . iconId } "/>\n`
228
230
}
229
231
230
232
const hasMenuCategory = commonOptions . menuCategory != null
@@ -233,7 +235,9 @@ export default class MsiTarget extends Target {
233
235
if ( hasMenuCategory ) {
234
236
dirs . push ( `<Directory Id="${ startMenuShortcutDirectoryId } " Name="ProgramMenuFolder:\\${ commonOptions . menuCategory } \\"/>` )
235
237
}
236
- result += `${ fileSpace } <Shortcut Id="startMenuShortcut" Directory="${ startMenuShortcutDirectoryId } " Name="${ xmlAttr ( shortcutName ) } " WorkingDirectory="APPLICATIONFOLDER" Advertise="yes" Icon="${ this . iconId } ">\n`
238
+ result += `${ fileSpace } <Shortcut Id="startMenuShortcut" Directory="${ startMenuShortcutDirectoryId } " Name="${ xmlAttr (
239
+ shortcutName
240
+ ) } " WorkingDirectory="APPLICATIONFOLDER" Advertise="yes" Icon="${ this . iconId } ">\n`
237
241
result += `${ fileSpace } <ShortcutProperty Key="System.AppUserModel.ID" Value="${ xmlAttr ( this . packager . appInfo . id ) } "/>\n`
238
242
result += `${ fileSpace } </Shortcut>\n`
239
243
}
@@ -275,10 +279,5 @@ function listToString(list: Array<string>, indentLevel: number) {
275
279
}
276
280
277
281
function xmlAttr ( str : string ) {
278
- return str
279
- . replace ( / & / g, "&" )
280
- . replace ( / < / g, "<" )
281
- . replace ( / > / g, ">" )
282
- . replace ( / " / g, """ )
283
- . replace ( / ' / g, "'" )
282
+ return str . replace ( / & / g, "&" ) . replace ( / < / g, "<" ) . replace ( / > / g, ">" ) . replace ( / " / g, """ ) . replace ( / ' / g, "'" )
284
283
}
0 commit comments