I've followed the instructions here:
http://wix.sourceforge.net/manual-wix3/create_start_menu_shortcut.htm, to
add a start menu shortcut, and while that produces no warnings, I thought it
would be more elegant to use [#MyApplicationFile] for the target like this:

 

    <DirectoryRef Id="ApplicationProgramsFolder">

      <Component Id="ApplicationShortcut" Guid="...">

        <Shortcut Id="ApplicationStartMenuShortcut"

                  Name="My Application Name"

                  Description="My Application Description"

                  Target="[#MyApplicationFile]"

        WorkingDirectory="INSTALLFOLDER"/>

        <RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>

        <RegistryValue Root="HKCU"

                       Key="Software\MyCoConsoleTestApp"

                      Name="installed" Type="integer" Value="1"
KeyPath="yes"/>

      </Component>

    </DirectoryRef>

 

While the above appears to work fine, it gives the following warning (which
seems reasonable):

 

warning LGHT1076: ICE69: Mismatched component reference. Entry
'ApplicationStartMenuShortcut' of the Shortcut table belongs to component
'ApplicationShortcut'. However, the formatted string in column 'Target'
references file  'MyApplicationFile' which belongs to component
'ProductComponent'. Components are in the same feature.

 

So, I tried moving the shortcut into the component 'ProductComponent'...

 

    <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">

      <Component Id="ProductComponent">

        <File Id="MyApplicationFile"

              Name="$(var.ConsoleApplication1.TargetFileName)"

              Source="$(var.ConsoleApplication1.TargetPath)"

               DiskId="1" KeyPath="yes" />

        <RegistryKey Root="HKLM" Key="Software\MyCo\TestProductRegistryKey">

          <RegistryValue Type="string"

                         Value="[INSTALLFOLDER] p1 p2 p3"

                         Name="ThingyValue"  />

        </RegistryKey>

        <Shortcut Id="ApplicationStartMenuShortcut"
Directory="ApplicationProgramsFolder"

                  Name="My Application Name"

                  Description="My Application Description"

                  Target="[#MyApplicationFile]"

                  WorkingDirectory="INSTALLFOLDER" />

        <RegistryValue Root="HKCU"

                       Key="Software\MyCo\ConsoleTestApp"

                      Name="installed" Type="integer" Value="1"
KeyPath="yes" />

      </Component>

    </ComponentGroup>

 

 

But that gives rise to:

error CNDL0042: The Component element has multiple key paths set.  The key
path may only be set to 'yes' in extension  elements that support it or one
of the following locations: Component/@KeyPath, File/@KeyPath,
RegistryValue/@KeyPath, or  ODBCDataSource/@KeyPath.

 

If I remove the KeyPath from the RegistryValue or the File elements, I get
into a spiralling mess of more errors.

 

So, what's the neatest way of installing a file and providing a start menu
shortcut to it (and using [#idname] reference)?

 

Dave

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to