.NET的Environment.SpecialFolder.ApplicationData的WiX等效项是什么?

编程入门 行业动态 更新时间:2024-10-26 00:27:53
本文介绍了.NET的Environment.SpecialFolder.ApplicationData的WiX等效项是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我需要将文件安装到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等效项是什么?

本文发布于:2023-11-13 23:42:58,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1585633.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Environment   NET   SpecialFolder   WiX   ApplicationData

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!