I'm using WiX3.
I am trying to make a shortcut as part of installing a component. The
shortcut is to a launcher application that is installed in another component
with a command-line argument that has the path to a file in the component
that contains the shortcut.
If I just use:
...
<Component Id="thing1" Guid="66327869-9389-427e-8A87-0C4F1A1B6F92">
<File Id="file1" Source="..\Project\Output\a_file"
Name="some_file" />
<Shortcut Id="setupShortcut" Name="Do Stuff with Some File"
Directory="MySubMenuDir" Target="[!launcher.exe]" Arguments='-jar
"[!file1]"' WorkingDirectory="INSTALLDIR"/>
</Component>
...
<Directory Id="ProgramMenuFolder" Name="Programs">
<!-- We use a Digital Rapids sub-folder in the start menu -->
<Directory Id="MySubMenuDir" Name="My Sub Menu"/>
</Directory>
Then I get the following error:
Error LGHT0204: ICE43: Component thing1 has non-advertised shortcuts. It
should use a registry key under HKCU as its Error LGHT0204: ICE57: Component
'thing1 ' has both per-user and per-machine data with a per-machine KeyPath.
To which I say "Huh?" The ALLUSERS property is set to "1" so I don't
understand why it claims that there is per-user data.
Anyway I attempt what to me is the obvious work-around I set Advertise="yes"
on the shortcut... which leads to:
Error CNDL0035: The Shortcut/@Target attribute cannot be specified when
attribute Advertise is present with value 'yes'.
ok, fine... that might make sense... [blood pressure rising]...
So I take out the advertise property and decide to use the other obvious
fix.. that is, do what it told me and use a reg key under HKCU - even though
this smells really bad, as I don't want to be installing per-user data, and
don't think that I am...
So I add to my component the following:
<Registry Id="bullshit1" KeyPath="yes" Root="HKCU"
Key="Software\MyCompany\SomeRandomKey" />
<RemoveRegistryKey Action="removeOnUninstall" Root="HKCU"
Key="Software\MyCompany\SomeRandomKey"/>
This works, but then I get the following warning:
Warning CNDL1080: The Registry element has been deprecated. Please use one
of the new elements which replaces its functionality: RegistryKey for
creating registry keys, RegistryValue for writing registry values,
RemoveRegistryKey for removing registry keys, and RemoveRegistryValue for
removing registry values.
But the "new" ways don't have an attribute to set the registry key as the
KeyPath for the component. [blood pressure rising...]
Can someone explain why the ALLUSERS install is causing problems with
per-user data in the first place?
Shall I ignore the warning above and just use a bogus reg key in the hope
that I can just put this all behind me?
Is something missing from RegistryKey so that it can beused as a KeyPath?
Is it just me or does everyone else find working with MSI infuriating ? I'm
worried that I will be driven to do something violent... ;-)
Scott
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users