Friday, October 8, 2010

Install.bat Part 2

Install.bat for VS 2008

A ready to use install.bat. The Xcopy part has been fully defined since it was not working properly in VS2008.

@SET TEMPLATEDIR="c:\program files\common files\microsoft shared\web server extensions\12\Template"
@SET STSADM="c:\program files\common files\microsoft shared\web server extensions\12\bin\stsadm"
@SET GACUTIL="C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\GacUtil.exe"

Echo Copying files to TEMPLATE directory
xcopy "C:\Partha\Devarea\MyFeatureReceiver\MyFeatureReceiver1\MyFeatureReceiver1\TEMPLATE\*" "c:\program files\common files\microsoft shared\web server extensions\12\Template" /e /y

REM Echo Installing feature
REM %STSADM% -o InstallFeature -filename MyFeatureReceivers\feature.xml -force

REM Echo Uninstalling the DLL from GAC
REM %GACUTIL% /u MyFeatureReceiver1

Echo Installing the DLL in GAC
Echo %GACUTIL%
%GACUTIL% /i "C:\Partha\Devarea\MyFeatureReceiver\MyFeatureReceiver1\MyFeatureReceiver1\bin\Debug\MyFeatureReceivers.dll"

REM Echo Restart IIS Worker Process IISRESET
REM IISRESET


http://blah.winsmarts.com/2008-7-Authoring_SharePoint_2007_Workflows_using_VS2008.aspx
http://msdn.microsoft.com/en-us/library/bb466224(office.12).aspx

Install.bat - With Application pool Recycle in Visual Studio 2008

ECHO Installation in progress.........

@SET TEMPLATEDIR="C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE"
@SET STSADM="C:\program files\common files\microsoft shared\web server extensions\12\bin\stsadm"
@SET GACUTIL="C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\gacutil.exe"
@SET APPPOL="C:\WINDOWS\system32\cscript.exe"
@SET IISVBS="C:\WINDOWS\system32\iisapp.vbs"

ECHO Copying files..........
rem xcopy /e /y TEMPLATE\* "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE"
xcopy /e /y TEMPLATE\* %TEMPLATEDIR%
ECHO Uninstalling the DLL from GAC
%GACUTIL% /u SimpleCustomApplicationPage1

ECHO Installing the DLL in GAC
%GACUTIL% /i "E:\Partha Projects\SP2007\Custome Application Pages\SimpleCustomApplicationPage1\SimpleCustomApplicationPage1\bin\Debug\SimpleCustomApplicationPage1.dll"

REM If we need to restart only the AppPool then
REM SET /P AppPoolName=[Please Enter the application pool name]
REM %APPPOL% %IISVBS% /a %AppPoolName% /r

ECHO Restart IIS Application Pool - Worker Process IISRESET
%APPPOL% %IISVBS% /a "SharePoint - 7070" /r

Another one
@echo off
ECHO Installation in progress.........

@SET TEMPLATEDIR="C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE"
@SET STSADM="C:\program files\common files\microsoft shared\web server extensions\12\bin\stsadm"
@SET GACUTIL="C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\gacutil.exe"
@SET APPPOL="C:\WINDOWS\system32\cscript.exe"
@SET IISVBS="C:\WINDOWS\system32\iisapp.vbs"

ECHO Copying files..........
xcopy /e /y TEMPLATE\* %TEMPLATEDIR%
ECHO Uninstalling the DLL from GAC
%GACUTIL% /u MultiLingualListDefinition

ECHO Installing the DLL in GAC
%GACUTIL% /i "E:\Partha Projects\SP2007\CustomListDefinition\MultiLingualListDefinition\bin\Debug\MultiLingualListDefinition.dll"

Echo Installing Feature.......
%STSADM% -o installfeature -filename MLContentType\feature.xml -force
%STSADM% -o installfeature -filename MLStringListDefinition\feature.xml -force

REM Echo Activating Features...........
REM %STSADM% -o activatefeature -filename MLContentType\feature.xml
REM %STSADM% -o activatefeature -filename MLStringListDefinition\feature.xml


REM If we need to restart only the AppPool then
REM SET /P AppPoolName=[Please Enter the application pool name]
REM %APPPOL% %IISVBS% /a %AppPoolName% /r

ECHO Restart IIS Application Pool - Worker Process IISRESET
%APPPOL% %IISVBS% /a "SharePoint - 7070" /r

CabLib – Error running MakeCab.exe

CabLib – Error running MakeCab.exe
Could not load file or assembly 'CabLib, Version=6.9.26.0, Culture=neutral, Publ
icKeyToken=85376ef9a48d191a' or one of its dependencies
I was trying to create a solution package for SharePoint. Thus, planned to use the Makecab.exe to create the cab file. Upss!! got this error while running the makecab.exe /f MyAppPackage.ddf
Building the solution - please wait
Saving the Manifest.xml file
Creating the WSP file
Could not load file or assembly 'CabLib, Version=6.9.26.0, Culture=neutral, PublicKeyToken=85376ef9a48d191a' or one of its dependencies. An attempt was made to load a program with an incorrect format. It seemed that the Dll could not be loaded
Sometimes this could happen while running wspbuilder.exe also.
Investigation:
1. I have the CabLib.dll file in the same directory as wspbuilder.exe
2. cabinet.dll exists in the windows\system32 directory.
3. The CABLIB.DLL is a C++ library and therefore you have to use the right version of it when you are using 32 or 64 bit windows server systems.
Solution :
Thought of one very simple solution, normally whenever I get stuck with such problem I use that only…. Putting the dll in the GAC haaaaaa. Found the dll from this location.
C:\Program Files\WSPTools\WSPBuilderExtensions\Resources\x86]
CabLib.dll
Dropped in Assembly file….. i.e. GAC. And it worked…. That’s all….
HaPpY CoDiNg………….
Partha (Aurum)