问题
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:
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.
回答2:
I tried to use Sysnative in wxs file but I got the same result: create a Sysnative folder under Windows instead of using System32. So I used Sysnative in a vbscript CA: found the Windows folder (&H24&) and append \Sysnative. This works, but a second CA is needed to delete the files during uninstall.
回答3:
I solved my problem by writing the files to \windows, 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.
来源:https://stackoverflow.com/questions/1348217/msi-installer-64-bit-os-write-to-windows-system32-inetsrv-folder