简体   繁体   中英

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

I want to generate MSI files from a .vdproj file using the devenv command in a command prompt. This command is running well but no MSI file is generated. What is wrong?

What should I set in environment variables, or is there any other way to generate an MSI from a .vdproj file?

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 (ie 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.

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>

我的情况是一样的,给项目名称/ project帮助.msi文件生成,

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM