Wix - shortcut for website

I am new to wix. You must create a shortcut for the local website.

It works fine and creates shorcuts, but it doesn’t show the icons in the Start menu and on the desktop ... There is a favicon file on the website, and when I open the website, I see it perfectly - I just don't see it in the shortcut . I tried to do this, but I did not find a good answer to use: InternetShortcut ..

My code is:

<DirectoryRef Id="ApplicationProgramsFolder"> <Component Id="ApplicationShortcutBBBApp" Guid="---"> <util:InternetShortcut Id="ApplicationStartMenuShortcutBBBApp" Name="BBB" Target="http://localhost/BBB"/> <util:InternetShortcut Id="ApplicationDesktopShortcutBBBApp" Name="BBB" Directory="DesktopFolder" Target="http://localhost/BBB"/> <RegistryValue Root="HKCU" Key="Software\Microsoft\BBB" Name="installed" Type="integer" Value="1" KeyPath="yes"/> </Component> </DirectoryRef> 
+6
source share
3 answers

InternetShortcut does not support specifying an icon, such as a regular shortcut. To do this, open the function request here. Technically, Windows IUniformResourceLocator shortcuts do not support badges, although IShellLink shortcuts do.

+1
source

There is an easier solution to this problem. Instead of using InternetShortcut, you can just use a regular shortcut and use the trick to set the target as url.

 <SetProperty Id="URL" Value="http://yourpage.com" Sequence="execute" Before="CreateShortcuts" /> <Shortcut Directory="DesktopFolder" Id="WebShortcut" Name="Your Page" Description="Your Page Description" Target="[URL]" Icon="IconDesktop"> <Icon Id="IconDesktop" SourceFile="images\icon.ico" /> </Shortcut> 

"SetProperty" can be placed anywhere in your Product tag. Instead of InternetShortcut, place a Shortcut. It is important to have the [URL] property as the target. As a property, this could be a URL. It is written that this does not work. There may be warnings in the heat / candles / lights, they can be ignored.

+13
source

He answered this a bit late, but just had to do the same. The approach I took was to use the iniFile element to extract the url file.

Two points of interest with this approach:

  • Since the shortcut is on the desktop, and the icon file is located elsewhere in the file system, I needed to create separate components for deploying the icon file.
  • If MSI starts as a regular user with UAC enabled, the icon is not set for the shortcut. As soon as I disabled UAC before installation, the icon was installed correctly.

     <Fragment> <DirectoryRef Id="DesktopFolder"> <Component Id="ProductInternetShortcut" Guid="{YOUR_GUID_HERE}" > <IniFile Id="url_name" Action="addLine" Directory="DesktopFolder" Section="InternetShortcut" Name="ProductInternetShortcut.url" Key="URL" Value="https://my.url.com/" /> <IniFile Id="url_target" Action="addLine" Directory="DesktopFolder" Section="InternetShortcut" Name="ProductInternetShortcut.url" Key="Target" Value="https://my.url.com/" /> <IniFile Id="url_idlist" Action="createLine" Directory="DesktopFolder" Section="InternetShortcut" Name="ProductInternetShortcut.url" Key="IDList" Value=" " /> <IniFile Id="url_HotKey" Action="addLine" Directory="DesktopFolder" Section="InternetShortcut" Name="ProductInternetShortcut.url" Key="HotKey" Value="0" /> <IniFile Id="url_icon" Action="addLine" Directory="DesktopFolder" Section="InternetShortcut" Name="ProductInternetShortcut.url" Key="IconFile" Value="PATH_TO_ICON_FILE_ON_WORKSTATION" /> <IniFile Id="url_iconIndex" Action="addLine" Directory="DesktopFolder" Section="InternetShortcut" Name="ProductInternetShortcut.url" Key="IconIndex" Value="0" /> <RegistryValue Root="HKCU" Key="Software\COMPANY\PRODUCT" Name="installed" Type="integer" Value="1" KeyPath="yes" /> </Component> </DirectoryRef> <DirectoryRef Id="ProductFolder"> <Component Id="ShortcutIcons" Guid="{YOUR_GUID_HERE}"> <File Id="filProductIcons" KeyPath="yes" Source="PATH_TO_ICON_FILE_ON_DEVELOPER_MACHINE" /> </Component> </DirectoryRef> </Fragment> 
0
source

Source: https://habr.com/ru/post/918661/


All Articles