Saturday 15 August 2015

windows installer - (WiX) Program files shortcut for per-machine install -


After

, I added a shortcut to launch my application. (My code is really simple because I do not need additional folders.)

  & lt; DirectoryRef id = 'ProgramMenuFolder' & gt; & Lt; Component id = 'cmpStartMenuShortcut' guise = 'guide here my' & gt; & Lt; Shortcut ID = 'StartMenuShortcut' = '$ (var.ProductName)' Icon = 'MainIcon.ico' Description = '$ (var.ProductName)' target = '[ClientDir] myapp.exe' Working directory = 'ClientDir' / & Gt; & Lt; RegistryValue action = 'write' type = 'integer' root = 'HKCU' key = 'software \ company \ product name' name = 'installed' value '1''s path = 'yes' /> & Lt; / Component & gt; & Lt; / DirectoryRef & gt; My installation is per machine (ALLUSERS = 1, Package / @ InstallPrivileges = 'elevated', and @ InstallScope = 'perMachine') Programmable folder for all users on the machine.  

My question is to do with the registry value. My understanding is that there is a need to provide a KeyPath for that component which includes the shortcut. The sample uses the HKCU, which is the per-user location.

Is it not a mistake to use a per-user value as a keypath for a per-machine component?

If a machine has two administrators, and the administrator installs # 1 product, and the administrator # 2 tries to repair a repair, the Windows Installer will not see the registry value and it seems that The shortcut is missing and install it a duplicate, okay?

So I tried to change the registry value / @ root to HKLM, but then YX complains:

error LGHT0204: ICE38: Component installs cmpStartMenuShortcut user Profile's This [type] keypath registry key should come under HKCU.

Error LGHT0204: ICE43: Component cmpStartMenuShortcut has non-advertised shortcuts [SIC] keypath registry key should come under HKCU.

Error LGHT0204: ICE57: Component 'cmpStartMenuShortcut' has both each user and per machine data with a per-user keypath.

I do not understand why the key should be subject to HKCU.

The goal of that style shortcut is for the target, which can no longer be installed and neither Is used only at that time. This creates the classic .lnk shortcut file. It is useful for shortcuts to target that your installer is not responsible for it but can be useful for the use of users of your product (eg CMD.XA)

Alternatively, A shortcut will be uninstalled to target or advertise when the goal is inadvertently (the product is uninstalled). For example, YX has wix.chm installed a shortcut named YX Documentation. Shortcut element can be made a child of the file element for an ad shortcut.

Here is a hand written example:

  & lt; Component ID = "ProductCompany" & gt; & Lt; File source = "$ (var.ConsoleApplication1.TargetPath)" keypath = "yes" & gt; & Lt; Shortcut ID = "$ (var.ConsoleApplication1.TargetName) shortcut" name = "$ (var.ConsoleApplication1.TargetName)" Advertise "=" Yes "Details =" $ (var.ConsoleApplication1.TargetName) starts "directory = "Programmanus folder" / & gt; & lt; / file & gt; & lt; / component & gt;   

To insert the shortcut element in the heat output, it has an XSL Pass the path of the transform snippet:

     

No comments:

Post a Comment