@@ -156,11 +156,13 @@ export default class MsiTarget extends Target {
156
156
const compression = this . packager . compression
157
157
const options = this . options
158
158
const iconPath = await this . packager . getIconPath ( )
159
+ const iconId = `${ appInfo . productFilename } Icon.exe` . replace ( / \s / g, "" )
159
160
return ( await projectTemplate . value ) ( {
160
161
...commonOptions ,
161
162
isCreateDesktopShortcut : commonOptions . isCreateDesktopShortcut !== DesktopShortcutCreationPolicy . NEVER ,
162
163
isRunAfterFinish : options . runAfterFinish !== false ,
163
164
iconPath : iconPath == null ? null : this . vm . toVmFile ( iconPath ) ,
165
+ iconId : iconId ,
164
166
compressionLevel : compression === "store" ? "none" : "high" ,
165
167
version : appInfo . getVersionInWeirdWindowsForm ( ) ,
166
168
productName : appInfo . productName ,
@@ -221,8 +223,9 @@ export default class MsiTarget extends Target {
221
223
if ( isMainExecutable && ( isCreateDesktopShortcut || commonOptions . isCreateStartMenuShortcut ) ) {
222
224
result += `>\n`
223
225
const shortcutName = commonOptions . shortcutName
226
+ const iconId = `${ appInfo . productFilename } Icon.exe` . replace ( / \s / g, "" )
224
227
if ( isCreateDesktopShortcut ) {
225
- result += `${ fileSpace } <Shortcut Id="desktopShortcut" Directory="DesktopFolder" Name="${ shortcutName } " WorkingDirectory="APPLICATIONFOLDER" Advertise="yes" Icon="icon.ico "/>\n`
228
+ result += `${ fileSpace } <Shortcut Id="desktopShortcut" Directory="DesktopFolder" Name="${ shortcutName } " WorkingDirectory="APPLICATIONFOLDER" Advertise="yes" Icon="${ iconId } "/>\n`
226
229
}
227
230
228
231
const hasMenuCategory = commonOptions . menuCategory != null
@@ -231,7 +234,7 @@ export default class MsiTarget extends Target {
231
234
if ( hasMenuCategory ) {
232
235
dirs . push ( `<Directory Id="${ startMenuShortcutDirectoryId } " Name="ProgramMenuFolder:\\${ commonOptions . menuCategory } \\"/>` )
233
236
}
234
- result += `${ fileSpace } <Shortcut Id="startMenuShortcut" Directory="${ startMenuShortcutDirectoryId } " Name="${ shortcutName } " WorkingDirectory="APPLICATIONFOLDER" Advertise="yes" Icon="icon.ico ">\n`
237
+ result += `${ fileSpace } <Shortcut Id="startMenuShortcut" Directory="${ startMenuShortcutDirectoryId } " Name="${ shortcutName } " WorkingDirectory="APPLICATIONFOLDER" Advertise="yes" Icon="${ iconId } ">\n`
235
238
result += `${ fileSpace } <ShortcutProperty Key="System.AppUserModel.ID" Value="${ this . packager . appInfo . id } "/>\n`
236
239
result += `${ fileSpace } </Shortcut>\n`
237
240
}
0 commit comments