Publishing API, Error revising package -- InstallPointDirectory not set by server
so i'm hand-crafting installableitem in attempt wsus support android devices through clientservicing api. here's i'm doing
public static void populatepackagefromapk(this softwaredistributionpackage sdp, string pathtoapk)<br/> {<br/> fileinfo sourcefile = new fileinfo(pathtoapk);<br/> if (!sourcefile.exists)<br/> {<br/> throw new filenotfoundexception("apk not found!", pathtoapk);<br/> }<br/> <br/> sha1cryptoserviceprovider sha1 = new sha1cryptoserviceprovider();<br/> stream s = sourcefile.openread();<br/> string hash = system.convert.tobase64string(sha1.computehash(s));<br/> s.close();<br/> <br/> fileforinstallableitem ffii = new fileforinstallableitem();<br/> ffii.filename = sourcefile.name;<br/> ffii.originuri = new uri(sourcefile.fullname.replace('\\', '/'));<br/> ffii.digest = hash;<br/> ffii.modified = sourcefile.lastwritetimeutc;<br/> ffii.size = sourcefile.length;<br/> <br/> installableitem = new installableitem();<br/> i.id = guid.newguid();<br/> i.originalsourcefile = ffii;<br/> <br/> i.installbehavior = new installbehavior();<br/> i.installbehavior.canrequestuserinput = true;<br/> i.installbehavior.rebootbehavior = rebootbehavior.neverreboots;<br/> i.installbehavior.impact = installationimpact.normal;<br/> i.installbehavior.requiresnetworkconnectivity = false;<br/> <br/> i.uninstallbehavior = new installbehavior();<br/> i.uninstallbehavior.canrequestuserinput = false;<br/> i.uninstallbehavior.impact = installationimpact.normal;<br/> i.uninstallbehavior.rebootbehavior = rebootbehavior.neverreboots;<br/> i.uninstallbehavior.requiresnetworkconnectivity = false;<br/> <br/> sdp.installableitems.add(i);<br/> <br/> sdp.title = sourcefile.name;<br/> sdp.description = sourcefile.name;<br/> <br/> sdp.restricttoclientservicingapi = true;<br/> }
so, succeeds publishing.
later revise, call iupdateserver.exportpackagemetadata , load file using softwaredistributionpackage constructor.
when call revisepackage, argument exception in path.combine, because installpointdirectory (internal property) null.
when package created sdp.populatepackagefromexe returned exportpackagemetadata, has segment in usp:updateservicesproperties
<usp:installableiteminfo id="bb80a7b2-60aa-4394-b430-b9502e389735"<br/> installpointdirectory="6c5b12f0-cd89-4fd7-b3cf-8c8a6c77dad6\bb80a7b2-60aa-4394-b430-b9502e389735"> <usp:file digest="mztrluwftzanx5dml9rrian6q9m="<br/> filename="bb80a7b2-60aa-4394-b430-b9502e389735_1.cab"<br/> size="20378" modified="2010-07-19t20:27:20.695z"></usp:file> </usp:installableiteminfo>
of course, installpointdirectory points share on server, \\server\updateservicespackages\[installpointdirectory]
on hand-crafted installableitem, directories , files exist, xml segment *missing*, what's causing error on revise.
any ideas why publish succeeds , creates files, wsus doesn't see fit return file information?
i figured out problem, getxml method invoked generate installableiteminfo tag on descendants of installableitem. if using base class, tag never gets created.
in summary, publishing api must generate data, wsus server not.
Windows Server > WSUS
Comments
Post a Comment