xml file updation through patch installer on existing xml - Advanced Installer Community
sonu
Posts: 148
Joined: Tue Oct 30, 2012 10:04 am

xml file updation through patch installer on existing xml

Hi Support ,

I working on Updation of xml file which is already existing on target machine through patch.

can you send a sample to implement this behavior is it possible ...I gone through the help document ...its not geting replicated...

am attaching the xml file to implement ....

With regards,

pradeep
Attachments
VSoft.Email.Dispatcher.CentralSite.exe.zip
<add key="SMTP_IP" value="10.0.254.17" /> change the value with user input text
(883 Bytes) Downloaded 824 times
sonu
Posts: 148
Joined: Tue Oct 30, 2012 10:04 am

Re: xml file updation through patch installer on existing xm

Hi TEAM,

Can you please provide a quick update plzz....


With Regards,
Pradeep
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: xml file updation through patch installer on existing xm

Hello Pradeep,

Indeed, this can be done through a patch.

I've attached a sample which implement this scenario. In the zip archive you can find V1 of my installation package which will create a config file with the following content:

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration>
  <appSettings>
    <add key="LogLevel" value="100"/>
  </appSettings>
</configuration>
On the upgraded version, I changed the .config file so the value attribute can be entered by the user at run-time when the patch is applied. Also, I've added a Set Installer Property action on the Next > button from the PatchWelcomeDlg.
The value entered by the user in the edit box will be set to the LOG_LEVEL property through this custom action which has the PATCH statement in the Condition field.
Please take a look on the How do I create a patch that runs a custom action? article with related information for hints and guidance.

If you have other questions, please let us know.

Best regards,
Dan
Attachments
PatchInstallation.zip
(1.81 MiB) Downloaded 470 times
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sonu
Posts: 148
Joined: Tue Oct 30, 2012 10:04 am

Re: xml file updation through patch installer on existing xm

Hi Dan,

I am happy for your solution to update a user entered "details" updating in xml with Set install property value.


But the thing is when ur updating a key values under Same list of elements i need to choose a particular key value with one single element among multiple elements.


Am giving the xml file for refernce please provide way to the update required keys under single element from bunch of Common elements..


Xml format :

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="LogLevel" value="4" />
<add key="TIMER_INTERVAL" value="10000" />
<add key="SMTP_IP" value="10.0.254.17" />
<add key="USER_ID" value="tspandana" />
<add key="PASSWORD" value="Vo/bbw7TdCwhyM6arc4iUA==" />
<add key="DOMAIN" value="VsoftCorp" />
<!-- Branch EMAIL Parameters -->
<add key="SEND_BRANCH_EMAILS" value="1" />
<add key="SEND_EMAIL_BEFORE_PROCESSING_ECL" value="1" />
<add key="SEND_EMAIL_AFTER_PROCESSING_ECL" value="0" />
<add key="SEND_EMAIL_AFTER_BALANCING_ECL" value="1" />
<add key="SEND_BRANCH_EOD_NOT_RECEIVED_NOTIFICATION" value="1" />
<add key="SEND_BRANCH_EOD_EMAILS" value="1" />
<add key="USE_EOD_MAIL_ID" value="1" />
<!-- TELLER EMAIL Parameters -->
<add key="SEND_TELLER_EMAILS" value="1" />
<add key="SEND_ATTACHEMENT" value="1" />
<add key="TEMP_PATH" value="c:\temp" />
<add key="PRIORITY_TAG_STRING" value="[Secure]" />
<add key="SENDER_EMAIL_ID" value="SENDER MAILID" />
<add key="CC_EMAIL_ID" value="CCMAILID" />
<add key="EMAIL_SERVER" value="0" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
</appSettings>
</configuration>


under common elements am looking for a updation in <add key="USER_ID" value="tspandana" /> this particular value.

I have tried in many ways..
here am getting a problem with common <add> element and key = "" value = "" (values)?

Please provide quick update on this we are waiting for ur response.

With Regards,
Pradeep.
sonu
Posts: 148
Joined: Tue Oct 30, 2012 10:04 am

Re: xml file updation through patch installer on existing xm

Hi Support,

Updates Please.

Regards
Pradeep
sonu
Posts: 148
Joined: Tue Oct 30, 2012 10:04 am

Re: xml file updation through patch installer on existing xm

Hi Support,

Do we have any luck on this issue...

With Regards,
pradeep.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: xml file updation through patch installer on existing xm

Hello,

You can try to use a text file update operation which will search for the related row within your XML file and will replace it with desired value.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sonu
Posts: 148
Joined: Tue Oct 30, 2012 10:04 am

Re: xml file updation through patch installer on existing xm

hi ,

Its an .config file...how can i use it. Please help me out on this i have attached on starting post.

With Regards,
Pradeep.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: xml file updation through patch installer on existing xm

Hello Pradeep,

In order to achieve what you want you should simply add your XML file as a regular file in your installation project (Files and Folder page). Then, you can use a text file update -> replace operation in the upgraded version of your project, which will upgrade the related row from your XML file.

I've attached a sample, created with version 10.9.1 of Advanced Installer, which implements this behavior.
sample.zip
(7.55 KiB) Downloaded 667 times
All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sonu
Posts: 148
Joined: Tue Oct 30, 2012 10:04 am

Re: xml file updation through patch installer on existing xm

Hi Team,

I have tried that way.. but facing some issues when updating the new field into the .config file.

I have replaced another value, Its not suppose to modify getting some issues please go through the attached screenshot.

With Regards,
pradeep.
Attachments
Config File Updation.png
Config File Updation.png (67.05 KiB) Viewed 8709 times
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: xml file updation through patch installer on existing xm

Hello Pradeep,

In order to achieve this you should add the second search and replace row as a separate replace operation to your config file. Here are the steps to proceed:
- go to "Files and Folders" page, select "VSoft.Email.Dispatcher.CentralSite.exe.config" file and from its context menu choose "Properties..." option
- in the "Edit Text File Update dialog -> Updates left pane" using the "New Search and Replace Operation" context menu option add another replace operation like this:
  • Find: <add key="TEMP_PATH" value="c:\temp" />
    Replace: <add key="TEMP_PATH" value="[DATA_USER]" />
If you have any questions just let us know.

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

Return to “Common Problems”