[wpkg-users] deciphering a package description.

sbotsford sbotsford at sjsa.ab.ca
Tue Apr 11 19:40:33 CEST 2006


I'll admit I find the package syntax daunting.  I had to grovel
about on the web, looking at XML FAQ's to decode it.

If I'm having trouble, probably others do to.  (Or I have a monopoly 
on wpkg ignorance...)


Let's look at the example package.


1.  My first step was to break these long run on lines into something 
that my brain can scan more easily.  By doing this, when I goof up, it
should be easier to find.  I sure hope the parsing engine ignores 
whitespace.

2.  Concept:  XML, like HTML, uses tags to mark up the text.  But 
where HTML is mostly about display, XML is mostly about content.
However, like HTML, XML tags can have atributes.  Remember <H3 
left-margin=2em> stuff </h3>  XML is like that.

    <package
         id="wpkg1"
         name="Windows Packager sample 1"
         revision="1"
         reboot="false"
         priority="0"
	>

So all of the 7 lines above is the package tag.  The closing tag comes 
much later.



	<check
		type="registry"
		condition="exists"
		path="HKLM\Software\wpkg\full\key\not\part\of\it"
		/>
         <check
		type="file"
		condition="exists"
		path="C:\wpkg\wpkg.bat"
		/>
         <check
		type="uninstall"
		condition="exists"
		path="WPKG 0.6-test1"
		/>


3.  Concept:  These /> threw me for a loop.  Why do some tags take a 
  /tag> at the end, and some not.

Go back to HTML.  Some tags are empty.  Like the <HR> tag for a 
horizontal rule.  Or the <BR> tag for line break.  XML doesn't have 
single ended tags, but it does have a shorthand for empty tags.
<tag></tag> can be shortened to <tag/>

So these check tags are all empty tags.


         <install
		cmd='msiexec /i (path to msi)'>
             	<exit code="0" />
         </install>

         <remove  cmd='msiexec /x (path to msi)' />

         <upgrade cmd='msiexec /i (path to msi)' />

With these three tags, the first one has content, the exit code, so it 
has the full </install> closing tag.  The rest only have atributes, so 
they can use the shorthand /> closing tag.


     </package>

And finally we close the entire package off.


Hope this helps others.


-- 
Sherwood Botsford		sbotsford at sjsa.ab.ca
St. John's School of Alberta	780-848-2881 Ext 134
RR - 5, Stony Plain, Alberta, T7Z 1X5



wpkg-users mailing list
wpkg-users at lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users




More information about the wpkg-users mailing list