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!

shetty_rohan
Posts: 363
Joined: Fri Dec 07, 2012 5:28 am
Location: Bangalore, India
Contact: Website

Support of / in directories

Hi,

My requirement, is just to append following one line to Log4C configuration(say log4c.config)
log4j.appender.LogFileAppender.File=[appdir]
appdir should have / instead of \

Can you please help me with this?

Background:
I have a c++ executable which make use of Log4C configuration file. In the Log4C configuration file I need to append one line
log4j.appender.LogFileAppender.File=[appdir]

I did this using "Edit Test File update"
This would append a line as c:\Logs\TelesTSP.log. this would not work with Log4C because it expects it as c:/Logs/TelesTSP.log (i.e / instead of \)

As a workaround, I tried "Edit Test File update" Find and replace feature. According to my understanding, this would change the whole file(and not just log4j.appender.LogFileAppender.File)
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Support of / in directories

Hi Rohan,

Indeed, the "Text File Update" feature makes changes in the whole file, not just in a single line.

So, in order to achieve what you want, you can create a simple custom action that takes the [APPDIR] property, copy it to another property and replace the "\" character with the "/" one. Then write the modified property to the "Log4C" file instead of the [APPDIR] property.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
shetty_rohan
Posts: 363
Joined: Fri Dec 07, 2012 5:28 am
Location: Bangalore, India
Contact: Website

Re: Support of / in directories

Thanks Eusebiu.

I know how to add new property. Can you please help me in character replacement, Does the AdvancedInstaller offer some function to do this(should I use the call function or execute inline script)?

Regards,
rohan
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Support of / in directories

Hi Rohan,

Unfortunately Advanced Installer does not offer any predefined function to do this, but you can use the "Execute Inline Script" custom action to achieve what you want. Below is written a simple example:

Code: Select all

appdir = Session.Property("APPDIR")
newappdir = Replace(appdir, "\", "/")
Session.Property("NEW_APPDIR") = newappdir
I hope it helps.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
shetty_rohan
Posts: 363
Joined: Fri Dec 07, 2012 5:28 am
Location: Bangalore, India
Contact: Website

Re: Support of / in directories

Thank you
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Support of / in directories

You're welcome.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”