views:

649

answers:

2

On Windows Server 2008 64-bit, I need an .msi installer file to write some files to \windows\system32\inetsrv folder. (The files are some XML Schema validation files, that C# XmlReaderSettings.Schema.Add() expects to be in that folder).

When the installer runs, the files end up in \windows\SysWOW64\inetsrv folder, not where they need to be.

I attempted to have the installer then write to \windows\Sysnative folder, and the installer created a folder with that exact name, which I didn't expect to be possible. See this page for a good discussion on suppressing SysWOW64 redirection.

How should I get the .msi to write my files to the \windows\system32\inetsrv folder on Windows 2008 64-bit?

+1  A: 

Here are the system folder properties you can use. I know it is counter-intuitive, but have you tried System64Folder? Read the remarks.

If that doesn't work, try just tacking System32 on to the end of WindowsFolder.

Edit-1: Try setting the Win64 attribute on your Component element and see if the redirection behavior changes.

jeffamaphone
Jeff, The system folder properties you supplied are helpful. However, I get a compiler error that the target platform is incompatible if I try to use System64Foler. My application must be installed on both x86 and x64.Tacking System32 on the end of WindowsFolder causes the output to go to \Windows\SysWOW64\ due to the SysWOW64 redirection.
aaaa bbbb
Darn. That's sort of the extent of my knowledge. :(
jeffamaphone
Try the win64 thing.
jeffamaphone
I'm trying to find where in Visual Studio to set win64. Maybe it is done with target platform x86?I'm also worried that once I set this value in making the project that it will no longer install on a 32 bit machine. Hints and thoughts?
aaaa bbbb
You put it in the WiX XML, not in your Project's build configuration. There should be a <compontent> tag. See the link...
jeffamaphone
A: 

I solved my problem by writing the files to \windwos, rather than \windows\system32. It turns out that the C# XmlReaderSettings.Schema.Add() will work with a fully qualified path under the \windows directory. It just defaults to the system32 folder if the path supplied is not fully qualified.

This isn't really an answer to the question, but it is a work-around for my immediate needs.

aaaa bbbb