/build/static/layout/Breadcrumb_cap_w.png

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>

0 Comments   [ + ] Show comments

Answers (12)

Posted by: SuccessSystems 13 years ago
Senior Yellow Belt
0
What packaging tool are you using?
Posted by: dmack 13 years ago
Senior Yellow Belt
0
I'm using vendor supplied silent switches inside a vbscript wrapper.
Posted by: SuccessSystems 13 years ago
Senior Yellow Belt
0
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.
Posted by: anonymous_9363 13 years ago
Red Belt
0
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.
Posted by: dmack 13 years ago
Senior Yellow Belt
0
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?
Posted by: anonymous_9363 13 years ago
Red Belt
0
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 13 years ago
Senior Yellow Belt
0
Thanks but I can't use MSXML parser in this environment...

What I think I need is to come up with something like a Active Setup vbscript to create the file with the new userprofile path then copy it to the user app folder.
Posted by: anonymous_9363 13 years ago
Red Belt
0
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.
Posted by: dmack 13 years ago
Senior Yellow Belt
0
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
Posted by: nheim 13 years ago
10th Degree Black Belt
0
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
Posted by: anonymous_9363 13 years ago
Red Belt
0
Please use the CODE tag when posting code or other lengthy text.

Thanks! :)
Posted by: dmack 13 years ago
Senior Yellow Belt
0
Thanks nheim...

I decided to use active setup and a vbscript to find and replace the xml template username strings and then replace it with the WshNetwork.UserName. Works well.

Cheers...
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ