Something else to consider: instead if using loc variables, try organizing your build location so that bind paths can be used. Then when building you can provide the appropriate bindpath on the command-line. I do this to minimize the File/@Source elements all the time. "Named base paths" can be quite useful.
On Mon, Jun 18, 2012 at 12:08 PM, Frank Jenner <frank8...@gmail.com> wrote: > I think that I may have caused some confusion by naming the File/@Id field > the way I did in my example. In reality, I am using "heat"-style ID's (for > example "filB75B712DC4A64A7882230FE0BCC0CC3E") for all of my files. > Regardless of the ID convention, though, I get the same errors. > > However, I did just try out specifying File/@Name in addition to > File/@Source, and that seems to have done the trick! Now I have something > like this: > > <String > Id="WelcomeDoc">MySourceFiles\documentation\es\Bienvenido.txt</String> > <String Id="WelcomeDocFile">Bienvenido.txt</String> > ... > <File Name="!(loc.WelcomeDocFile)" Source="!(loc.WelcomeDoc)" KeyPath="yes" > /> > > Unfortunately, it doubles the number of localization Strings that I need, > and introduces some duplication, but ultimately it works. > > (I tried defining WelcomeDoc as <String > > Id="WelcomeDoc">MySourceFiles\documentation\es\!(loc.WelcomeDocFile)</String> > in order to eliminate the filename duplication, but the use of the "nested" > localization string appears to be treated literally and yields the > following error: error LGHT0103 : The system cannot find the file > 'MySourceFiles\documentation\es\!(loc.WelcomeDocFile)'.) > > Thanks for the pointer in the right direction! > ___________ > Frank Jenner > > > On Mon, Jun 18, 2012 at 2:08 PM, Rob Mensching <r...@robmensching.com> > wrote: > > > Instead of specifying File/@Id, try specifying File/@Name. I think the > > issue is that the File/@Name is defaulting to the value from > File/@Source. > > By specifying File/@Name you are telling the WiX toolset the explicit > file > > name to use for the install. File/@Id will default to File/@Name giving > > you the same result in the end. > > > > On Mon, Jun 18, 2012 at 4:49 AM, Frank Jenner <frank8...@gmail.com> > wrote: > > > > > Thanks, I suppose that solution could work. > > > > > > Nonetheless, I feel like this should be a fairly common scenario and > that > > > there should be some way to support it using the built-in localization > > > features. I think that this would be easy if either all of the > localized > > > source files (in my example, the File with Id="Welcome.txt") were in > the > > > same directory. However, in my case, all of the localized files are in > > > language-specific subdirectories in order to prevent possible filename > > > collisions and aid in organization. Unfortunately, when this directory > > > information is added to the Source attribute, it gets put into the File > > > table with this directory information, which causes errors during > > linking. > > > > > > How do people normally approach this use case? Is the built-in > > localization > > > functionality not really the appropriate approach here? > > > ___________ > > > Frank Jenner > > > > > > > > > On Mon, Jun 18, 2012 at 3:22 AM, Rob Hamflett < > rob_hamfl...@sn.scee.net > > > >wrote: > > > > > > > You could try doing this with variables instead of localised strings. > > > > If there are a lot of these variables then you could put the command > > > > line arguments for defining them into a file and add "@filename.txt" > to > > > > your command line, with a different file for each language. > > > > > > > > Rob > > > > > > > > > > > > On 15/06/2012 17:49, Frank Jenner wrote: > > > > > In my install source hierarchy, I have different localized versions > > of > > > > > files in different directories. So far, I have something that looks > > > like > > > > > this: > > > > > > > > > > [Install.wxs] > > > > > ... > > > > > <Component Id="welcome.txt" > > > > > Guid="{49A4E289-5B76-4DD4-BE7A-145C9FC3E4B9}"> > > > > > <File Id="welcome.txt" Source="!(loc.WelcomeDoc)" > > > > > KeyPath="yes"/> > > > > > </Component> > > > > > ... > > > > > > > > > > [Resources_en-us.wxl] > > > > > <?xml version="1.0" encoding="utf-8"?> > > > > > <WixLocalization Culture="en-us" xmlns=" > > > > > http://schemas.microsoft.com/wix/2006/localization"> > > > > > <String Id="LangID">1033</String> > > > > > <String > > > > > Id="WelcomeDoc">MySourceFiles\documentation\en\Welcome.txt</String> > > > > > </WixLocalization> > > > > > > > > > > [Resources_es-es.wxl] > > > > > <?xml version="1.0" encoding="utf-8"?> > > > > > <WixLocalization Culture="es-es" xmlns=" > > > > > http://schemas.microsoft.com/wix/2006/localization"> > > > > > <String Id="LangID">1034</String> > > > > > <String > > > > > > > Id="WelcomeDoc">MySourceFiles\documentation\es\Bienvenido.txt</String> > > > > > </WixLocalization> > > > > > > > > > > etc. > > > > > > > > > > Unfortunately, when I run light.exe, I get the following errors for > > any > > > > > files that attempt to use a localized string in the Source > attribute: > > > > > > > > > > error LGHT0204 : ICE03: Invalid Filename; Table: File, Column: > > > FileName, > > > > > Key(s): welcome.txt > > > > > > > > > > If I look at the Files table, it seems that the non-localized files > > > > (which > > > > > have a hard-coded Source attribute) have their leading path > > information > > > > > (for example, MySourceFiles\documentation\) stripped off, whereas > the > > > > > localized files contain the leading path information. This extra > path > > > > > information in the Files table, presumably, accounts for the error. > > I'm > > > > > guessing that candle.exe handled the path information such that, > when > > > the > > > > > language strings are resolved from the localization files in > > light.exe, > > > > it > > > > > is too late for localized files to get the same treatment. > > > > > > > > > > That said, what is the correct way add localized files? > > > > > ___________ > > > > > Frank Jenner > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > > > 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/ > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > > 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 > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > 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 > > > > > > > > > > > -- > > virtually, Rob Mensching - http://RobMensching.com LLC > > > > > ------------------------------------------------------------------------------ > > 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 > > > > ------------------------------------------------------------------------------ > 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 > -- virtually, Rob Mensching - http://RobMensching.com LLC ------------------------------------------------------------------------------ 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