Question

I have a folder with following structure, I wonder how can I create a wsp file for it, and it deploy the site definition for me,

structure

 - XML
 - -> ONET.xml
 - default.aspx
 - MasterPage.master
 - masterpageajax.master

Cheers

Was it helpful?

Solution

You need to create manifest.xml:

<?xml version="1.0"?>
<Solution SolutionId="876a627d-7944-4c3e-a17f-d347e9234517" xmlns="http://schemas.microsoft.com/sharepoint/">
  <SiteDefinitionManifests>
    <SiteDefinitionManifest Location="MySiteDef">
      <WebTempFile Location="1033\XML\webtempMySiteDef.xml" />
    </SiteDefinitionManifest>
  </SiteDefinitionManifests>
</Solution>

And you need to create a cab.ddf:

.OPTION EXPLICIT                    ; Generate errors on variable typos
;
.Set CabinetNameTemplate=SiteDef.wsp        ; The name of the WSP file
.set DiskDirectoryTemplate=CDROM    ; All cabinets go in a single directory
.Set CompressionType=MSZIP          ; 
.Set Cabinet=on                     ; 
.Set Compress=on                    ;
.Set DiskDirectory1=.               ; Use the specified directory for the output CAB file 
;
;*** Disable size limits for wsp (cab) files ;
;
.Set CabinetFileCountThreshold=0 
.Set FolderFileCountThreshold=0 
.Set FolderSizeThreshold=0 
.Set MaxCabinetSize=0 
.Set MaxDiskFileCount=0
.Set MaxDiskSize=0
;
;*** Files to zip                   ;
;
"C:\Work\MySiteDef\12\template\1033\XML\webtempMySiteDef.xml" "1033\XML\webtempMySiteDef.xml"
"C:\Work\MySiteDef\12\template\sitetemplates\MySiteDef\default.aspx" "MySiteDef\default.aspx"
"C:\Work\MySiteDef\12\template\sitetemplates\MySiteDef\masterpage.master" "MySiteDef\masterpage.master"
"C:\Work\MySiteDef\12\template\sitetemplates\MySiteDef\masterpageajax.master" "MySiteDef\masterpageajax.master"
"C:\Work\MySiteDef\12\template\sitetemplates\MySiteDef\XML\onet.xml" "MySiteDef\XML\onet.xml"
"C:\Work\MySiteDef\manifest.xml" "manifest.xml"

And then you need to run makecab:

makecab -f cab.ddf

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top