问题
There is a file test.txt which is having a text "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.
< Directory Id="testing" Name=FileName >
Any suggestions would be helpful.
Thanks in Advance, Pradeep Kumar.
回答1:
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.
来源:https://stackoverflow.com/questions/19241971/how-to-read-a-string-from-a-file-wix