Wpsamplehelloworld DLL

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

A sample project (Hello world webpart and installer project) and walk through for

creating an installer for web part that will install the webpart on the share point portal
site.

It will make a SafeControl entry in share point portal site's webconfig file, will add a file
in the share point portal site's wpcatalog, will create a folder under share point portal
site's wpresources directory and add files to the created folder.

Assumptions

• Hello world webpart project is ready for use.


• Developer knows how to add a webpart to the share point portal site.
• Developer has knowledge of webparts and share point portal site.

How to add a .cab project to the existing web part solution?

1. Right click the solution and navigate to Add -> New Project.
2. Select Setup and Deployment project from project type.
3. Select Cab Project from Template section.
4. Write the appropriate Project name, select the appropriate project location and
click OK.

How to add (file installation properties) the project output to the .cab project?

1. Right click on the .cab project. Navigate to Add -> Project Output.
2. Select the Primary Output and Content Files from the available list.

How to add the file to the Primary Output file installation properties?

1. Right click on the Primary Output.


2. Select Properties.
3. In the Primary Output properties click on Outputs and select the
WpSampleHelloWorld.dll.

How to add the file to the Content Files file installation properties?

1. Edit Manifest.xml in the webpart project.


2. Under the section <ClassResources>, add an entry like <ClassResource
FileName ="minus.gif"/> for each file that needs to be deployed under
"wpresources\WpSampleHelloWorld".
3. Assembly mentioned under the section <Assemblies> will be deployed in the
share point portal's bin directory.
4. DWP file mentioned under the section <DwpFiles> will be deployed in the share
point portal's wpcatalog directory.
5. Right click on the Content Files of the installer project.
6. Select Properties.
7. In Content Files properties click on Outputs and it will show the entire files that
are part of the current project in the popup window.

How to run the cab file?

1. Edit the .bat file WpSampleHelloWorldInstaller.bat and modify "http://ABC/" to


the required portal site.
2. Through the command prompt, navigate to the directory where
WpSampleHelloWorldInstaller.bat and WpSampleHelloWorldInstaller.CAB are
present.
3. Enter the WpSampleHelloWorldInstaller.bat file name on the command prompt
and press the Enter key. It will show a success message.
4. Verify that a SafeControl entry is added to the webconfig file and
"WpSampleHelloWorld_1.0.0.0__b8904f2e5aa5eda1_HelloWorld.dwp" file is
added to the wpcatalog directory. Create a folder with the name
"WpSampleHelloWorld" under wpresource directory and add all the files that are
mentioned in manifest.xml to the "wpresource\WpSampleHelloWorld" directory.

You might also like