Replies: 2 comments 3 replies
-
All components have a directory, regardless of what's in them. TARGETDIR can change between install and repair/uninstall/patch/upgrade, so it's not a good directory to use. Typically, A better message would be great. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Also, you can simplify your code both in WiX v3 and v4 by doing the following: <?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<ComponentGroup Id="CMG_SomeComponentGroup" Directory="PICK_SOMETHING_BETTER_THAN_TARGETDIR">
<Component Id="CMP_SomeComponent" Guid="{some-guid}">
<RegistryValue Root="HKLM"
Key="Software\some-company\some-product\Addons"
Name="some-name"
Type="string"
Value=""
KeyPath="yes" />
</Component>
</ComponentGroup>
</Wix> And when you can change the GUID you can simplify it to: <?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<ComponentGroup Id="CMG_SomeComponentGroup" Directory="PICK_SOMETHING_BETTER_THAN_TARGETDIR">
<Component>
<RegistryValue Root="HKLM"
Key="Software\some-company\some-product\Addons"
Name="some-name"
Type="string"
Value="" />
</Component>
</ComponentGroup>
</Wix> Cleaner code will convert better. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a v3.11 wxs file containing:
After converting to Wix 4.0 it became:
I get following error in the log (which is understandable):
When I build I get the following build error:
Which makes sense as the Component no longer is wrapped in the
<DirectoryRef Id="TARGETDIR">
element.I wrap the component in a directoryref pointed to my install folder ("some-drive/programsFolder/some-manufacturer/some-product") and problem solved.
Should I create an issue to request that the conversion log mention specifically that it removed the directoryRef and the user should add one back in or maybe that it shouldn't delete the directoryref and just delete the TARGETDIR text within the Id attribute and ask the user to refer to another directory ID?
The above component contains a registeryValue and not a file so would it be a good feature request for WixToolset to automatically add a directoryref to that component during build? The same way (I think) that the StandardDirectory element is creating a
<Directory Id="TARGETDIR" Name="">
in the background.Or is there a reason a developer has to specify a directory for a component only containing a registry value?
Beta Was this translation helpful? Give feedback.
All reactions