2008/10/23 Matt Siebert <[EMAIL PROTECTED]>:
> Please forgive my ignorance but creating a per-user reg key as a keypath for
> a per-machine shortcut seems very wrong in that the reg key can easily
> become orphaned.

You are perfectly right. But as I told you Windows Installer and the
ICE validation does sometimes cut corners; perhaps they want to save
their underlying implementation.
This is what Rob's blog link states.
I proposed you two workarounds, try to advertise if you're unpleased
with orphaning reg keys and values.

>
> Perhaps this is why the Windows Server 2008 Software Logo
> Specifications<http://go.microsoft.com/fwlink/?LinkID=111723>don't
> include ICEs 43 or 57...
>
> On Wed, Oct 22, 2008 at 8:35 PM, Sébastien Mouren <
> [EMAIL PROTECTED]> wrote:
>
>> 2008/10/22 Matt Siebert <[EMAIL PROTECTED]>:
>> > Hi all,
>> >
>> > I'm new to WiX and I'm trying to create a test install for a single file
>> > with a shortcut in the "All Users" profile.
>> >
>> > The file I'm installing is going to %programfiles%\Company\Product and I
>> > want to place a shortcut in %allusersprofile%\Desktop.
>> >
>> > I've done a lot of googling and searched the archives for this mailing
>> list
>> > and it seems that everyone who has had a similar problem has been
>> directed
>> > to
>> >
>> http://robmensching.com/blog/archive/2007/04/27/How-to-create-an-uninstall-shortcut-and-pass-all-the.aspx
>> ,
>> > but I can't see how that post solves the issue - it installs shortcuts to
>> > the current user's profile using a RegistryValue as the KeyPath (I
>> already
>> > did this to create a per-user test install) but doesn't show how to
>> install
>> > shortcuts to the "All Users" profile in a per-machine install.
>> >
>> > Here is my very simple product.wxs:
>> >
>> > <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";>
>> >  <Product Id="{PUT-GUID-HERE}" Name="Product" Language="1033" Version="
>> > 1.0.0.0" Manufacturer="Company" UpgradeCode="{PUT-GUID-HERE}">
>> >    <Package InstallerVersion="200" Compressed="yes"/>
>> >    <Media Id="1" Cabinet="TestApp.cab" EmbedCab="yes"/>
>> >    <Property Id="ALLUSERS" Value="1"/>
>> >
>> >    <Directory Id="TARGETDIR" Name="SourceDir">
>> >      <Directory Id="ProgramFilesFolder">
>> >        <Directory Id="CompanyFolder" Name="Company">
>> >          <Directory Id="APPLICATIONROOTDIRECTORY" Name="Product"/>
>> >        </Directory>
>> >      </Directory>
>> >      <Directory Id="DesktopFolder"/>
>> >    </Directory>
>> >
>> >    <DirectoryRef Id="APPLICATIONROOTDIRECTORY">
>> >      <Component Id="TestApp" Guid="{PUT-GUID-HERE}">
>> >        <File Source="Product.exe" KeyPath="yes" Checksum="yes"
>> Vital="yes">
>> >          <Shortcut Id="TestAppShortcut" Name="Product"
>> > Directory="DesktopFolder"/>
>> >        </File>
>> >      </Component>
>> >    </DirectoryRef>
>> >
>> >    <Feature Id="MainApplication" Title="Main Application" Level="1"
>> > Absent="disallow" AllowAdvertise="no">
>> >      <ComponentRef Id="TestApp"/>
>> >    </Feature>
>> >  </Product>
>> > </Wix>
>> >
>> > I've set ALLUSERS=1 and this should cause the DesktopFolder property to
>> > point to the desktop folder in the "All Users" profile on the target
>> > machine.
>> >
>> > I get the following errors from light.exe:
>> >
>> > error LGHT0204: ICE43: Component TestApp has non-advertised shortcuts. It
>> > should use a registry key under HKCU as its KeyPath, not a file.
>> > error LGHT0204: ICE57: Component 'TestApp' has both per-user and
>> per-machine
>> > data with a per-machine KeyPath.
>> >
>> > Surely its possible to install non-advertised shortcuts to the "All
>> Users"
>> > profile...
>> >
>> > Any help would be greatly appreciated.
>> >
>> > Thanks,
>> > Matt.
>>
>> The common desktop and a user's desktop uses the same DesktopFolder
>> property: the ALLUSERS property allows to choose between the two.
>> Some ICE tests implements "best practices compliance" defined by the
>> Windows Installer team. These best practices makes harder sometimes
>> for the user to think its setup . There are a few corner case and you
>> seem to be in one of these.
>> A few workaround are possible:
>> -your setup needs to be deployed per machine (ProgramFilesFolder and
>> shortcut place in the common DesktopFolder), why don't you advertise
>> your shorcut and enforce local deployment of the parent feature?
>> -create, as other indicated in their answers, another component like this
>> one:
>>    <Component Id="Shortcut" Guid="*" Directory="ProgramFilesFolder">
>>      <RegistryKey Id='TestAppKey' Root='HKCU'
>> Action='createAndRemoveOnUninstall' Key='Software\Company\Product'>
>>        <RegistryValue Id='TestAppValue' Name='TestAppValue'
>> Type='string' Value='installed' Action='write' KeyPath='yes' />
>>      </RegistryKey>
>>      <Shortcut Id="Link"
>>          Name="Product"
>>          Description="My Application Description"
>>          WorkingDirectory="APPLICATIONROOTDIRECTORY"
>>          Directory="DesktopFolder"
>>          Target="[APPLICATIONROOTDIRECTORY]Product.exe" />
>>    </Component>
>> include this one in your only feature. This one is trickier but read
>> ICE 57 
>> (http://msdn.microsoft.com/en-us/library/aa368994(VS.85).aspx<http://msdn.microsoft.com/en-us/library/aa368994%28VS.85%29.aspx>
>> )
>> and 43 
>> (http://msdn.microsoft.com/en-us/library/aa368968(VS.85).aspx<http://msdn.microsoft.com/en-us/library/aa368968%28VS.85%29.aspx>
>> ).
>> They explain why you should use another component, a per-user reg key
>> as a keypath for a per-machine shortcut. It has a default of orphaning
>> registry key and value if reinstalled multiple times by different
>> users.
>> This snippet won't work as is: requires some cleaning and corrections
>> to your original example.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to