我需要将文件安装到Environment.SpecialFolder.ApplicationData文件夹中,这在XP和Vista中有所不同.是否有内置的方式在WiX中引用正确的文件夹,还是我必须对OS使用条件检查并手动进行?
I need to install a file into the Environment.SpecialFolder.ApplicationData folder, which differs between XP and Vista. Is there a built in way to reference the correct folder in WiX or will I have to use conditional checks for OS and do it manually?
如果必须执行后者,如何在Vista中引用当前Windows用户的目录?
If I have to do the latter, how do I reference the current windows user's directory in Vista?
推荐答案使用ID设置为 AppDataFolder :
<Directory Id="AppDataFolder"> <Directory Id="MyAppFolder" Name="My"> <Component Id="MyComponent"> <File Source="Files\test1.txt" /> </Component> </Directory> </Directory>这将导致将test1.txt安装到Windows 7上的C:\ Users \ 用户名 \ AppData \ Roaming \ My以及C:\ Documents and Settings \ 用户名 \ Application Data \ My.
This will result in test1.txt being installed to C:\Users\username\AppData\Roaming\My on Windows 7 and to C:\Documents and Settings\username\Application Data\My on Windows XP.
MSDN具有属性列表可用于引用特殊文件夹.
MSDN has a list of properties that you can use to reference special folders.
更多推荐
.NET的Environment.SpecialFolder.ApplicationData的WiX等效项是什么?
发布评论