We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

neuralbd
Posts: 14
Joined: Tue Dec 22, 2009 11:17 pm

Inserting "lines" in files

Hello,

Could anyone tell me how i can Insert specific "code/lines or text" into files on install?

Thanks,
Lars
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Inserting "lines" in files

Hi Lars and welcome to Advanced Installer Forums,

Unfortunately this feature is not directly supported by Windows Installer. However you can create a custom action in the programming language of your choice to achieve this.

Also note Windows Installer does support inserting elements into XML and INI files.

Also, it is recommended that you read our tutorials to get you started in efficiently deploying your product using Advanced Installer.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
neuralbd
Posts: 14
Joined: Tue Dec 22, 2009 11:17 pm

Re: Inserting "lines" in files

Gabriel,

Thank you for the fast response.

Do you happen to know any public scripts which would allow us the ability to edit text files during install?

We did create a search which confirms the text files exist on Install but lack the understanding of how to OPEN, INSERT, SAVE etc..

Kind Regards,
Lars
sd_thars
Posts: 2
Joined: Tue Dec 15, 2009 11:55 pm

Re: Inserting "lines" in files

Lars,

Attached is a vb script file that I use to update a log configuration file during my install. I basically open the file and copy it line by line to a temporary file. during the copy I look for a specific string and when I find it, I throw out that line and insert the newly formatted line. Once I have parsed through the file I copy the temporary file back over the original file and then delete the temporary file. I use the customactiondata property to pass in the path where the files is located and the text I want to update.

Tony
Attachments
LogPathUpdater.vbs.txt
(2.5 KiB) Downloaded 417 times
neuralbd
Posts: 14
Joined: Tue Dec 22, 2009 11:17 pm

Re: Inserting "lines" in files

Tony,

Thank you for the Christmas Present. This will allow me to go home abit earlier than planned tomorrow

Appreciate the help!

Return to “Common Problems”