13.07.2015 Views

Microsoft SharePoint. Building Office 2007 Solutions in VB 2005 ...

Microsoft SharePoint. Building Office 2007 Solutions in VB 2005 ...

Microsoft SharePoint. Building Office 2007 Solutions in VB 2005 ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 9 ■ SHAREPOINT AND MICROSOFT OFFICE 365Creat<strong>in</strong>g the Install.bat fileIn order to <strong>in</strong>stall the new feature, you must create a folder <strong>in</strong> the TEMPLATES directory andcopy the Feature.xml and Elements.xml files to this location. Additionally, you must copy theWorker.aspx file to the LAYOUTS directory. F<strong>in</strong>ally, you must <strong>in</strong>stall the assembly <strong>in</strong> the GAC. Youcould certa<strong>in</strong>ly do all this by hand, but you’ll create a batch file to automate the process <strong>in</strong>stead.Follow these steps to create the batch file:1. In the Solution Explorer, right-click the WordCleaner project and select Add ➤ NewItem from the context menu.2. In the Add New Item dialog, select Text File.3. Name the text file Install.bat and click the Add button.4. Add the code from List<strong>in</strong>g 9-23 to create the Install.bat file. When you are done, runthe batch file to <strong>in</strong>stall the feature.List<strong>in</strong>g 9-23. The Install.bat File@SET FEATUREDIR="c:\program files\common files\microsoft shared\➥web server extensions\12\Template\Features"@SET LAYOUTDIR="c:\program files\common files\microsoft shared\➥web server extensions\12\Template\Layouts"@SET STSADM="c:\program files\common files\microsoft shared\➥web server extensions\12\b<strong>in</strong>\stsadm.exe"@SET GACUTIL="C:\Program Files\<strong>Microsoft</strong> Visual Studio 8\➥SDK\v2.0\B<strong>in</strong>\GacUtil.exe"md %FEATUREDIR%\WordCleanerxcopy /e /y Feature.xml %FEATUREDIR%\WordCleanerxcopy /e /y Elements.xml %FEATUREDIR%\WordCleanerxcopy /e /y Worker.aspx %LAYOUTDIR%%GACUTIL% -if b<strong>in</strong>\release\WordCleaner.dll%STSADM% -o <strong>in</strong>stallfeature -filename WordCleaner\feature.xml -forceIISRESETECHO F<strong>in</strong>ishedPAUSE

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!