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 8350811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:26:11+00:00 2026-06-09T08:26:11+00:00

My program is supposed to be installed to a path that recorded in registry.

  • 0

My program is supposed to be installed to a path that recorded in registry. If the registry key is not found, then install to another(default) path.

For example, I’d like to have something like:

<Property Id="MYINSTALLDIR">
    <RegistrySearch Id='MyRegistry' Type='raw' Root='HKCU' Key='Software\MyApp\Foo' Name='InstallDir' />
    if not found, then set "MYINSTALLDIR" to "D:\working\defaultApps"
</Property>    

How should I write my wxs file to make this happen?

EDIT:

The problem now is:

if not found in registry, then set "MYINSTALLDIR" to LocalAppDataFolder 

I tried

<Property Id="MYINSTALLDIR" Value="LocalAppDataFolder">
    <RegistrySearch Id='MyRegistry' Type='raw' Root='HKCU' Key='Software\MyApp\Foo' Name='InstallDir' />
</Property>

But error returned:

Error 1606. Could not access network location LocalAppDataFolder.
  • 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-09T08:26:12+00:00Added an answer on June 9, 2026 at 8:26 am

    From memory the example below should work. If no value is found for the search, the property gets the default value. It’s only overwritten if the search succeeds.

    <Property Id="MYINSTALLDIR" Value="Default Property Value">
        <RegistrySearch Id='MyRegistry' Type='raw' Root='HKCU' Key='Software\MyApp\Foo' Name='InstallDir' />
    </Property>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I installed Erlang on my PC. Then added the path C:\Program Files (x86)\erl5.8.4\bin to
So my program is supposed to recursively go through a directory and then for
I have a program that is supposed to interact with a web server and
I have a small program that's supposed to sample some value from a device
The program is supposed to take a file, say data.dat, filled with a list
My program is supposed to read a text document with a bunch of numbers
This program is supposed to determine how many units are stored in the value
I'm supposed to program in Python, and I've only used Python for 3 weeks.
I am currently making a program which is supposed to prompt the user to
So I'm making a program which is supposed to print a horizontal histogram of

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.