WIX: Howto set the name of the msi output file dynamically

后端 未结 8 515
时光取名叫无心
时光取名叫无心 2021-01-31 16:44

I want to include some dynamic part in the filename of the msi file my wix projects produce. This dynamic part should be controlled by variables which are part of my wix project

8条回答
  •  情歌与酒
    2021-01-31 17:39

    You could update the OutputName of your .wixproj and use an MSBuild variable to pass through the version number or any other variable you like.

    My build script looks like this:

    set PRODUCTVERSION=7.1.0.1
    MSBuild.exe /p:Configuration=Debug /p:ProductVersion=%PRODUCTVERSION% Installer.wixproj
    

    And my WiX project looks like this:

    
    
      
        Debug
        x86
        1.0.0.0
        {b7415c44-8d59-4ac2-b698-03e399a305e3}
        2.0
        Installer.$(ProductVersion)
        ...
      
      
        bin\$(Configuration)\
        obj\$(Configuration)\
        Debug
        ProductVersion=$(ProductVersion)
      
      ...
    
    

    The output would be:

    Installer.7.1.0.1.msi
    

提交回复
热议问题