Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8283871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:53:51+00:00 2026-06-08T10:53:51+00:00

( I need to get this to work for the Product / .msi directly,

  • 0

(I need to get this to work for the Product / .msi directly, not by using Bundle / Burn.)

(I am using WiX 3.6.)

Fragment that puts a registry value into a variable

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
  <?include $(sys.CURRENTDIR)Deployment\Data\Statics.wxi ?>
  <Fragment>
    <util:RegistrySearch Root="HKCU" Key="$(var.Line.Reg.Path)" Value="Version" Variable="AppAlreadyInstalled" />
  </Fragment>
</Wix>

Main product with non-working condition

<Product Name="$(var.App.Title)" Manufacturer="!(loc.Company)" Language="!(loc.Lang)" Id="*" Version="$(var.VersionNumber)" UpgradeCode="$(var.App.UpgradeCode)">
    <Package Id="*" InstallerVersion="300" Compressed="yes" InstallScope="$(var.App.Elevation)" InstallPrivileges="limited" />
    <DirectoryRef Id="TARGETDIR" />
    <MajorUpgrade Schedule="afterInstallValidate" DowngradeErrorMessage="!(loc.Msi.NewerVersionInstalled)" />
    <Property Id='DiskPrompt' Value="$(var.App.Title) Installation Media" />
    <Media Id="1" Cabinet="Media.cab" EmbedCab="yes" DiskPrompt="#1" />
    <Icon Id="AppIcon" SourceFile="$(var.Icon.Path)" />

    <Condition Message="Newer version already installed.">
        <![CDATA[Installed OR AppAlreadyInstalled]]>
    </Condition>

    <Feature Id="ProductFeature" Level="1">
         ...
    </Feature>
</Product>
  • I believe AppAlreadyInstalled is never set at the moment because it is in a fragment in a different file.
  • Then I actually want the installation to proceed if the registry value is NOT found at all / does not exist.
  • But if it does it exist, I would like the installation to proceed only if the registry value is below a certain value e.g. proceed with installation only if AppAlreadyInstalled < 1.3.44; this sounds hard to achieve because the registry value is stored as a string with two full-stops / periods.
  • Note the registry check is not of the application to-be-installed, which is already taken care of by DowngradeErrorMessage.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T10:53:52+00:00Added an answer on June 8, 2026 at 10:53 am

    WixUtilExtension:RegistrySearch is only for bundles. You need a plain RegistrySearch in the WiX namespace. You can use RegistrySearchRef to pull in a RegistrySearch from a separate fragment.

    However, you’re right that a version comparison is problematic: MSI does ordinal string comparisons so 1.2 > 1.10. If the install directory is in the registry, you might be better off using a RegistrySearch combined with a DirectorySearch and a FileSearch. FileSearch can search by version using the MinVersion attribute so if there’s a file with a version you can use to detect the product, it’ll be more reliable than string comparisons.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to get to work something like this: ./foo.py [-b option [-a]] with
Here in this html i need to get the image name arrow_down using jquery
I need to get the last inserted product by a user. This is what
I am trying to get a list of product id's that do not have
I have this string: 123-456-7 I need to get this string: 1234567 How I
I need to get a value from another page. But I get this error
I need some help to get this right, please. I have created an iPad
I cannot get this function to fire off... I'm thinking I need a fresh
I have linq request. I need get item.Title in select. how do this? var
I need to get the contents from this URL http://google.fr/ok in a NSString can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.