0
votes

Having a VDPROJ project to produce an installer, a post build event is required to have some properties on the project. For example it's a batch file used to rename the MSI final installer file and include the target platform in it. Eg. it's required to be run like this:

ren Behnama.msi Behnama_$(TargetPlatform).msi

But TargetPlatform is a property of the project. How can I make it available for the batch file? I also tried using Behnama_$(TargetPlatform) for both ProductName and Title with no success.

How can I include target platform in MSI installer's name?

1
Is VD == VB (Visual Basic .NET)? - KargWare
Certainly not... - hamidi

1 Answers

0
votes

To get the platform from your project, you can just use $(var.Platform). The platform will be x86 or x64, depends on your configuration manager.

WXS-file or WXI-file

<!-- 32 bit vs. 64 bit -->
<?if $(var.Platform) = x64 ?>
  <?define Win64 = "yes" ?>
<?else ?>
  <?define Win64 = "no" ?>
<?endif ?>

In the project file MyProduct.wixproj you can define the output path

  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <OutputPath>.\bin\x86\</OutputPath>
    <IntermediateOutputPath>obj\$(Platform)\$(Configuration)\</IntermediateOutputPath>
    <DefineConstants>Debug</DefineConstants>
  </PropertyGroup>

It is always better to use folders for the platform instead of filenames. Because the obj folder can be reused, when you change the platform.