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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:06:11+00:00 2026-05-25T17:06:11+00:00

I started a Windows Forms project that in essence it will download several Zip

  • 0

I started a Windows Forms project that in essence it will download several Zip files, un-compress them and run the installer .msi plus it had to be able to ask SQL connection values to be replaced in the Web Site that creates in one of the installer

For example:

  1. Download a Web Proeject installer from http://domain.com/apps/site.zip and install it
  2. Download MS Charts from http://domain.com/apps/mscharts.zip and install it
  3. Ask Server, Database, Username and Password and replace the web.config

This is what I’m trying to do, I know I can use DotNetInstaller or even Wix for this, but both projects are huge and the learning curve is high, so I created my own Installer.

My question is, after I run the Process to install the web setup (a msi that Visual Studio created), how can I get the Full Path of where the user choose to install the site?

This is needed to find out where is the web.config file in order to correctly append the new SQL Server connection values.

The site.msi only returns an integer value using int returnCode = process.ExitCode; never the output path ..

Just thinking out loud

I probably can create a Custom Function on the site.msi to write some value into to Registry and then I can safely read on my custom installer … is this a viable option?

What can I do in such environment?

  • 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-05-25T17:06:11+00:00Added an answer on May 25, 2026 at 5:06 pm

    You could use WMI to search for the MSI installer web.config component of your setup:

    • First you have to identify the component GUID for your web.config component. Open your MSI installer package by using the Microsoft Orca tool (you will find the
      Orca tool in the Windows 7 SDK).

    • Navigate to the File table. Search for web.config in
      the FileName column. Remember the ID for the web.config component in the Component_ column.

    • Then navigate to the Component table. Search for your component with the ID found in the file’s table.

    • Copy the GUID found in the ComponentId column. This is the component GUID for your
      web.config file.
      Now, use the determined Component GUID in the following code:

      ManagementScope scope = new ManagementScope("\\\\.\\ROOT\\cimv2");
      
      ObjectQuery query = new ObjectQuery("SELECT * FROM Win32_SoftwareElement WHERE SoftwareElementID='{YOUR WEB CONFIG GUID}'");
      
      ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query);
      
      ManagementObjectCollection queryCol = searcher.Get();
      
      foreach(ManagementObject m in queryCol)
      {
        Console.Out.WriteLine("Path to web.config: {0}", m["Path"]);
      }
      

    By the same token, creating a custom installer action to write the install path to the registry
    is also a good idea!

    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 executable that is started by a windows service, this program will
I'm making a windows forms application in c# that will start in windows start
I've started to build a Windows Forms application. The application will work in two
A causal VC++ user here. I have started a 'Windows Forms Application' project in
I started a new project with type of Windows Forms application, and I put
I have only just started received the following error in my windows forms application
I just started playing with Linq to entities in a windows forms application and
I am getting a FileNotFoundException on a Windows Forms Application project, with the following
I have just started using WPF forms instead of Windows Forms forms. In a
I have recently started work on a project that has already been running for

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.