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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:18:27+00:00 2026-05-18T01:18:27+00:00

i created WiX installer project for deploying my .net winform app on a customer

  • 0

i created WiX installer project for deploying my .net winform app on a customer machine. The app only scans documents and saves the images to database on a server. The scanner is quite specific and only one in the company, but there are approx. four users that can occasionaly use it => app will be installed just on a single workstation dedicated only for scanning – most of the time it will be free and any of these users can come, scan the docs and go continuing his work.

=> i am doing a per-machine installation: ALLUSERS is hardcoded to 1.

Because the database servers in production are not controlled by me and i do not really know, where the database will be stored, i can not pack correct ConnectionStrings.config file to the MSI archive. Instead of it the setup modifies this config according to parameter values provided by the user during install. For updating the connection strings I use util:XmlFile element. The connectionstrings.config file is stored in installation directory together with app binaries.

Everything seemed to work fine, until I simulated two users using this per-machine installation. I have executed my wix setup project under my own account, the XML config file had been correctly updated and then I launched the application and tested the connection strings are ok. Everything was fine.

Then I switched to another user account. The shortcut was already present in the program menu – just as I would have expected since the installation is per-machine. So I clicked the shortcut and then (unexpectedly for me) a progress bar window “Wait until the configuration of product XY is finished.” appeared. (Note that my machine locale is not english, the message would probably be slightly different on an english locale workstation). After few seconds the window disappeared and my application launched. Unfortunately it was not able to connect to the database, since the connectionStrings.config file has been rewritten – the connection strings have been updated using default (=incorrect) property values.

I have been investigating why the setup launchs again whenever new user-account tries to use it. It is because of the shortcut element (Shortcut is placed to ‘ProgramMenuFolder’. There is a request for uninstall action, which AFAIK requires a parent Component and this Component needs a KeyPath, which has to be a registry key under HKCU.). When I remove all the Program-Menu-Shortcut-stuff from WXS, MSI is not launched again after switching user context.

Result is that I have setup program, which is able to configure connection to a database according to input parameters. But any later attempt to use the app from a second user-account just sends this configuration down the toilette. In production environment this would mean, that an administrator has to come and manually change the connection strings every time new user tries to use the app, which is of course unacceptable behavior.

This is simplified version of my WiX source:

    <?define ProductID = "11111111-1111-1111-1111-111111111111" ?>
    <?define ProductName = "MyProduct" ?>
    <?define ProductLocalName = "MyLocalLanguageProductName" ?>

    <!-- application's root registry path, where it stores its settings -->
    <?define ApplicationRootRegistryKey = "Software\MyCompany\MyProject\MyBuildConfiguration" ?>

    <Product Id="$(var.ProductID)" UpgradeCode="{11111111-1111-1111-1111-111111111112}"
             Name="$(var.ProductName)" Version="1.10.1103" 
             Manufacturer="MyCompany"Language="1029" Codepage="1250">

    <Package Id="*" InstallerVersion="200" Compressed="yes"
             Description="$(var.ProductName) Installer" Languages="1029" 
             SummaryCodepage="1250" />

        <Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />

        <!-- always install the app for all users -->
        <Property Id="ALLUSERS" Value="1"/>

        <!-- initialize properties used for adjusting connection strings.
             The user will provide valid property values through command-line -->
        <Property Id="DB_SERVER_NAME" Value="please-specify-db-server-name"/>
        <Property Id="DB_NAME" Value="please-specify-db-name"/>

        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder" Name="PFiles">
                <Directory Id="CompanyProgramFilesFolder" Name="CompanyName" >
                    <Directory Id="INSTALLDIR" Name="ProjectName">
                        <Directory Id="InstallDirApp" Name="Bin" />
                    </Directory>
                </Directory>
            </Directory>
            <Directory Id="ProgramMenuFolder" Name="Programs">
                <Directory Id="AppProgramMenuDir" Name="$(var.ProductLocalName)">
                    <Component Id="ProgramMenuDir" Guid="*">
                        <RemoveFolder Id='AppProgramMenuDir' On='uninstall'/>
                        <RegistryValue Root='HKCU' Key='$(var.ApplicationRootRegistryKey)' Type='string' Value='' KeyPath='yes' />
                    </Component>
                </Directory>
            </Directory>
        </Directory>

        <DirectoryRef Id="InstallDirApp">
            <Component Id="Executable" Guid="*">
                <File KeyPath="yes" Source="$(var.MyProject.TargetPath)">
                    <Shortcut Id="ProgramMenuShortcut" Name="$(var.ProductLocalName)"
                              Directory="AppProgramMenuDir" Advertise="yes"
                              WorkingDirectory="InstallDirApp" Icon="AppIcon.ico" IconIndex="0"/>
                </File>
            </Component>

            <!-- ConnectionStrings config file deployment and settings adjustment -->
            <Component Id="ConnectionStrings.config" Guid="*">
                <File KeyPath="yes" Source="$(var.Csob.ChequesScanning.SmartShell.TargetDir)ConnectionStrings.config" />
            <!--</Component>

            <Component Id="xml01" Guid="*">-->
                <!--<Condition><![CDATA[NOT Installed]]></Condition>-->

                <!-- this sets the connection strings according to provided parameters -->
                <util:XmlFile Id="SetConnectionString" Action="bulkSetValue"
                              File="[#ConnectionStrings.config]"
                              ElementPath="//add" Name="connectionString"
                              Value="Data Source=[DB_SERVER_NAME];Initial Catalog=[DB_NAME];Integrated Security=True;Pooling=True"
                              Permanent="yes" />
            </Component>
        </DirectoryRef>

        <Icon Id="AppIcon.ico" SourceFile="$(var.MyProject.ProjectDir)Resources\AppIcon.ico" />


        <Feature Id="ProductFeature" Title="MyProjectName" Level="1">
            <ComponentRef Id="Executable" />
            <ComponentRef Id="ConnectionStrings.config"/>
            <ComponentRef Id="ProgramMenuDir" />
        </Feature>

    </Product>
</Wix>

I have tried these steps to resolve the problem, but nothing helped me:
1) I have separated the and the to independent components.
2) I Have Tried adding a NOT INstalled under these components.
3) I have tried writing a registry value to HKLM during installation. I have added a RegistrySearch and Property for that registry value and then used that value as a condition (in fact just a replacement of “NOT Installed” from the previous)

Can anyone help with this? What am I doing wrong?

Thanks in advice

Marek

  • 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-18T01:18:28+00:00Added an answer on May 18, 2026 at 1:18 am

    Root your registry key under HKMU (See reference). This will correctly root your registry key in either HKLM or HKCU depending on the value of the ALLUSERS property.

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

Sidebar

Related Questions

I have created a wix installer project which is working fine. It installs my
I created a WiX installer deploying an add in for Windows 2010. Target system
I've created a WIX DB installer. It works on my DEV machine using SQLEXPRESS
I have a project where I create WiX (Windows Installer for XML) files, when
We have created a simple wix project for a basic windows application. Everything builds
I have created a WiX project that installs a bunch of different EXEs and
I'm trying to specify the licence for my wix setup project. I have created
Following some example code on the net, I got my first WiX installer to
I'm searching for some complete sample of wix project with reference to .NET dll
My installer, created wth WiX is localized via .wxl files. It is possible in

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.