Need to add current user info to XML file
I have an XML file that contains config data that needs to be added to users Application Data folder after a package install. However the xml file that was created has path info (current user) captured from the machine that it was created on and I need the current user path for each user that logs in after I use Active Setup. So in a nutshell the xml file needs the current user logged in's path where it says <current user> below.
Thanks in advance...
Here is the file...
<?xml version="1.0" encoding="utf-8"?>
<SymphonyAddin>
<SymConfigServer>
<ServerName>test.com</ServerName>
<ServerPort>282837</ServerPort>
<Protocol>HTTPS</Protocol>
<NumRetries>1</NumRetries>
<Timeout>3</Timeout>
<SleepTime>3</SleepTime>
</SymConfigServer>
<SymphonyServer>
<ServerName>
</ServerName>
<ServerPort>18288</ServerPort>
<Protocol>https</Protocol>
<TriggerMailAddress>
</TriggerMailAddress>
<TriggerMailInverval>60</TriggerMailInverval>
<ServerVersion>2</ServerVersion>
<CrawlArchiveStatus>120</CrawlArchiveStatus>
<MetaThreadInverval>15</MetaThreadInverval>
<MetaThreadSynInverval>60</MetaThreadSynInverval>
</SymphonyServer>
<OfflineSet>
<Configured>-1</Configured>
<OfflineFilePath>C:\Documents and Settings\<current user></OfflineFilePath>
<RepositoryMaxSize>400</RepositoryMaxSize>
<UpdateInterval>10</UpdateInterval>
<MsgSizeLimit>20</MsgSizeLimit>
<AgeLimit>21</AgeLimit>
<MaxThreads>5</MaxThreads>
<MaxMessages>100</MaxMessages>
<DeleteRule>Age</DeleteRule>
</OfflineSet>
<MessageControl>
<WelcomePage>True</WelcomePage>
<StatusReport>True</StatusReport>
<RestoreWarning>True</RestoreWarning>
</MessageControl>
<Trace>
<TraceFile>C:\Documents and Settings\<current user>\Local Settings\Application Data\IBM\ContentCollector_OutlookExtension\afuOEaddin.trc</TraceFile>
<DebugMapi>False</DebugMapi>
<TraceLevel>TRC</TraceLevel>
<MaxLength>1000</MaxLength>
<MaxNumber>6</MaxNumber>
</Trace>
</SymphonyAddin>
Thanks in advance...
Here is the file...
<?xml version="1.0" encoding="utf-8"?>
<SymphonyAddin>
<SymConfigServer>
<ServerName>test.com</ServerName>
<ServerPort>282837</ServerPort>
<Protocol>HTTPS</Protocol>
<NumRetries>1</NumRetries>
<Timeout>3</Timeout>
<SleepTime>3</SleepTime>
</SymConfigServer>
<SymphonyServer>
<ServerName>
</ServerName>
<ServerPort>18288</ServerPort>
<Protocol>https</Protocol>
<TriggerMailAddress>
</TriggerMailAddress>
<TriggerMailInverval>60</TriggerMailInverval>
<ServerVersion>2</ServerVersion>
<CrawlArchiveStatus>120</CrawlArchiveStatus>
<MetaThreadInverval>15</MetaThreadInverval>
<MetaThreadSynInverval>60</MetaThreadSynInverval>
</SymphonyServer>
<OfflineSet>
<Configured>-1</Configured>
<OfflineFilePath>C:\Documents and Settings\<current user></OfflineFilePath>
<RepositoryMaxSize>400</RepositoryMaxSize>
<UpdateInterval>10</UpdateInterval>
<MsgSizeLimit>20</MsgSizeLimit>
<AgeLimit>21</AgeLimit>
<MaxThreads>5</MaxThreads>
<MaxMessages>100</MaxMessages>
<DeleteRule>Age</DeleteRule>
</OfflineSet>
<MessageControl>
<WelcomePage>True</WelcomePage>
<StatusReport>True</StatusReport>
<RestoreWarning>True</RestoreWarning>
</MessageControl>
<Trace>
<TraceFile>C:\Documents and Settings\<current user>\Local Settings\Application Data\IBM\ContentCollector_OutlookExtension\afuOEaddin.trc</TraceFile>
<DebugMapi>False</DebugMapi>
<TraceLevel>TRC</TraceLevel>
<MaxLength>1000</MaxLength>
<MaxNumber>6</MaxNumber>
</Trace>
</SymphonyAddin>
0 Comments
[ + ] Show comments
Answers (12)
Please log in to answer
Posted by:
SuccessSystems
14 years ago
Posted by:
anonymous_9363
14 years ago
Search and replace in an XML file...[shudder]
Use the MSXML object to write the element properly. There's a VBS class knocking about (it may even have been authored by the venerable John McFadyen) which makes using that object much simpler, in that it uses English to describe its functions: the MS naming is somewhat...eccentric, in my view. If you can't find that, I'm pretty sure that the Chilkat (sp?) ActiveX control is now free.
Use the MSXML object to write the element properly. There's a VBS class knocking about (it may even have been authored by the venerable John McFadyen) which makes using that object much simpler, in that it uses English to describe its functions: the MS naming is somewhat...eccentric, in my view. If you can't find that, I'm pretty sure that the Chilkat (sp?) ActiveX control is now free.
Posted by:
dmack
14 years ago
Thanks for the responses.
So I need to keep this as simple as possible and the client will not go with ActiveX controls installed. Very high security and GPO here. Also I couldnt find anything with MSXML...
I would prefer to do this in my VBScript wrapper or some form of Active Setup to change the element to the current user. Any other ideas?
So I need to keep this as simple as possible and the client will not go with ActiveX controls installed. Very high security and GPO here. Also I couldnt find anything with MSXML...
I would prefer to do this in my VBScript wrapper or some form of Active Setup to change the element to the current user. Any other ideas?
Posted by:
anonymous_9363
14 years ago
Also I couldnt find anything with MSXML...Really? http://www.lmgtfy.com/?q=mcfadyen+xml+class
Try the first non-sponsored hit.
Posted by:
dmack
14 years ago
Posted by:
anonymous_9363
14 years ago
Posted by:
dmack
14 years ago
Posted by:
nheim
14 years ago
Hi dmack,
another approach would be a command line search and replace tool.
We use te.exe for this. http://www.windowsitpro.com/article/tips/jsi-tip-6460-freeware-command-line-text-editor-.aspx
Then you prepare your XML (or any text file) with unique strings, which you are going to replace with custom action calls to te.exe after the files are copied.
Regards, Nick
another approach would be a command line search and replace tool.
We use te.exe for this. http://www.windowsitpro.com/article/tips/jsi-tip-6460-freeware-command-line-text-editor-.aspx
Then you prepare your XML (or any text file) with unique strings, which you are going to replace with custom action calls to te.exe after the files are copied.
Regards, Nick
Posted by:
anonymous_9363
14 years ago
Posted by:
dmack
14 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.