如何从文件Wix读取字符串 [英] How to Read a string From a File Wix

查看:78
本文介绍了如何从文件Wix读取字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个文件test.txt,其文本为"FileName"

There is a file test.txt which is having a text "FileName"

我想从wix的test.txt文件中读取此字符串"FileName",并想以某种方式将此字符串分配给目录名称.

I want to read this string "FileName" from the file test.txt in wix and somehow I want to assign this string to a directory name.

我希望从文件中读取以下内容.

I want the below mentioned to happen, reading from a file.

<目录ID =测试"名称=文件名>

< Directory Id="testing" Name=FileName >

任何建议都会有所帮助.

Any suggestions would be helpful.

在此先感谢您, Pradeep Kumar.

Thanks in Advance, Pradeep Kumar.

推荐答案

您需要执行一个自定义操作,该操作读取文本文件内容并将其放入属性中.然后,您可以尝试在目录名称中引用该属性,不知道WiX是否支持此属性,但是其他安装程序创作工具也可以这样做,而WiX也会这样做.

You need to have a custom action that reads the text file content and places it into a property. Then you can try to reference that property in the directory name, don't know if WiX supports this, but other setup authoring tools do so chances are WiX does too.

非常重要.您必须将自定义操作安排为在

VERY IMPORTANT. You must schedule the custom action to be executed as immediate and before the file costing standard actions.

这篇关于如何从文件Wix读取字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆