Bugs item #1703013, was opened at 2007-04-18 09:40
Message generated for change (Comment added) made by lornelaliberte
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=642714&aid=1703013&group_id=105970

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: candle
Group: v3.0
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Lorne Laliberte (lornelaliberte)
Assigned to: Nobody/Anonymous (nobody)
Summary: IniFile @Directory doesn't support properties

Initial Comment:
The documentation for the Directory attribute says this:

"Name of a property, the value of which is the full path of the folder 
containing the .ini file. Can be name of a directory in the Directory table, a 
property set by the AppSearch table, or any other property representing a full 
path."

...but the "any other property representing a full path" part doesn't seem to 
hold true.

I've tried it using custom properties set using a Type 51 custom action, and 
I've tried it using system folder properties such as [WindowsFolder] and 
[ProgramFilesFolder], but both generate the same light error 94 (e.g. 
"Unresolved reference to symbol 'Directory:WindowsFolder' in section 
'Fragment:'").

It will work if I add a <Directory> element for the folder property, but from 
the Windows Installer documentation it seems it should work for properties too.

For example, if I use this:

<IniFile Id="INIRemove" Action="removeLine" Directory="ProgramFilesFolder" 
Name="abc.ini" Section="MySection" Key="RemoveThis"/>

...it will only work if there is a corresponding entry like this:

<Directory Id="ProgramFilesFolder" Name="ProgramFilesFolder">

According to the MSI docs, though, it should work even without that directory 
entry.


----------------------------------------------------------------------

>Comment By: Lorne Laliberte (lornelaliberte)
Date: 2007-04-19 10:35

Message:
Logged In: YES 
user_id=1705700
Originator: YES

If you read the code I posted, you'll see I'm using the identifier, not
the formatted string. I was just using the property notation colloquially
within the text to make the property recognizable. Incidentally, candle
seems to remove the square brackets anyway if you use them there; at least,
light generates the same error with the brackets removed, whether or not
you include the brackets. But the brackets are irrelevant -- the problem is
that according to the MSI documentation using the identifier of a directory
*OR* any property that contains a full path should work.

So we either need to add a Property attribute to IniFile, or make the
Directory attribute support properties (maybe even name it DirProperty), or
modify the documentation to state that property identifiers are not
supported for IniFile in WiX even though they are in MSI.

Perhaps ProgramFilesFolder was too convenient an example -- it also
doesn't work if you use a public property defined using a DirectorySearch,
which is explicitly allowed in the MSI docs.

For example:

<Property Id="FOO" Value="NotFound">
        <DirectorySearch Id="FileSearch" Path="C:\Temp" Depth="5">
                <DirectorySearch Id="FolderSearch" Path="c"/>
        </DirectorySearch>
</Property>

<Component Id="INIRemove" Guid="09015E21-AF31-42F3-BBE2-051A1F406CB1"
KeyPath="yes">
        <IniFile Id="INIRemove" Action="removeLine" Directory="FOO"
Name="abc.ini" Section="MySection" Key="RemoveThis"/>
</Component>

...fails to link, light.exe produces this error:

error LGHT0094 : Unresolved reference to symbol 'Directory:FOO' in section
'Fragment:'.


----------------------------------------------------------------------

Comment By: Heath Stewart (heaths)
Date: 2007-04-19 10:00

Message:
Logged In: YES 
user_id=1335104
Originator: NO

I'm aware of the what the documentation says. The column type is an
Identifier (also in the docs). The docs state a property - not a formatted
stirng with a property in it. The Property table's Property column is also
an Identifier. When Windows Installer bulds its directory tree, it does so
using the Directory table but then each Directory can be treated as a
property, which both type 51 (which only sets a *property*, BTW - notice
the connection) and type 35 can set. [ProgramFilesFolder] is not an
identifier or property, is a string with a property in it.
ProgramFilesFolder is the property identifier, which also is the directory
identifier you need to define in the Directory table.

Again, this is further supported by the fact I said before: a directory
cannot have a NULL parent except for TARGETDIR. Thus, even your standard
directories like ProgramFilesFolder have to be authored in, but Windows
Installer will resolve those directories to shell locations.

----------------------------------------------------------------------

Comment By: Lorne Laliberte (lornelaliberte)
Date: 2007-04-19 09:44

Message:
Logged In: YES 
user_id=1705700
Originator: YES

See the "a property set by the AppSearch table, or any other property
representing a full path" part.

The MSI documentation for DirProperty indicates the same thing by the way
-- which sounds to me that you should be able to use the identifier of any
property that resolves to a full path.

In other words, thanks, but I know what the current limitation in Wix is,
my point is that the restriction is incorrect. :) It should either support
both, or it should be handled more like the other tables with DirProperty
columns (e.g. CopyFile, RemoveFile) which have a Property attribute in
addition to the Directory attribute.


----------------------------------------------------------------------

Comment By: Heath Stewart (heaths)
Date: 2007-04-18 18:16

Message:
Logged In: YES 
user_id=1335104
Originator: NO

The IniFile table's DirProperty is of type Identifier, not Formattable or
its derivatives, which means you'd put in ProgramFilesFolder instead of
[ProgramFilesFolder], for example. Even then, the ProgramFilesFolder must
exist in your Directory table. So, as such, WiX requires that you author it
so that the ProgramFilesFolder ends up in the Directory table and Windows
Installer can build the directory tree. Rows in the Directory table can't
have a foreign key to a parent that doesn't exist in the Directory table.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=642714&aid=1703013&group_id=105970

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
WiX-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-devs

Reply via email to