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!

chandrabhushan
Posts: 76
Joined: Thu Jul 02, 2015 10:58 am

using find and replace in "text file update" utility

hi,
I am trying to update following texts with properties using "text file update" utility provided in AI in a single file .
SERVERNAME -->[SERVERNAME]
PORT --> [PORT]
DBNAME --> [DBNAME]
USRNAME-->[USRNAME]
PASSWD-->[PASSWD]

I tried to give all the search strings separated in" ," and replace strings in "," but its not working . Please advice .
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: using find and replace in "text file update" utility

Hello,

Can you please send us the .AIP (project file) and a verbose log of the installation to support at advancedinstaller dot com so we can have a better view of your installation project settings?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
chandrabhushan
Posts: 76
Joined: Thu Jul 02, 2015 10:58 am

Re: using find and replace in "text file update" utility

Hi Den,
Before asking for .aip can you please tell me what is the correct way to do it .
chandrabhushan
Posts: 76
Joined: Thu Jul 02, 2015 10:58 am

Re: using find and replace in "text file update" utility

Hi,
I want to use find and replace utility for a file , i am searching the strings and replacing with the properties from SQL dialogue. Please let me know what i am missing . any specific operator i need to give in find or what ?
Screenshot attached .
Attachments
update.PNG
update.PNG (14.72 KiB) Viewed 9695 times
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: using find and replace in "text file update" utility

Hello,

I'm sorry, but I'm afraid I cannot fully understand what you are trying to achieve. Can you please give us a more practical example of what you are trying to achieve? Please give us a 3 steps example like this:
1. the original file content
2. the file content which you want to search for
3. the updated file content after the file is updated with the new values

so we can have a clear view of what you are trying to search for and how you want your file to look like after update?

Thank you for your understanding.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
chandrabhushan
Posts: 76
Joined: Thu Jul 02, 2015 10:58 am

Re: using find and replace in "text file update" utility

Hi Denial,
I have one standalone.xml file in my installation .
In this file i have to get data from user (from SQL Dialogue ) and then find different text/Pattern and replace it with the values i got from the textboxes
i.e
SERVERNAME -->[SERVERNAME]
PORT --> [PORT]
DBNAME --> [DBNAME]
USRNAME-->[USRNAME]
PASSWD-->[PASSWD]

Here SERVERNAME,PORT,USRNAME are there in my xml file as it is . i have to replace it with my values . I am trying it through text file update but unable to achive it . Please see the screenshots in the thread .
Please help me ASAP .
chandrabhushan
Posts: 76
Joined: Thu Jul 02, 2015 10:58 am

Re: using find and replace in "text file update" utility

please see the input file and output file
with the data captured through SQL Dialogue
SERVERNAME -->[SERVERNAME]
PORT --> [PORT]
DBNAME --> [DBNAME]
USRNAME-->[USRNAME]
PASSWD-->[PASSWD]

See the screenshots.
Attachments
Capture2.PNG
Capture2.PNG (38.74 KiB) Viewed 9683 times
Capture1.PNG
Capture1.PNG (37.02 KiB) Viewed 9683 times
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: using find and replace in "text file update" utility

Hello,

Please note that to achieve what you want you should use regular expressions. You should add multiple search and replace operations like this:
  • Find: <connection-url>jdbc:sqlserver//*.*</connection-url>
    Use regular expressions: checked
    Replace: <connection-url>jdbc:sqlserver//[SERVERNAME]:[PORT];databasename:[DBNAME]</connection-url>

    Find: <user-name>*.*</user-name>
    Use regular expressions: checked
    Replace: <user-name>[USRNAME]</user-name>

    etc.
screenshot1.jpg
screenshot1.jpg (67.26 KiB) Viewed 9670 times
If you have any further questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
chandrabhushan
Posts: 76
Joined: Thu Jul 02, 2015 10:58 am

Re: using find and replace in "text file update" utility

Hi Denial,
Thanks for the help.It is now working As expected .
**Please can you update the manual so that we can use these features easily .
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: using find and replace in "text file update" utility

You're welcome. I'm glad you got this working.

Maybe we'll add more info about the usage of regexs with our text file update feature in a future version of Advanced Installer. Thank you for your suggestion.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
chandrabhushan
Posts: 76
Joined: Thu Jul 02, 2015 10:58 am

Re: using find and replace in "text file update" utility

Thanks ,
One quick question,
Is this search and replace works is sequence for example " first Replace --> then Replace_1 then --> Replace 2 ---> in the same test.xml file .
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: using find and replace in "text file update" utility

Hello,

Yes, the find and replace operations are applied subsequently, one after the other.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”