This file at LIBREOFFICE_PROGRAMFILES\program\desktophelper.txt
is really useful?
Yes, desktophelper.txt is important. As it says, '# File used for desktop link'. It used by the Windows installer to create desktop launcher icon for LibreOffice.
It is hard to believe this is a normal/clean way to do it, that is why I asked for it with this post—with little detail I admit, I think it is more a workaround, no?
See the documentation of MSI Shortcut table:
The external key into the first column of the Component table. The installer uses the installation state of the component specified in this column to determine whether the shortcut is created or deleted. This component must have a valid key path for the shortcut to be installed.
Our requirement is that desktop icon should be optional, therefore we cannot use e.g. soffice.exe, we need the conditionally installed desktophelper.txt. I can imagine that it can be done in a different way, but what would be the benefit?
Maybe with “HKEY_LOCAL_MACHINE\SOFTWARE\LibreOffice” and put a value which could help you for this case, especially if this is the only case for this kind of technique.
If this can work, it will be more correct I think—which is probably the only benefit. If this can work and it is not specially disturbing to do, I think you should consider this approach.