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
[ - ] Hide Comments

so that the conversation will remain readable.
Answer this question
or Comment on this question for clarity
Answers
Create a vbscript for your active setup to get the users folder (USERPROFILE Env Var) and then use search and replace to put in the correct path.
Please log in to comment
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.
Please log in to comment
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?
Please log in to comment
Also I couldnt find anything with MSXML...Really? http://www.lmgtfy.com/?q=mcfadyen+xml+class
Try the first non-sponsored hit.
Please log in to comment
Sorry, don't buy that. If the client has even the vaguest sprinkling of MS apps, the parser has to be installed. If it's installed, there can't be any sane argument against using it to do the job in hand. But anyway, I'll give up badgering you.
Please log in to comment
Not badgering me at all....I am trying to provide a package for a client that uses a simple solution with vbscript as all the packages here are created that way. To be honest I have no experience working with MSXML and XML DOM so this take time to get this solution in place...thanks anyway
Please log in to comment
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
Please log in to comment
Comments