I have code that automatically creates a text file named makefile.txt. I include the following entries:
.Define DiskDirectory1=C:\Documents and Settings\Administrator\My Documents\InfoPath\CMTforSharepointPoC.nsf\Issue\cab
“C:\Documents and Settings\Administrator\My Documents\InfoPath\CMTforSharepointPoC.nsf\Issue\manifest.xsf”
“C:\Documents and Settings\Administrator\My Documents\InfoPath\CMTforSharepointPoC.nsf\Issue\template.xml”
“C:\Documents and Settings\Administrator\My Documents\InfoPath\CMTforSharepointPoC.nsf\Issue\myschema.xsd”
“C:\Documents and Settings\Administrator\My Documents\InfoPath\CMTforSharepointPoC.nsf\Issue\Issues.xml”
“C:\Documents and Settings\Administrator\My Documents\InfoPath\CMTforSharepointPoC.nsf\Issue\sampledata.xml”
“C:\Documents and Settings\Administrator\My Documents\InfoPath\CMTforSharepointPoC.nsf\Issue\Submit.xml”
“C:\Documents and Settings\Administrator\My Documents\InfoPath\CMTforSharepointPoC.nsf\Issue\Issue.xsl”
The XSN file will be named Issue.xsn. DiskDirectory1 is where the XSN file will be stored. I list seven files to include in the cabinet file. I define these files in different places and I have to include each one because of that. Excluding file will likely cause the XSN file to report failures when opening in InfoPath. I can add and remove files for different purposes though. As long as I define them correctly and include them in this cabinet file. The makecab.exe executable is well-documented in other blogs and online help. Basically, what I do looks like the following (in LotusScript):
Dim makeCabPath As String
makeCabPath = GetDirPath(“System”) & “\makecab.exe”
Dim shellCmd As String
Dim result As Integer
shellCmd = “makecab.exe” & ” /F ” & |”| & Me.tempPath & “\makefile.txt” & |”|
result = Shell(shellCmd, 6)
Me.tempPath is the folder containing the makefile.txt.
The end result is that I have a new XSN file created. That does not mean it will work in InfoPath. I may have messed up something in one of the files. But this is how I bring it together.
Interestingly enough, I can open the files in InfoPath directly by opening manifest.xsf. I can also open the Issue.XSN file and save the source files separately. I do this by opening the XSN file (i.e. the form) in the InfoPath Designer and then click on [File \ Save as Source Files …]. This allows me to view the individual files that make up the InfoPath form. In a sense, this brings me back to where I started.