问题
When I am running the windows installer build using WIX 2.0 tool set i am getting the below error.
error CNDL0027 : The File/@Name attribute's value, 'apcsystray.exe', is not a valid 8.3-compliant name. Legal names contain no more than 8 characters followed by an optional extension of no more than 3 characters. Any character except for the follow may be used: \ ? | > < : / * " + , ; = [ ] (space).
I am suspecting that it is due to the old version because i am using windows 10 32 bit environment.
So do i need to migrate the code and use WIX 3.0 version to resolve this error?
Regards, Prakash
回答1:
WiX 2: I would definitely migrate any WiX 2.0 sources to WiX 3 or WiX 4. I use WiX 3 only. I think you can solve this particular problem by putting your WiX source on a diet - rather than delve too deep in the actual subject matter / problem. Dealing with 8.3 file names is just a waste of time if you ask me. Avoid if you can. I feel sorry for developers who have to deal with all this old, legacy stuff in Windows.
Simplify WiX Markup: In other words I think this problem can be "removed rather than fixed". So bear with me: I like to slim my WiX source files down to the bare necessities and allow as many fields as possible to be auto-magically added by the compiler (candle.exe
) and linker (light.exe
). This is possible to do because a lot of fields are just "boilerplate" or redundant and will always "change together". They might as well be auto-generated.
Here is a quick description of how you can remove superfluous XML attributes in newer WiX sources: Syntax for guids in WIX? (recommended read - should be quick).
The gist of it is that you can do this:
<Component>
<File Source="..\File.dll" />
</Component>
instead of the older, more elaborate:
<!-- Sample guid below, do not copy paste -->
<Component Id="File.dll" Guid="{12345678-1234-1234-1234-123456789ABC}">
<File Id="File.dll" Name="File.dll" KeyPath="yes" Source="..\File.dll" />
</Component>
All the missing attributes will be auto-populated by WiX - making it easier to implement any changes in the compiler and linker that is picked up by your "slimmer source". Should an attribute be needed - for some reason - you will be told to add it by the compiler / linker / documentation.
Solution?: Accordingly, please try to remove the whole Name attribute
and see if this solves your problem. I would remove as many other fields as possible as well (should make future migration easier - maybe).
来源:https://stackoverflow.com/questions/52063202/error-cndl0027-the-file-name-attributes-value-apcsystray-exe-is-not-a-va