2012-09-13 3 views
7

배포 용 웹 설치 프로젝트를 사용하는 VS2010 프로젝트가 있습니다. 지금은 VS2012로 마이그레이션하고 교체 설정 루틴을 찾아야합니다.VS2012에 MSI를 만들기위한 웹 설치 대체?

요구 사항은 내가 가진 : dev에 기계에 배포 패키지/설치 프로그램을 만들 수

  • 한 단계 빌드를.
  • Visual Studio를 사용하지 않고 서버에서 실행할 수있는 설치 프로그램/루틴.
  • Visual Studio와 서버 간의 직접적인 상호 작용이 없습니다. RDP 세션을 통해 설치 파일을 복사해야합니다.
  • 웹 응용 프로그램 (MVC) 및 Windows 서비스를 하나의 단일 설치 프로그램에 번들로 설치하는 것이 좋습니다 (새로운 요구 사항은 현재 웹 설치 프로젝트를 해결하지 못함).
  • 설치의 일부로 EF 마이그레이션을 실행할 수 있습니다 (현재 custom action 통해 완료).

어디에서 시작해야합니까? VS2012의 향상된 게시 기능을 조사해야합니까? 윅스를 봐야할까요? 다른 것?

+0

윅스는 설치의 스위스 군용 칼,하지만 불행히도 그것은 윅스 설치 프로그램을 개발하고 유지하는 일이 꽤 필요합니다. 설치 프로그램 요구 사항을 다른 도구로 해결할 수없는 경우 마지막 수단으로 사용하십시오. –

+0

다음은 시작할 수있는 목록입니다. http://en.wikipedia.org/wiki/List_of_installation_software –

답변

1

Visual Studio 2012를 자세히 살펴보면서 의도 된대로 작동하려고 시도했지만 대신 웹 배포 패키지를 사용했습니다. MSI 파일을 만들지 않고 대상 컴퓨터의 IIS로 쉽게 가져올 수있는 zip 파일을 만듭니다.

Windows 서비스 프로젝트가 웹 사이트 프로젝트에 대한 참조로 추가되었습니다. 그렇게하면 서비스 용 바이너리가 웹 사이트의 bin 디렉토리에 포함됩니다. Entity 프레임 워크의 migrate.exe 파일이 bin 디렉터리의 링크로 추가되었으므로 배포 된 것입니다.

마지막으로 서비스를 설치 및 시작하고 배포에 포함 된 서비스의 구성 파일을 가져 오는 데 필요한 명령을 실행하는 프로젝트에 project.wpp.targets 파일을 추가했습니다. 이것은 우리에게 도움이되었지만 실제로는 우아하지 않았습니다 (예 : 다른 구성을위한 사이트의 설치 경로는 하드 코딩 됨).

project.wpp.targets 파일 :

<?xml version="1.0" encoding="utf-8" ?> 
<!-- 
*** WARNING *** 
This file is cached by visual studio and changes won't take effect until 
visual studio is restarted. When editing this file, it is better to run the 
build step for packaging from the command line (a VS command prompt). 
There are some problems with dependencies not being correctly identified that 
way, but at least the archive.xml file can be verified from the command prompt. 

msbuild orderportal.csproj /t:package /p:Configuration=SysTest /p:DeployOnBuild=true;DeployTarget=Package 
--> 

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 
    <PropertyGroup> 
    <IncludeRunMigrations>TRUE</IncludeRunMigrations> 
    <AfterAddIisSettingAndFileContentsToSourceManifest Condition="'$(AfterAddIisSettingAndFileContentsToSourceManifest)'==''"> 
     $(AfterAddIisSettingAndFileContentsToSourceManifest); 
     RunMigrations; 
     ServiceInstall; 
    </AfterAddIisSettingAndFileContentsToSourceManifest> 

    <IncludeServiceInstall>TRUE</IncludeServiceInstall> 
    <BeforeAddContentPathToSourceManifest Condition="'$(BeforeAddContentPathToSourceManifest)' == ''"> 
     $(BeforeAddContentPathToSourceManifest); 
     ServiceUnInstall; 
    </BeforeAddContentPathToSourceManifest> 

    <DeploymentDir Condition="'$(Configuration)'=='SysTest' AND '$(DeploymentDir)'==''">c:\inetpub\wwwroot\SysTest\</DeploymentDir> 
    <DeploymentDir Condition="'$(Configuration)'=='IntTest' AND '$(DeploymentDir)'==''">c:\inetpub\wwwroot\IntTest\</DeploymentDir> 
    <DeploymentDir Condition="'$(Configuration)'=='Prod' AND '$(DeploymentDir)'==''">c:\inetpub\wwwroot\</DeploymentDir> 

    <CopyAllFilesToSingleFolderForPackageDependsOn> 
     IncludeServicesAppConfig; 
     $(CopyAllFilesToSingleFolderForPackageDependsOn); 
    </CopyAllFilesToSingleFolderForPackageDependsOn> 

    </PropertyGroup> 
    <Target Name="RunMigrations" Condition="'$(IncludeRunMigrations)' == 'TRUE'"> 
    <Message Text="Adding migration running"/> 
    <ItemGroup> 
     <MsDeploySourceManifest Include="runCommand"> 
     <path>$(DeploymentDir)bin\migrate.exe /startupdirectory:$(DeploymentDir)bin Topsi.Core.dll /startUpConfigurationFile:$(DeploymentDir)web.config</path> 
     <waitAttempts>1</waitAttempts> 
     <waitInterval>60000</waitInterval> 
     <dontUseCommandExe>true</dontUseCommandExe> 
     <AdditionalProviderSettings>waitInterval;waitAttempts;dontUseCommandExe</AdditionalProviderSettings> 
     </MsDeploySourceManifest> 
    </ItemGroup> 
    </Target> 

    <Target Name="ServiceUnInstall" Condition="'$(IncludeServiceInstall)' == 'TRUE'"> 
    <Message Text="Adding service uninstall" /> 
    <ItemGroup> 
     <MsDeploySourceManifest Include="runCommand"> 
     <path>net stop "Topsi Schedule Service $(Configuration)"</path> 
     <waitAttempts>1</waitAttempts> 
     <waitInterval>60000</waitInterval> 
     <dontUseCommandExe>true</dontUseCommandExe> 
     <AdditionalProviderSettings>waitInterval;waitAttempts;dontUseCommandExe</AdditionalProviderSettings> 
     </MsDeploySourceManifest> 
     <MsDeploySourceManifest Include="runCommand"> 
     <path>C:\Windows\Microsoft.NET\Framework\v4.0.30319\installutil.exe /u $(DeploymentDir)bin\Topsi.Services.exe</path> 
     <waitAttempts>1</waitAttempts> 
     <waitInterval>60000</waitInterval> 
     <dontUseCommandExe>true</dontUseCommandExe> 
     <AdditionalProviderSettings>waitInterval;waitAttempts;dontUseCommandExe</AdditionalProviderSettings> 
    </MsDeploySourceManifest> 
    </ItemGroup> 
    </Target> 
    <Target Name="ServiceInstall" Condition="'$(IncludeServiceInstall)' == 'TRUE'"> 
    <Message Text="Adding service install"/> 
    <ItemGroup> 
     <MsDeploySourceManifest Include="runCommand"> 
     <path>C:\Windows\Microsoft.NET\Framework\v4.0.30319\installutil.exe $(DeploymentDir)bin\Topsi.Services.exe</path> 
     <waitAttempts>1</waitAttempts> 
     <waitInterval>60000</waitInterval> 
     <dontUseCommandExe>true</dontUseCommandExe> 
     <AdditionalProviderSettings>waitInterval;waitAttempts;dontUseCommandExe</AdditionalProviderSettings> 
     </MsDeploySourceManifest> 
     <MsDeploySourceManifest Include="runCommand"> 
     <path>net start "Topsi Schedule Service $(Configuration)"</path> 
     <waitAttempts>1</waitAttempts> 
     <waitInterval>60000</waitInterval> 
     <dontUseCommandExe>true</dontUseCommandExe> 
     <AdditionalProviderSettings>waitInterval;waitAttempts;dontUseCommandExe</AdditionalProviderSettings> 
     </MsDeploySourceManifest> 
    </ItemGroup> 
    </Target> 
    <Target Name="IncludeServicesAppConfig"> 
    <ItemGroup> 
     <_CustomFiles Include="..\Services\bin\$(Configuration)\Topsi.Services.exe.config"> 
     <DestinationRelativePath>%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath> 
     </_CustomFiles> 

     <FilesForPackagingFromProject Include="%(_CustomFiles.Identity)"> 
     <DestinationRelativePath>bin\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath> 
     </FilesForPackagingFromProject> 
    </ItemGroup> 
    </Target> 
</Project> 
관련 문제