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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:49:32+00:00 2026-06-10T18:49:32+00:00

My installer needs to read a value from the registry and set the install

  • 0

My installer needs to read a value from the registry and set the install path to parent of that value.

For example, from registry I get:

D:\apps\client

Then the installer should install the app to

D:\apps

I tried [DIR]\..\ (in “Directory” or “CustomAction”), but seeing following error when installing:

Error 1324. The folder path '..' contains an invalid character.

How can I do this with WiX?

  • 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-10T18:49:34+00:00Added an answer on June 10, 2026 at 6:49 pm

    It seems that you can’t do it with pure wix. You can use the Custom Action Type 1. Execute it in immediate mode before ‘LaunchConditions’ action. Initialize somewhere in your wix-code new property like:

    <Property Id="DIRFROMREG" Value="0" Secure="yes">  
    

    And here is sample on C#:

     public class CustomActions
    {
        [CustomAction]
        public static ActionResult DirectorySearchAction(Session session)
        {
            try
            {
                session.Log("Directory search");
                RegistryKey reg = Registry.LocalMachine.OpenSubKey(@"...your subkey...");
                if (reg != null)
                {
                    var dir=reg.GetValue("...your value...");
                    /*
                        var parentdir= split here your directory
                    */
                    session["DIRFROMREG"] =parentdir;
                    session.Log(@"directory is ");
                }
                else
                {
                    session.Log(@"The registry key is not found");
                }
            }
            catch (Exception e) 
            {
                session.Log(@"Error "+e);
            }
            return ActionResult.Success;
        }
    }
    

    And the last thing:

    <SetProperty Id="INSTALLLOCATION" Value="[DIRFROMREG]" After="Your custom action">NOT DIRFROMREG=0</SetProperty>
    

    Hope this helps.

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

Sidebar

Related Questions

I have an installer that needs to a person to be an admin (
I am creating an installer that also needs to delete the Arial font (I
I have a .NET component written in C# that needs to register some registry
I am writing an installer( msi file) which needs to be run on a
I have a NSIS installer I want to be totally silent unless it needs
I have an NSIS based installer that I need to be able generate slightly
I have an app included into INSTALLED_APPS that needs to be monkey-patched. The problem
I am using visual c# express 2010. I need an installer that will allow
I need my application installer set the program to auto-startup for all users. Then
I have a classic ASP website (yes they still exist) that needs to call

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.