I'm using XmlFile action 
(http://schemas.microsoft.com/wix/UtilExtension/XmlFile) to update an XML file, 
which is deploying to System32 folder.

I've using the following code initially (removing some unrelated attributes):
    <Directory Id="TARGETDIR">
        <Directory Id="SystemFolder">
            <Component>
                <File Id="fileConfig" Name="file.config" />
                <util:XmlFile File="[# fileConfig]" Action="setValue" 
ElementPath=" " Name="value" Value=" " />
            </Component>
      </Directory>
    </DirectoryRef>

On 64bit platform the code deploys the file into SysWOW64 folder and updates it.
So I fix the code as following:
    <?if $(env.BUILDTARGET) = "i386"?>
        <?define IsWin64  = no?>
        <?define WinSystemFolder = SystemFolder?>
    <?else ?>
        <?define IsWin64  = yes?>
        <?define WinSystemFolder = System64Folder?>
    <?endif ?>
    <Directory Id="TARGETDIR">
        <Directory Id="$(var.WinSystemFolder)">
            <Component Win64="$(var.IsWin64)">
                <File Id="fileConfig" Name="file.config" />
                <util:XmlFile File="[# fileConfig]" Action="setValue" 
ElementPath=" " Name="value" Value=" " />
            </Component>
      </Directory>
    </DirectoryRef>

Now the code deploys the file to the right location (System32), but XmlFile 
action throws the following error:
Failed to open XML file D:\WINDOWS\system32\file.config, system error: 
-2147024786
where -2147024786 stands for 0x8007006E: The system cannot open the device or 
file specified.

Is it indeed a bug in XmlFile action for 64bit platform?
If so, is there a way to work around it?

Thank you,
Max
-------------------------------------------------------------------------
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-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to