File editing question...is this possible?

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

File editing question...is this possible?

Postby cptlo306 » Tue Aug 29, 2006 6:07 pm

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:

Postby MichaelNesmith » Tue Aug 29, 2006 6:37 pm

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
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 43 guests