File editing question...is this possible?

Got a problem you cannot solve? Try here.
Post Reply
cptlo306
Posts: 4
Joined: Wed Jul 26, 2006 10:02 am

File editing question...is this possible?

Post by cptlo306 »

I need to edit an existing xml file during the installation process. I'm aware of the EditFile plugin but I don't think it'll work for this.

The file I need to modify is part of the Microsoft SQL Reporting Services installation (rssrvpolicy.config - copy is attached also).

I need to add about 9 lines of text in a certain place in the file like this:

PublicKeyBlob="00240...shortened for this post"
/>
</CodeGroup>

****NEW LINES WOULD GO HERE*****

</CodeGroup>
</CodeGroup>
</PolicyLevel>
</policy>
</security>
</mscorlib>
</configuration>

(not sure the above will line up right...the attached file shows it better).

Does this make sense? Is this possible without writing a custom vbscript or similar?

Thanks.

File Attached:

rssrvpolicy.config

File Attached:

rssrvpolicy.config.txt
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

You could use looping constructs and Read from Text File, Write to Text File commands, along with If for determining when you're at the end of the file and at the insertion point, to get this done.

Basically, read from the original file, write into a copy, add the extra text into the copy, and continue reading from original file until it ends; then replace the original with the copy.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Post Reply