<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>SyMenu - Configure portable programs - Convert  Winpanpack Menu to SyMenu - Messages</title>
<link>https://www.ugmfree.it/forum/messages.aspx?TopicID=726</link>
<description>SyMenu - Configure portable programs - Convert  Winpanpack Menu to SyMenu - Messages</description>
<language>en-us</language>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<pubDate>Thu, 30 May 2019 10:07:07 GMT</pubDate>
<lastBuildDate>Thu, 30 May 2019 10:07:07 GMT</lastBuildDate>
<item>
<link>https://www.ugmfree.it/forum/messages.aspx?TopicID=726</link>
<title>Message from Gianluca</title>
<description><![CDATA[Thanks cemax.<br/>Now let's see if some winPenPack user need to convert their old menu to SyMenu.]]></description>
<pubDate>Thu, 30 May 2019 10:07:07 GMT</pubDate>
</item>
<item>
<link>https://www.ugmfree.it/forum/messages.aspx?TopicID=726</link>
<title>Message from cemax</title>
<description><![CDATA[Hi everyone,<br/>I have been using winpenpack for years and I had created a menu with hundreds of programs that I was sorry to miss.<br/>For this purpose I wrote a small script to convert the XML menu structure from Winpanpack Menu to SyMenu.<br/><br/>The original idea would have been to make a "serious" tool that works using XML methods; for reasons of time, however, I abandoned it in favor of a quick &amp; dirty solution that brutally acts as a parser, without too many checks and refinements.<br/>But it seems to work <img src="images/smilies/smile.gif" border=0 alt="smile" /><br/><br/>here is the commented script:<br/><br/><i><span style="color:#009900"><br/></span></i><br/><br/><i><span style="color:#009900">'************************************************* **********************************</span></i><br/><i><span style="color:#009900">'* Run  CSCRIPT menuconv.vbs</span></i><br/><i><span style="color:#009900">'*</span></i><br/><i><span style="color:#009900">'* Reads winpenpack.xml</span></i><br/><i><span style="color:#009900">'* Writes SyMenuItem.xml</span></i><br/><i><span style="color:#009900">'*</span></i><br/><i><span style="color:#009900">'* At the end from SyMenuItem.xml you have to create SyMenuItem.zip</span></i><br/><i><span style="color:#009900">'* and put it in SyMenu Config</span></i><br/><i><span style="color:#009900">'*</span></i><br/><i><span style="color:#009900">'* In SyMenu Icons there must be an icon called Default.ico</span></i><br/><i><span style="color:#009900">'*</span></i><br/><i><span style="color:#009900">'* NOTE 1: if in the xml input there are &lt;description&gt; multi-line fields</span></i><br/><i><span style="color:#009900">'* must be made single line by removing cr-lf</span></i><br/><i><span style="color:#009900">'* NOTE 2: In line 78, if necessary, adapt the translation of the relative path</span></i><br/><i><span style="color:#009900">'* from $ drive xxx to what you need ( it depends on the structure)</span></i><br/><i><span style="color:#009900">'************************************************* **********************************</span></i><br/><i><span style="color:#009900"><br/></span></i><br/><i><span style="color:#009900">Const ForReading = 1, ForWriting = 2, ForAppending = 8</span></i><br/><i><span style="color:#009900">Dim fso, fin, fout, rigain, rigaout, rigaout1, count, wsh, CCalls, CSec, objArgs, maxrec</span></i><br/><i><span style="color:#009900">Dim filein, fileout</span></i><br/><i><span style="color:#009900">Set fso = CreateObject("Scripting.FileSystemObject")</span></i><br/><i><span style="color:#009900">Set wsh = WScript.CreateObject("WScript.Shell")</span></i><br/><i><span style="color:#009900">Set objArgs = WScript.Arguments</span></i><br/><i><span style="color:#009900"><br/></span></i><br/><i><span style="color:#009900">fso.CreateTextFile "SyMenuItem.xml"</span></i><br/><i><span style="color:#009900">Set fin  = fso.OpenTextFile("winpenpack.xml", ForReading, False)</span></i><br/><i><span style="color:#009900">Set fout = fso.OpenTextFile("SyMenuItem.xml", ForWriting, False)</span></i><br/><i><span style="color:#009900">CountCont = 0</span></i><br/><i><span style="color:#009900">CountItem = 0</span></i><br/><i><span style="color:#009900"><br/></span></i><br/><i><span style="color:#009900">'* HEADER</span></i><br/><i><span style="color:#009900">fout.WriteLine "&lt;?xml version=""1.0"" encoding=""UTF-16""?&gt;"</span></i><br/><i><span style="color:#009900">fout.WriteLine "&lt;SyRoot&gt;"</span></i><br/><i><span style="color:#009900"><br/></span></i><br/><i><span style="color:#009900">Do While (fin.AtEndOfStream &lt;&gt; True and rigain &lt;&gt; "&lt;Separator/&gt;")</span></i><br/><i><span style="color:#009900">	rigain = trim(fin.ReadLine)</span></i><br/><i><span style="color:#009900">	'* find   "files name=" </span></i><br/><i><span style="color:#009900">	'*write SYCONTAINER</span></i><br/><i><span style="color:#009900">	i1 = instr(rigain, "files name=")</span></i><br/><i><span style="color:#009900">	If i1 &gt; 0 then</span></i><br/><i><span style="color:#009900">		if CountCont &gt; 0 then                 '* if not first</span></i><br/><i><span style="color:#009900">			WScript.Echo "&lt;/SyContainer&gt;"</span></i><br/><i><span style="color:#009900">			fout.WriteLine "&lt;/SyContainer&gt;"</span></i><br/><i><span style="color:#009900">			WScript.Echo " "</span></i><br/><i><span style="color:#009900">		end if </span></i><br/><i><span style="color:#009900">		rigaout = mid(rigain, 14, len(rigain)-15)</span></i><br/><i><span style="color:#009900">		rigaout1 = "&lt;SyContainer name=""" &amp; rigaout &amp; """ defaultIcon=""10"" description=""""&gt;"</span></i><br/><i><span style="color:#009900">		WScript.Echo rigaout1</span></i><br/><i><span style="color:#009900">		fout.WriteLine rigaout1</span></i><br/><i><span style="color:#009900">		CountCont = CountCont + 1</span></i><br/><i><span style="color:#009900">	end if </span></i><br/><i><span style="color:#009900"><br/></span></i><br/><i><span style="color:#009900">	'* finds   file name= and takes all attributes</span></i><br/><i><span style="color:#009900">	'* writes SyProgramCmd&gt;</span></i><br/><i><span style="color:#009900">	i1 = instr(rigain, "file name=")</span></i><br/><i><span style="color:#009900">	If i1 &gt; 0 then</span></i><br/><i><span style="color:#009900">		'* Name</span></i><br/><i><span style="color:#009900">		rigaout = mid(rigain, 13, len(rigain)-14)</span></i><br/><i><span style="color:#009900">		WScript.Echo "&lt;SyProgramCmd&gt;"</span></i><br/><i><span style="color:#009900">		fout.WriteLine "&lt;SyProgramCmd&gt;"</span></i><br/><i><span style="color:#009900">		rigaout1 = "&lt;name&gt;" &amp; rigaout &amp; "&lt;/name&gt;"</span></i><br/><i><span style="color:#009900">		WScript.Echo rigaout1</span></i><br/><i><span style="color:#009900">		fout.WriteLine rigaout1</span></i><br/><i><span style="color:#009900">		'* writes a line Default.ico </span></i><br/><i><span style="color:#009900">		fout.WriteLine "&lt;icon&gt;.\Icons\Default.ico&lt;/icon&gt;"</span></i><br/><i><span style="color:#009900">		rigain = trim(fin.ReadLine)</span></i><br/><i><span style="color:#009900">		rigain = trim(fin.ReadLine)</span></i><br/><i><span style="color:#009900">		'* Description </span></i><br/><i><span style="color:#009900">		if left(rigain, 4) = "&lt;des" then</span></i><br/><i><span style="color:#009900">			rigaout = mid(rigain, 14, len(rigain)-27)</span></i><br/><i><span style="color:#009900">			rigaout1 = "&lt;description&gt;" &amp; rigaout &amp; "&lt;/description&gt;"</span></i><br/><i><span style="color:#009900">			WScript.Echo rigaout1</span></i><br/><i><span style="color:#009900">			fout.WriteLine rigaout1</span></i><br/><i><span style="color:#009900">			rigain = trim(fin.ReadLine)</span></i><br/><i><span style="color:#009900">		end if</span></i><br/><i><span style="color:#009900">		'* Path</span></i><br/><i><span style="color:#009900">		rigaout = mid(rigain, 7, len(rigain)-13)</span></i><br/><i><span style="color:#009900">		'* Substitutes relative path  $Drive\ with ..\ (ok if  symenu and other sw on same folder level)</span></i><br/><i><span style="color:#009900">		rigaout = replace (rigaout, "$Drive\Uti", "..")</span></i><br/><i><span style="color:#009900">		rigaout1 = "&lt;path&gt;" &amp; rigaout &amp; "&lt;/path&gt;"</span></i><br/><i><span style="color:#009900">		WScript.Echo rigaout1</span></i><br/><i><span style="color:#009900">		fout.WriteLine rigaout1</span></i><br/><i><span style="color:#009900">		WScript.Echo "&lt;/SyProgramCmd&gt;"</span></i><br/><i><span style="color:#009900">		fout.WriteLine "&lt;/SyProgramCmd&gt;"</span></i><br/><i><span style="color:#009900">		CountItem = CountItem + 1</span></i><br/><i><span style="color:#009900">	end if </span></i><br/><i><span style="color:#009900">	</span></i><br/><i><span style="color:#009900">loop</span></i><br/><i><span style="color:#009900"><br/></span></i><br/><i><span style="color:#009900">'* tail</span></i><br/><i><span style="color:#009900">WScript.Echo "&lt;/SyContainer&gt;"</span></i><br/><i><span style="color:#009900">WScript.Echo "&lt;/SyRoot&gt;"</span></i><br/><i><span style="color:#009900">fout.WriteLine "&lt;/SyContainer&gt;"</span></i><br/><i><span style="color:#009900">fout.WriteLine "&lt;/SyRoot&gt;"</span></i><br/><i><span style="color:#009900"><br/></span></i><br/><i><span style="color:#009900">WScript.Echo " * * * * * * * * * * * * * * * * * * "</span></i><br/><i><span style="color:#009900"><br/></span></i><br/><i><span style="color:#009900">WScript.Echo CountCont &amp; " Written categories"</span></i><br/><i><span style="color:#009900">WScript.Echo CountItem &amp; " Written Items"</span></i><br/><i><span style="color:#009900">fin.Close</span></i><br/><i><span style="color:#009900">fout.Close</span></i>]]></description>
<pubDate>Thu, 30 May 2019 09:51:03 GMT</pubDate>
</item>
</channel>
</rss>
