상세 컨텐츠

본문 제목

wsp 파일 배포

MOSS

by happynuri 2008. 6. 3. 19:23

본문

메모장을 열어서 install.bat 파일로 저장 한다.

코드는 아래와 같다.

@echo off
cls
@set PATH=%ProgramFiles%\Common Files\Microsoft Shared\web server extensions\12\BIN;%PATH%
@set url=http://localhost:80

echo --- Adding solution TreeView.wsp  to store... 솔루션 add
stsadm -o addsolution -filename TreeView.wsp

if errorlevel == 0 goto :deploySolution
echo ### Error adding solution TreeView.wsp to the store
echo .
goto end

:deploySolution
stsadm -o deploysolution -name TreeView.wsp -url %url% -immediate -allowCasPolicies -force
stsadm -o execadmsvcjobs
if errorlevel == 0 goto :activateFeature
echo ### Error deploying solution TreeView.wsp echo . 트리뷰 배포
goto end

:activateFeature
echo --- Activating features in solution TreeView.wsp  트리뷰 웹파트 activate
stsadm -o activatefeature -name TreeViewClass.webpart -url %url% -force
if errorlevel == 0 goto :successDeploy
echo ### Error activating feature TreeView.wsp
echo .
goto end

:successDeploy
echo Successfully deployed the solution and activated the feature.
echo .
goto end

:end
pause


wsp 파일을 압축 해체 해 보면 .webpart  파일이 존재 한다.

다시 .cab 타입으로 압축을 하고, 확장자를 wsp 로 바꾸어 준다.



ps. 압축 해제를 했을때, manifest.xml 이 있는데

<FeatureManifest Location="TreeView\feature.xml" />

이 부분이 솔루션 저장소(Program Files\Common Files\Microsoft Shared\web server extensions\12

\TEMPLATE\FEATURES)에 생성되는 폴더 명이다.

visual studio 2005 에서 웹파트를 생성하고 빌드 하였더니,

폴더명_guid  이러한 형식으로 솔루션 저장소에

배포가 되는 것을 볼수 있다.  manifest.xml 에서 수정을 하면 폴더명 만 지정해 줄수 있다.

이놈의 경로 때문에 삽질을 했네.. ㅎㅎ

install을 할려니까 feature.xml 이 경로에 없다는 그런 소리가 계속 나오길래 이상했다. ㅎㅎ

여튼 이제는 해결~


또 하나!!!

css 파일을 배포 해야 하는데 install.bat 파일을 클릭 하는것 만으로도 wsp 파일을 이용해서 한번에

배포를 마치고 싶었다.

그래서 wsp 파일을 압축 해제 하고 LAYOUT폴더를 생성하고 하위에 STYLES 폴더를 둔후

css 파일을 가져다 두었다. ( 이것은 Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUT\STYLES 경로와 같다)

그런 다음에 manifest.xml 을 수정 하였다.

</FeatureManifest> 바로 밑에


<TemplateFiles>
    <TemplateFile Location="Layouts\STYLES\DoclibTreeView.css"/>
  </TemplateFiles>

이렇게 두는 것으로 끝~~~ 에고.. 힘들구나~

관련글 더보기

댓글 영역