获取位置路径 Wix 安装
问题描述:
如果我想访问 mylocation.txt 文件,如何获取位置路径,该文件当前在 E:drive 中.
How to get location path if i want to access mylocation.txt file, this file currently is in E:drive.
[CustomAction]
public static ActionResult FillList(Session xiSession)
{
//Can i get store mylocation.txt into application root instead of E location
string path = "Mylocation.txt";
// Open the file to read from.
string[] readText = File.ReadAllLines(path);
foreach (string s in readText)
{
//Console.WriteLine(s);
FillComboBox(xiSession, s, s);
}
xiSession["COUNTRIES"] = "--Select Location--";
return ActionResult.Success;
}
我可以将 mylocation.txt 存储到应用程序根目录而不是 E location.And 如何调用 mylocation.txt 吗?基本上我想要的是从这个文本文件中获取 combox 的值,一旦安装正在进行.
Can i get store mylocation.txt into application root instead of E location.And how mylocation.txt can be called?Basically what i want is to get the values of combox from this text file,once installation is in progress.
答
将 Mylocation.txt
作为资源文件附加到自定义操作项目中.从此讨论.
Attach the Mylocation.txt
as resource file in Custom action project. Get more details from this discussion.