[wix-users] Enforce either 32-bit or 64-bit [P]

Steven Ogilvie Steven.Ogilvie at titus.com
Tue Nov 24 10:42:38 PST 2015


Classification: Public
This is what I have:

<Product Id="*"
           Name="$(var.PlatformProductName)"
           Language="1033"
           Version="$(var.Version)"
           Manufacturer="$(var.ProductCompany)"
           UpgradeCode="$(var.UpgradeCode)">
    <Package InstallPrivileges="elevated"
             Manufacturer="$(var.ProductCompany)"
             InstallerVersion="500"
             Compressed="yes"
             InstallScope="perMachine"/>
    <Media Id="1"
           Cabinet="media1.cab"
           EmbedCab="yes"
           CompressionLevel="high"/>

    <MajorUpgrade DowngradeErrorMessage="A newer version of $(var.PlatformProductName) is already installed. Setup will now exit." Schedule="afterInstallValidate" AllowDowngrades="no"/>

You must modify the .wixproj as per below... i.e. the two configurations Release|x86 and Release|x64 and in the solution file as per below

Build both configurations...

I also have a check to ensure same version is not installed:

<Upgrade Id="$(var.UpgradeCode)">
      <UpgradeVersion Property="SAMEFOUND" IncludeMaximum="yes" IncludeMinimum="yes" Minimum="$(var.Version)" Maximum="$(var.Version)" OnlyDetect="yes"/>
    </Upgrade>

<Condition Message="The same version of $(var.PlatformProductName) is already installed. Setup will now exit.">NOT SAMEFOUND OR Installed</Condition>

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Mihajlo Cvetanovic
Sent: November-24-15 1:30 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] Enforce either 32-bit or 64-bit 

Thanks for the answer, but acting on "I would have the same upgrade code but different Product GUID" I'm not getting needed result. The rest of the answer I didn't use. Anyway, when I fix the upgrade code and set the product code to "*" I get two msi files that can be installed alongside (don't want that). Either I am doing something wrong, or I have wrong expectations. I want to prevent the situation where both 32-bit and 64-bit setups are installed. How to do that? var.UpgradeGUID is set in only one place to a fixed value. My hopefully relevant code (Wix is 3.6, Visual Studio is 2008):

  <Product Id="*"
    Name="$(var.ProductName) $(var.PlatformInfo)"
    Language="!(loc.LANG)"
    Version="$(var.ProductVersion)"
    Manufacturer="$(var.Manufacturer)"
    UpgradeCode="$(var.UpgradeGUID)">

    <Package Id= '*'
      Keywords="$(var.ProductName) Installer"
      Description="$(var.ProductName) Installer"
      InstallerVersion="301"
      Compressed="yes"
      Platform="$(var.PackagePlatform)"/>

    <MajorUpgrade DowngradeErrorMessage="!(loc.NewerVersionInstalled)"/>



On Mon, Nov 23, 2015 at 4:07 PM, Steven Ogilvie <Steven.Ogilvie at titus.com>
wrote:

> Remmeber that 32 bit apps must be installed by 32 bit MSI and 64 bit 
> apps should be installed by 64 bit MSI's
>
> I would have the same upgrade code but different Product GUID
>
> My WiX project builds both 32 and 64 bit MSI's (build one, then the 
> other using the release configuration)
>
> i.e.
>
> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
>     <OutputName>Product_Setup_x86</OutputName>
>     <OutputPath>$(Env1)\Installers\</OutputPath>
>
> <IntermediateOutputPath>obj\$(Configuration)\$(Platform)\</IntermediateOutputPath>
>     <DefineConstants>Debug;ProductVersion=$(BuildNumber)</DefineConstants>
>   </PropertyGroup>
>   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 
> 'Release|x86' ">
>     <OutputName>Prodcut_Setup_x86</OutputName>
>     <OutputPath>$(Env1)\Installers\</OutputPath>
>
> <IntermediateOutputPath>obj\$(Configuration)\$(Platform)\</IntermediateOutputPath>
>     <DefineConstants>ProductVersion=$(BuildNumber)</DefineConstants>
>     <SuppressPdbOutput>True</SuppressPdbOutput>
>   </PropertyGroup>
>   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64'
> ">
>     <OutputName>Product_Setup_x64</OutputName>
>     <OutputPath>$(Env1)\Installers\</OutputPath>
>
> <IntermediateOutputPath>obj\$(Configuration)\$(Platform)\</IntermediateOutputPath>
>     <DefineConstants>Debug;ProductVersion=$(BuildNumber)</DefineConstants>
>   </PropertyGroup>
>   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 
> 'Release|x64' ">
>     <OutputName>Product_Setup_x64</OutputName>
>     <OutputPath>$(Env1)\Installers\</OutputPath>
>
> <IntermediateOutputPath>obj\$(Configuration)\$(Platform)\</IntermediateOutputPath>
>     <DefineConstants>ProductVersion=$(BuildNumber)</DefineConstants>
>     <SuppressPdbOutput>True</SuppressPdbOutput>
>   </PropertyGroup>
>
> In the solution:
>
> GlobalSection(SolutionConfigurationPlatforms) = preSolution
>                 DebugX64|Mixed Platforms = DebugX64|Mixed Platforms
>                 DebugX86|Mixed Platforms = DebugX86|Mixed Platforms
>                 ReleaseX64|Mixed Platforms = ReleaseX64|Mixed Platforms
>                 ReleaseX86|Mixed Platforms = ReleaseX86|Mixed Platforms
>         EndGlobalSection
>         GlobalSection(ProjectConfigurationPlatforms) = postSolution
>                 {some GUID}.DebugX64|Mixed Platforms.ActiveCfg = Debug|x64
>                 {some GUID}.DebugX64|Mixed Platforms.Build.0 = Debug|x64
>                 {some GUID}.DebugX86|Mixed Platforms.ActiveCfg = Debug|x86
>                 {some GUID}.DebugX86|Mixed Platforms.Build.0 = Debug|x86
>                 {some GUID}.ReleaseX64|Mixed Platforms.ActiveCfg =
> Release|x64
>                 {some GUID}.ReleaseX64|Mixed Platforms.Build.0 =
> Release|x64
>                 {some GUID}.ReleaseX86|Mixed Platforms.ActiveCfg =
> Release|x86
>                 {some GUID}.ReleaseX86|Mixed Platforms.Build.0 =
> Release|x86
>         EndGlobalSection
>
> Build both 32 and 64 bit MSI's
> Then I have a bundle package that runs the product based on the 
> bitness of the OS
>
> Steve
>
> -----Original Message-----
> From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On 
> Behalf Of Mihajlo Cvetanovic
> Sent: November-23-15 9:54 AM
> To: wix-users at lists.wixtoolset.org
> Subject: [wix-users] Enforce either 32-bit or 64-bit
>
> Until now I had several setups for 32-bit app built in Wix. There's 
> MajorUpdate tag, and everything works fine. Now I want to introduce 
> setups for latest 32-bit and also 64-bit app. There's no reason users 
> should have both installed, so I'd like to prevent that. What you 
> usually do in this situation? Can I just have two .msi files with 
> identical Upgrade and Product GUIDs? Is there a drawback to this 
> option, are there caveats? For instance should I have different GUIDs 
> in two setups for all my components, and are there similar issues? 
> This should be a common problem, but my google skills failed me this time.
>
> For new setup I'm tinkering with both of the GUIDs different, but with 
> additional entries in Upgrade table, like this:
>
>     <!-- old 32-bit to new 64-bit -->
>     <?if $(var.Platform) = "x64" ?>
>     <Upgrade Id="$(var.UpgradeGUID_x86)">
>       <UpgradeVersion Minimum="0.0.0" OnlyDetect="no"
> Property="REPLACE32BIT" />
>     </Upgrade>
>     <?endif?>
>
>     <!-- old 64-bit to new 32-bit -->
>     <?if $(var.Platform) = "x86" ?>
>     <Upgrade Id="$(var.UpgradeGUID_x64)">
>       <UpgradeVersion Minimum="0.0.0" OnlyDetect="no"
> Property="REPLACE64BIT" />
>     </Upgrade>
>     <?endif?>
>
> Unfortunately this solution allows for some old 32-bit setup to be 
> installed alongside with new 64-bit setup. I want to prevent that, but 
> not sure how. If using identical GUIDs is an acceptable option then I 
> wouldn't need to work around with this code.
>
> ____________________________________________________________________

 



 
This message has been marked as Public by Steven Ogilvie on November-24-15 1:42:38 PM.

The above classification labels were added to the message by TITUS Message Classification. 
For more information visit www.titus.com.



More information about the wix-users mailing list