Monday, October 26, 2009

This article describes how to develop a single EXE file for installation and deployment of a SharePoint solution to a Windows SharePoint Services or SharePoint Server farm. The single EXE file can also be used for installation repair and removal. Using the approach outlined in this article can simplify the distribution and installation of your SharePoint code – no more archives to extract, lengthy manual SharePoint admin screens to document and navigate or scripts to run – just a single EXE file to download and execute.

Note: Distribution of an application using the techniques described in this article requires the purchase of WinZip Pro and WinZip Self-Extractor. As of 10/25/09 these products retailed for $49.95 each on winzip.com.

Develop and Deploy Using SharePoint Solution Packages

The most important step and the one that takes the longest to master is to develop all code and assets to be deployed to SharePoint as one or more Features deployed as a SharePoint Solution Package (*.wsp). Much has been written online and in books on how to develop SharePoint Features and Solutions. If you are new to these topics or in need of a refresher, check out the oft-referenced Ted Pattison Office Space columns:

Features for SharePoint

Solution Deployment with SharePoint 2007

Download and Install the CodePlex SharePoint Solution Installer

The SharePoint Solution Installer is a free download from CodePlex licensed under the Microsoft Permissive License (Ms-PL) meaning you may use it to build and distribute commercial software without having to purchase a license or pay royalties (disclaimer: I am not a lawyer, you should verify the applicability of the Ms-PL to your project by consulting a legal professional).

Download and Install WinZip Pro, Self-Extractor, and the Command Line Add-on

Many commercial software products make use of WinZip to deliver and install their software. Our approach is to use WinZip to package up the multiple files required to execute the CodePlex SharePoint Solution Installer. You may download and install the trial versions of WinZip Pro and Self-Extractor to complete the demo, however you will need to purchase licenses prior to deploying software with WinZip.

WinZip Pro Download

WinZip Self-Extractor Download

WinZip Command-Line Add-on Download

Create a Build Directory

The build directory is where we will package up all the files required to build the single installation EXE. This will include the SharePoint Solution Package, application icon, license agreement, the SharePoint Solution Installer Setup.exe and configuration file, and various text files for the WinZip installer. You can learn more about the SharePoint Solution Installer configuration file on the product download site. The WinZip installer options are detailed in the product help file under the topic Command Line Options. For a complete, working example download and extract http://mikeknowles.com/download/SharePointSingleFileSetup.zip and navigate to the Build folder:

 

image 

Create a Build Script

Open the build.bat included in the example download. In line 4, the build script zips up the files required by the SharePoint Solution Installer. Line 6 packages several files for display in the WinZip-based installer and then directs WinZip to execute the SharePoint Solution Installer Setup.exe after extracting all the files. The end result will be an executable with the same name as the zip file (Demo.exe) which is then copied to the parent directory in line 7. The Demo.exe file now contains all files required for a professional-quality installation.

@echo off
del Demo.zip
del ..\Demo.exe
"c:\program files\winzip\wzzip" -o Demo.zip DemoSolution.wsp EULA.rtf Setup.exe Setup.exe.config application.ico
If ErrorLevel 1 Goto Exit
"C:\Program Files\WinZip Self-Extractor\WZIPSE32.EXE" -o Demo.zip -t WinZipMainDialog.txt -i application.ico -a AboutDialogExtra.txt -setup -c Setup.exe
move /Y Demo.exe ../
Goto Exit
:Exit
pause;

Run the Installation Program

The setup file (Demo.exe) must be run while logged into one of the SharePoint Farm servers as a user with Central Administration rights. A common approach is to maintain one account which all SharePoint processes run-as and then perform all SharePoint installations logged into the server as that user. If you try to run the setup program on a Windows XP or Vista computer or a server without SharePoint installed, the program will crash as the SharePoint Solution Installer is unable to initialize. After the program has been installed you can run the Demo.exe program again at which time after running through it’s status checks it will prompt you to repair or remove the installation.

 

image 

image

image

image

image

image

image

image

 

Going Beyond the Basics

You may choose to include a short Readme.txt file in a zip file with the executable as the download for your customers. This provides users with a local file reference for the installation as well as any other useful information in the Readme.txt file such as your website and additional support links and contacts.

Bookmark and Share  Comments [0] | Permalink | SharePoint

Leave a Comment

Name (required)
Email (will not be published)
Website
 
  Comment (Some html is allowed: a@href@title@target, b, blockquote@cite, em, i, img@src, strike, strong, sub, sup, u) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.
Comment Preview
Subscribe
Top 5 Posts
Add Google Analytics to a SharePoint Publishing Site
Integrating jQuery 1.3, ASP.NET 3.5 Visual Studio 2008
Add Custom Table Formats to SharePoint Content Editor
Configuring log4net for SharePoint Windows Authentication
Convert Visual Studio 2008 Class Library Project to Web Application Project
Tags
ASP.NET (4) dasBlog (5) GoogleAnalytics (2) jQuery (1) log4net (2) SharePoint (18) WebDesign (2)
 
 
 
Spreadfirefox Affiliate Button
 
Install FireBug
 
Download Notepad++