/build/static/layout/Breadcrumb_cap_w.png

Appending text to files

Hi there

Sorry if this has been asked before, I have done a search but couldn't find it.

We have an application (Endnote 6) which needs a line entering into the hosts file.
We also have other applications or websites which need an entry in the hosts file.

Is there a way to get the MSI to append a line to a file rathr then overwriting it all the time?

Also is there a way to get an MSI to append to a registry entry rather than overwriting it (Endnote also needs a proxy exception).

Many thanks for any help.

Matt

0 Comments   [ + ] Show comments

Answers (8)

Posted by: olivier 16 years ago
Orange Senior Belt
0
hi
I would try the following:
-write a script that appends the data
or
-use ini file table and append the data you need

gruss

Olivier
Posted by: mjccheshire 16 years ago
Senior Yellow Belt
0
Thanks for that Oliver.

Lets just pretend for a second then that I am a complete newbie at this [:-], how would I go about doing the easiest one of these?

Matt
Posted by: MSIMaker 16 years ago
2nd Degree Black Belt
0
Well depending on what scripting tool you use....if you use Wisescript for instance then you can use the command to "Insert Text to file"

You can select a line number or append at the end.
Posted by: olivier 16 years ago
Orange Senior Belt
0
hmmm, difficult to explain :-)
you can do a customaction running the script

example for a script:
set fs = CreateObject("Scripting.FileSystemObject")
set file = fs.opentextfile("myhost.txt")
file.writeline "myhost1...."
file.close


etc. etc.
Posted by: bkelly 16 years ago
Red Belt
0
The most simple method would be right from a command line:

echo New Line On Bottom >>myfile.txt

the double "greater than" symbol appends, whereas a single "greater than" symbol will overwrite the target file.
Posted by: mjccheshire 16 years ago
Senior Yellow Belt
0
Thanks for all the help guys. I have decided to go for WiseScripting as it seemed to provide the easiest solution.

Cheers

Matt
Posted by: MSIPackager 16 years ago
3rd Degree Black Belt
0
Just a thought, but if you have your own DNS servers, why not just add the relevant host record there - instead of editing the local hosts file?

That way you can manage the record centrally and it will save you the bother of editing the hosts file as part of your install routine..

Cheers,
Rob.
Posted by: mjccheshire 16 years ago
Senior Yellow Belt
0
Would love to mate but I don't control the servers.

Plus there are only a limited number of people who need access to this so we are trying to limit it.

Cheers for the suggestion though.

Matt
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ