Running devenv against a .vdproj at the command line doesn't produce an MSI

偶尔善良 提交于 2019-12-04 07:08:59

This is usually (in my experience!) caused by not targeting the correct build configuration. Within Visual Studio, at the solution level you can go to the Build menu and choose Configuration Manager. Ensure that for all applicable configurations (chosen via the Active Solution Configuration drop-down) the installer project has a tick in the Build column.

Now you need to ensure that when invoking devenv you're passing the appropriate build configuration (i.e. one that has Build ticked for the setup project) as follows:

C:\PathToVisualStudio\devenv.exe /Rebuild Release C:\PathToProject\ProjectName.sln" /Out "PathToProject\vs_errors.txt"

(In this example, Release is the build configuration I'm targeting)

This command also logs the output of Visual Studio to a text file called vs_errors.txt in the same folder as your solution so you can review this to determine if there are any other reasons why the setup project failed to build.

Vikram Bartakke

Above script worked for me, try it and let me know if it works for you. You can pretty much have any configuration. I have used Release|x86. Just replace that line with your configuration and it should work. Make sure that whatever configuration you use exists in .sln file or .csproj file, otherwise you may get some error about invalid configuration. Hope this helps.

<target name="BuildMsi">
    <echo message="Creating installables (.msi) for MyTestApplication, please wait..."/>    
    <exec program="c:\program files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe">
        <arg value="c:\My app\My_Test_solution.sln"/>
        <arg value="/build"/>
        <arg value="Release|x86" />
        <arg value="/project"/>
        <arg value="c:\My app\setup\My_Test_solution.vdproj"/>
    </exec>
</target>

My case was the same, and giving the project name with /project helped with .msi file generation,

devenv /build Release /project SDK-Deployment SDK-Deployment.vdproj
Baljeetsingh

I don't think that msi will be genereated from devenv.com , you may choose wix with nant to create installer.

Nant has a task, msi task but it requires micrsoft cabinet sdk, which is not available for download.

read this for more details Build merge module without Devenv from .vdproj

p.s. If you find another way to build the installer , please share.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!